# How do I solve this ODE system where there exists derivatives in both sides?

1 view (last 30 days)
Arda Senyurek on 6 Jan 2024
Edited: Sam Chak on 6 Jan 2024
The system of ODE is the following equation.
Second equation is no of a problem but first and the third one is the problematic for me. Because I can't get them in the form that is similar when using ode45. That is, I can't seperate the derivatives because and are coupled.
Any help is appreciated. Thanks!

David Goodmanson on 6 Jan 2024
Edited: David Goodmanson on 6 Jan 2024
Hi Arda,
These two equations are of the form
p' Jxx - r' Jxz = f(...) where ... = p,q,r,J,J,M,M (a bunch of known stuff)
-p' Jxz + r' Jzz = g(...) where ... = a bunch of other known stuff
in matrix form this is
[Jxx -Jxz; -Jxz Jzz]*[p'; r'] = [f; g];
where the semicolons produce a 2x2 matrix and two 2x1 column vectors. This is solved by left divide.
[p'; r'] = [Jxx -Jxz; -Jxz Jzz]\[f; g]
which works fine for calculation, or if you prefer you can use the tedious longhand version
p' = (Jzz*f + Jxz*g) / (Jxx*Jzz - Jxz^2)
r' = (Jxz*f + Jxx*g) / (Jxx*Jzz - Jxz^2)
##### 3 CommentsShow 1 older commentHide 1 older comment
Sam Chak on 6 Jan 2024
Edited: Sam Chak on 6 Jan 2024
This is Euler's equations of rotational motion for a rigid body. Basically, David's approach allows the decoupling of the equations of motion into two separate state equations.
In MATLAB, the syntax to perform matrix left division may be given by:
J = [Jxx -Jxz;
-Jxz Jzz];
M = [Mx + fx;
Mz + fz];
dwdt(1:2) = J\M;
Arda Senyurek on 6 Jan 2024
No, I see it now, but I couldn't before asking. That's what I'm referring to in my reply. Thanks!

Alan Stevens on 6 Jan 2024
You can separate the terms as follows:
Arda Senyurek on 6 Jan 2024