4th order runge-kutta method for second order diff equation containing the first derivative

1.6k Views Asked by At

I have a differential equation like

$$\frac{d^2x}{dt^2}=C+C'\frac{dx}{dt}$$ where $C$ and $C'$ are constants

How can I solve this problem using the Runge-Kutta method?

I thought first thinking this problem as first order diff equation which in this case it would be like, $$\frac{dw}{dt}=C+C' w$$

where $$w=\frac{dx}{dt}$$

now I can find the values of $w$. After this, I am not sure how should I proceed.

2

There are 2 best solutions below

0
On

You need initial values of $x_0$ and $\omega_0$ at a $t = t_0$ $$\\$$ Then you decide on a step size $h$ $$\\$$ Using expressions at wiki page, calculate values of $w$ $$\\$$ Your last equation can be written as $x = \int\omega dt + x_0$; $$\\$$ You can estimate $x$ as $x=\sum\omega h + x_0$

0
On

A second order differential equation such as this is equivalent to a first order system: in this case $$ \eqalign{\dfrac{dx}{dt} &= v\cr \dfrac{dv}{dt} &= C + C' v\cr}$$ The Runge-Kutta method for a system is exactly the same as for a single equation, except that the "dependent variable" is a vector instead of a single variable.