Coupled differential equation using ODE 45

My program is attached. I am getting dwp0dz and dwp2dz zero. Please help.

2 件のコメント

James Tursa
James Tursa 2021 年 5 月 11 日
Please delete the image and instead post your code as text highlighed by the code button. We can't copy & run pictures.
MAMTA SINGH
MAMTA SINGH 2021 年 5 月 11 日
I have removed image and inserted the code.

サインインしてコメントする。

 採用された回答

Jan
Jan 2021 年 5 月 11 日

1 投票

Yes, of course the values are 0.
The initial value of y(1) is 0. The derivative of y(1) is:
dwp0dz = ((s * alpha0 * y(1) * x0)/w);
This is 0, when y(1) is 0. So the value remains at 0.
The same happens for y(2):
dwp2dz = x1 *((alpha0 * y(1) * xr ) + (alpha0 * y(2) * x0) + (alpha2 * y(1) * x0))
% == 0 == 0 ==0
If all terms are 0, the sum is 0 also.
This means, that the calculations do exactly, what is expected. Why do you think that you need help?
A hint: c = 2.997 * 10^10 is a multiplication and an expensive power operation, while c = 2.997E10 is a cheap constant.

その他の回答 (0 件)

カテゴリ

質問済み:

2021 年 5 月 11 日

回答済み:

Jan
2021 年 5 月 11 日

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by