I have matlab code, when i run the program i could 't get the values and also graph.Can u help me in this regards?

5 ビュー (過去 30 日間)
Here, i have attached my program.
  7 件のコメント
Torsten
Torsten 2024 年 8 月 22 日
編集済み: Torsten 2024 年 8 月 22 日
Four 2nd order equations ? You only implemented two of them: the one for f and the one for h.

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

採用された回答

Torsten
Torsten 2024 年 8 月 22 日
編集済み: Torsten 2024 年 8 月 25 日
Don't solve the equations separately (first for T and C, then for f and h) , but all four together in one call to bvp4c.
They are coupled all together.

その他の回答 (1 件)

Ronit
Ronit 2024 年 8 月 22 日
Hello Sunitha,
After executing the program, the error message indicates that the function dydx and BC are not returning the column vector of the correct length 8 to match the number of differential equations. To fix this you can try the following approach:
(Assuming P2 used in dydx is p2)
dydx = @(x,y)[y(2);
y(4);
y(6);
y(8);
-(M1*A2*y(8))-(2*1i*k1*A1-(1/k))*y(5)-n1*A4*y(6)-G1*y(1)*A6-G2*y(3)*A7;
y(7);
-(1/(1+1i*m)*A3)*y(6)-(n1*p2/(1+1i*m))*y(8);
y(5)];
BC = @(ya,yb)[ya(1)-1; % f = 1 at y = 0
ya(3)-M; % h = M at y = 0
yb(2); % df/dy = 0 as y -> infinity
yb(4); % dh/dy = 0 as y -> infinity
ya(2); % Initial condition for df/dy
ya(4); % Initial condition for dh/dy
yb(6); % Additional condition for df/dy
yb(8)]; % Additional condition for dh/dy
Please go through this post for better understanding on using bvp4c to find derivative: https://www.mathworks.com/matlabcentral/answers/1863463
Regards!
  8 件のコメント
sunitha kolasani
sunitha kolasani 2024 年 8 月 25 日
Where is the option to vote for you.
Torsten
Torsten 2024 年 8 月 25 日
Thank you for your feedback. I changed my comment to an answer for your question.

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

カテゴリ

Help Center および File ExchangeBoundary Value Problems についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by