Solving a coupled set of differential equations in MATLAB?

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

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

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by