Using ode45 To Solve a System of 2nd Order ODEs

조회 수: 2 (최근 30일)
Rafael Fehér
Rafael Fehér 2020년 12월 8일
댓글: Star Strider 2020년 12월 9일
I have the following set of 2 Second Order ODEs:
I need to solve these equations simultaneously, so that in the first equation is used in in the second equation.
I'm looking everywhere for the solution of my problem, but no luck.
I know from https://www.mathworks.com/help/matlab/math/choose-an-ode-solver.html that I need to transform a 2nd Order ODE in a 1st Order ODE, but how to do it with 2 ODEs and in an iterative way?
Can someone help me to use ode45 for this problem?
Thank you,
Rafael F.

채택된 답변

Star Strider
Star Strider 2020년 12월 8일
Code them in the Symbolic Math Toolbox, and use the functions odeToVectorField and then matlabFunction to create an anonymous function that the ODE solvers such as ode45 can use to integrate them. There are other differential equation functions in the Symbolic Math Toolbox Mathematics documentation section if these turn out not to be appropriate for your system.
  댓글 수: 2
Rafael Fehér
Rafael Fehér 2020년 12월 8일
Thank you, Mr. Strider. Using odeToVectorField and matlabFunction, I was able to solve que system of 2nd Order EDOs.
Star Strider
Star Strider 2020년 12월 9일
As always, my pleasure!

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

추가 답변 (0개)

카테고리

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