Second oder ode solution with euler methods

??̈+ ??̇ + ?? = ???(??) where, ?(? = ?) = ? and ?̇(? = ?) = 2 ? values in the domain of [? ??]. with a step size of ?? = ?. ?. How can I solve this system using euler methods ?

4 comentarios

James Tursa
James Tursa el 1 de Mayo de 2019
What have you done so far? What specific problems are you having with your code?
I know solve first order ode but I don't know how to write script code to solve second ode
Erivelton Gualter
Erivelton Gualter el 1 de Mayo de 2019
Hello Bayram,
You can easily use the ODE solvers from Matlab. Check the link bellow:
Also, you can write your own method. Check the follow link:
Try to implement it and if you face a problem, share here your code and I will be glad to help.
Thank you James

Iniciar sesión para comentar.

Respuestas (1)

James Tursa
James Tursa el 1 de Mayo de 2019
Editada: James Tursa el 2 de Mayo de 2019
Rewrite your 2nd order equation as a pair of first order equations, then use Euler method on a 2-element vector. I.e.,
Define your 2-element state vector y as
y(1) is defined to be x
y(2) is defined to be xdot
The derivative of y(1) is y(2) by definition.
The derivative of y(2) can be found by solving your 2nd order DE for xdotdot.
See the van der Pol equation example in the doc here for an example of turning a 2nd order DE into a pair of 1st order DEs:
You can essentially use your 1st order Euler code as an outline for this 2nd order system. Simply replace the scalar state with a 2-element vector state in your code.

2 comentarios

Pranay Harjai
Pranay Harjai el 12 de Mzo. de 2020
How to replace the scalar state with a 2-element vector state
James Tursa
James Tursa el 12 de Mzo. de 2020
Open up a new question, show your current code, and then we can show you how to modify it for a 2-element state vector.

Iniciar sesión para comentar.

Productos

Preguntada:

el 1 de Mayo de 2019

Comentada:

el 12 de Mzo. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by