Solving a system of differential equations, one second order and one first order equation
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello,
I am trying to solve a system of differential equation, but one of them is first order, and the other secod order:
% d2x = -x -(sigma_0*z+sigma_1*exp(-(dx/v_d)^2)*dz+sigma_2*dx);
% dz = dx-sigma_0*abs(dx)*z/(f_c+(f_s-f_c)*exp(-(dx/v_s)^2));
where sigma_0, sigma_1, sigma_2, v_d, v_s, f_c,f_s are constants.
I tried to solve them using ode45, as i have done to solve 2 second order diffecrential equation before so:
y1=x, y2=dx, y3=z, y4=dz
dy1=y2, dy2=-y1 -(sigma_0*y3+sigma_1*exp(-(y2/v_d)^2)*y4+sigma_2*y2)
dy3=y4, dy4=? I dont have d2z, since its a first order diferential eq so I am not sure how to proced here or if there is another way to solve it.
Thank you!
0 Commenti
Risposta accettata
Sam Chak
il 7 Nov 2021
Hi @Angie
If the ODEs are
then they can be rewritten as
.
Solving the systems of equations
.
Now, you can enter ODEs as follow:
.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Ordinary Differential Equations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!