System of 2nd order ODE with Euler.
Show older comments
Hi,
I had a system of 2 2nd order ODE.
I got to this point :

I need to find the approximate solutions of y2(t).
M1, M2, G, L1,L2 are variables given by the user.

These are the initials conditions which are given by the user also(i guess ?)
Im a bit lost in what should i do. I know how euler works but not with this type of system.
thanks !
4 Comments
Jan
on 27 May 2021
The Euler integration worls exactly the same for systems of equations or single equations. Just write down the code and try it.
Torsten
on 27 May 2021
Implicit or explicit Euler ?
Guillaume Theret
on 27 May 2021
Guillaume Theret
on 27 May 2021
Edited: Guillaume Theret
on 27 May 2021
Accepted Answer
More Answers (1)
Torsten
on 27 May 2021
1 vote
- y0 must be a 4x1 vector, not a scalar.
- ye = zeros(4,n) instead of ye=zeros(1,n)
- ye(:,1) = y0 instead of ye(1) = y0
- ye(:,i+1) = ye(:,i) + h*f(x(i),ye(:,i)) instead of the expression in your loop
- dy = [Y(3);Y(4);Y3;Y4] instead of the row vector in your code
1 Comment
Guillaume Theret
on 27 May 2021
Categories
Find more on Multibody Dynamics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
