Solving a system of differential equations, one second order and one first order equation

5 次查看(过去 30 天)
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!

采纳的回答

Sam Chak
Sam Chak 2021-11-7
If the ODEs are
then they can be rewritten as
.
Solving the systems of equations
.
Now, you can enter ODEs as follow:
.
  1 个评论
Angie
Angie 2021-11-7
Thank you for your answer! Indeed, I can replace the dz in the rhs of my first equation d2x with the expression of dz from my second equation. Then my first equation d2x will be in terms of x,dx and z only and I can write its state space representation to obtain two first order equations; dy1 = dx and dy2 = f(x,dx,z). Meanwhile dy3 = dz = g(x,dx,z).
Thanks again!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Ordinary Differential Equations 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by