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 Exchange에서 Programming에 대해 자세히 알아보기

질문:

2015년 7월 16일

댓글:

2015년 7월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by