Runge Kutta Method for 2nd ODE

47 Views Asked by At

Given the equation $$ y''=c\cdot(1+(y')^2)^{1/2} ~~where~~ c=0.053. $$ Putting this in system form, I get \begin{align} y'&=z \\ y''&=c⋅(1+z^2)^{1/2} \end{align} I am to use 4th Order Runge-Kutta method to solve this for $y(30)$,

given initial conditions $y(0)=25$ and $y'(0)=0$.

However, I am confused as to how I incorporate $y$ into my method if $y$ is not in the given equation.

Any help would be really appreciated.

2

There are 2 best solutions below

0
On

You are right that you could apply the integration only to $z=y'$, $z'=c\sqrt{1+z^2}$, $z(0)=y'(0)$ and then obtain $y$ via cumulative summation of the function table of $z$.

However, in treating it as a system there is no difference if $y$ occurs explicitly or not, the formulation of the vector version of RK4 takes no notice of the variable dependencies of the component functions.

If $y'=f(y,z)$ and $z'=g(y,z)$, here with $f(y,z)=z$ and $g(y,z)=h(z)$, then the RK4 stages start as

k1y = dt*f(y,z)
k1z = dt*g(y,z)

k2y = dt*f(y+0.5*k1y, z+0.5*k1z)
k2z = dt*g(y+0.5*k1y, z+0.5*k1z)

etc.

0
On

By integration, $$\frac{y''}{\sqrt{1+y'^2}}=c$$

gives

$$\text{arsinh }y'=cx+d,$$

$$y'=\sinh(cx+d)$$ and

$$y=\frac1c\cosh(cx+d)+e$$

where

$$\sinh d=0,$$

$$\frac1c\cosh(d)+e=25.$$

Do you really need numerical integration ?