Solve a non linear differential equation

Hello,
I have an equation like: Az"+Bz'+Cz'sin(Dz+E)+Fz=G with A,B,C,D,E,F,G are constant, and initial conditions known.
I have to solve it using Matlab, but I really don't know how to do, even after looking for information on Internet, could you help me or tell me what function I have to use?
Thank you in advance,
Romain CHAUDET

 採用された回答

Star Strider
Star Strider 2015 年 7 月 16 日

0 投票

You can find the technique of creating a companion matrix from a differential equation in most differential equation textbooks, so I will spare you the discussion here.
[A,B,C,D,E,F,G] = deal(3,5,7,11,13,17,19);
odez = @(t,z) [z(2); (-B.*z(2)-C.*z(2).*sin(D*z(1)+E)-F.*z(1)+G)./A];
ts = linspace(1, 10, 250);
[t,z] = ode45(odez, ts, [0; 0]);
figure(1)
plot(t, z)
grid
legend('z(t)', 'z’(t)')

2 件のコメント

Romain Chaudet
Romain Chaudet 2015 年 7 月 16 日
Thank you very much for your help, this worked well!
Romain CHAUDET
Star Strider
Star Strider 2015 年 7 月 16 日
My pleasure!

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeProgramming についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by