Solve 2nd order ordinary differential equations (Runge Kutta)

2 Ansichten (letzte 30 Tage)
Daniel Jordan
Daniel Jordan am 15 Apr. 2022
Kommentiert: Torsten am 15 Apr. 2022
I have a second order differential equation which I need to solve, and plot the first 6 seconds of x(t). I wanted to use the Runge Kutta method but I'm struGgling to get my head around how to do it. Here's my equation:
d2xdt2=100*sin(8*pi*t)-(100*x)-2*dxdt
x(0) = 0
dxdt(0) = 0
I've tried using ode45 but I'm not sure how to define the function, ideally I want to use a manual method, ie recreate the Runge Kutta algorithm in MATLAB.
Any help is appreciated
Thanks
  1 Kommentar
Torsten
Torsten am 15 Apr. 2022
Look at the example
"Solve Nonstiff Equation"
under
on how to rewrite your equation and apply ODE45 to solve it.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Numerical Integration and Differential Equations finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by