Coupled Differential Equations - derivatives on both sides of equations

조회 수: 17(최근 30일)
I am trying to solve two coupled differential equations, but I cannot seem to figure out how to get into a form that can be solved with an ode solver. Specifically, I can't get all the derivatives to the left hand side of the equations.
The equations are:
Any help would be greatly appreciated.

채택된 답변

Andrew Newell
Andrew Newell 2017년 8월 27일
편집: Andrew Newell 2017년 8월 27일
Let's simplify things a little bit so we can better see what is going on. Let
Y = [x; y];
G1(t,Y) = 0.000053+g1(Y(1),t);
G2(t,Y) = 0.000053+g2(Y(2),t);
Then a little rearrangement gives
G1(t,Y)*(d/dt)Y(1) - 0.0000265*(d/dt)Y(2) = F1(t,Y)
G2(t,Y)*(d/dt)Y(2) - 0.0000265*(d/dt)Y(1) = F2(t,Y)
where F1(t,Y) and F2(t,Y) bundle all the remaining terms together. If we now define a "mass matrix"
M(t,Y) = [G1(t,Y) -0.0000265; -0.0000265 G2(2,Y)]
(see the odeset documentation) and a function
F(t,Y) = [F1(Y,t); F2(Y,t)];
then we can define
options = odeset('Mass',M);
and solve something like
[t,y] = ode45(F,tspan,y0)
(see the ode45 documentation). You'll have to define functions F(t,Y) and M(t,Y) to reproduce the above steps. Warning: I have been using a mixture of MATLAB and regular math to keep it simple; you can sort out the details.
  댓글 수: 3
razorfin 2017년 8월 28일
Thank you, this has been a huge help to my understanding. Have a great day!

댓글을 달려면 로그인하십시오.

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by