system of 1st and 2nd order differential equations ode45
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a system of two 1st order diff eq and one 2nd order diff eq. I want to solve them simultaneously using ode45 and subsequently sum the solutions. I'm having troubles formulating the code for the 2nd order equation. Could you help? The code is:
Fx=@(t,xqxcxm)[ (-xqxcxm(1)+G_q .*(q-q_b)./q_b)./tau_q ;
(-xqxcxm(2) +0.3+3.*tanh(Pa_co2./Pa_co2_b -1.1))./tau_co2 ;
%insert 2nd order diff: xm'' = (-tau2* xm' -xm)/tau1^2 ]
[t, xqxcxm]=ode45(F,[0 100], [0 0 0]);
xq= xqxcxm(:,1);
xc= xqxcxm(:,2);
xm= xqxcxm(:,3);
x=xm+ xc -xq;
2 Kommentare
Walter Roberson
am 18 Okt. 2017
It is our policy that we do not remove questions with a relevant Answer, not unless the question was abusive.
Antworten (1)
Josh Meyer
am 16 Okt. 2017
The documentation explains how to express higher-order equations as first-order equations: Higher-Order ODEs
1 Kommentar
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!