Solving a coupled set of differential equations in MATLAB?

조회 수: 5 (최근 30일)
Kevin Bachovchin
Kevin Bachovchin 2011년 9월 18일
댓글: DEBASHIS PANDA 2015년 9월 11일
Hello,
I have a set of coupled differential equations Ax + B dx/dt + C dy/dt = D Ey + F dy/dt + G dx/dt = H
The problem I have is that each derivative depends on the derivative of the other variable. Specifically dx/dt depends on dy/dt (not just merely y) and dy/dt also depends on dx/dt (not just merely x). Can I solve this system somehow using ode45? If not, is there some other differential equation solver I can use?

채택된 답변

Kevin Bachovchin
Kevin Bachovchin 2012년 1월 13일
I was not able to find an easy way to do this. I had to define a new variable and use substitution in order to solve.
So originally my system of differential equations is Ax + B dx/dt + C dy/dt = D Ey + F dy/dt + G dx/dt = H
In matrix notation this can be represented as
[B C ; G F] [dx/dt ; dy/dt] = -[A 0 ; 0 E] [x ; y] + [D ; H]
Now we need to define new variables x_hat and y_hat
Let [x_hat ; y_hat] = [B C ; G F] [x ; y] So, in reverse, [x ; y] = inv([B C ; G F]) [x_hat ; y_hat]
Making this substitution into the differential equation system
[dx_hat/dt ; dy_hat/dt] = -[A 0 ; 0 E] inv([B C ; G F]) [x_hat ; y_hat] + [D ; H]
Now this system of differential equations can be solved for by ode45 in terms of x_hat and y_hat (since the derivatives of x_hat and y_hat do not depend on each other).
Of course, once you have the solution in terms of x_hat and y_hat, it's necessary to convert back to x and y.
  댓글 수: 1
DEBASHIS PANDA
DEBASHIS PANDA 2015년 9월 11일
Hi..... please you tell me how to get x,y from x_hat and y_hat

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

추가 답변 (1개)

ashish
ashish 2012년 1월 13일
I do have the similar equation. Can you help me solve this?

카테고리

Help CenterFile Exchange에서 Ordinary Differential Equations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by