1. ## Runge Kutta method

Hi everyone

I am an engineering student and I am having a little difficulty with a bit of exam practice involving solving an ODE with Runge-Kutta. I am able to use both in most examples, but this one is a little different.

Any help you can give me would be amazing, so thanks for anything you can help me with!

The Question:

$\frac{d^2u}{dx^2}-\frac{1}{2}\frac{du}{dx}+\frac{17}{16}u=0$

over the interval $(0,\pi)$

and with the boundary conditions $u(0)=1, \frac{du}{dx}=0$

I have solved by using an auxhilary equation already, as outlined in the first part of the equation.

The second part of the equation is where I have the trouble with:

"For a system of first order equations on $(0,\pi]$

$\frac{du}{dx} = f(u, z, x)$
$\frac{dz}{dx} = g(u,z,x)$

with initial conditions $u(0)=u_0$ and $z(0)=z_0$, deruve the second order Runge-Kutta method based on using the trapezium rule to give approximations $u_k$ and $z_k$ to $u(x_k)$ and $z(x_k)$ for $k = 1,...N$"

I have devised two first order ODE's:

$\frac{du}{dx}=\frac{1}{2}u-\frac{17}{16}u$

and

$\frac{dz}{dx}=\frac{1}{2}z-\frac{17}{16}u$

I think these are correct, but I am unsure on how to use them correctly. Every example we have from class is using a two variable function and I cannot find anything on the internet about it ( maybe using the wrong names ).

I look forward to what you guys have to say, cheers guys.

2. Originally Posted by farso
Hi everyone

I am an engineering student and I am having a little difficulty with a bit of exam practice involving solving an ODE with Runge-Kutta. I am able to use both in most examples, but this one is a little different.

Any help you can give me would be amazing, so thanks for anything you can help me with!

The Question:

$\frac{d^2u}{dx^2}-\frac{1}{2}\frac{du}{dx}+\frac{17}{16}u=0$

over the interval $(0,\pi)$

and with the boundary conditions $u(0)=1, \frac{du}{dx}=0$

I have solved by using an auxhilary equation already, as outlined in the first part of the equation.

The second part of the equation is where I have the trouble with:

"For a system of first order equations on $(0,\pi]$

$\frac{du}{dx} = f(u, z, x)$
$\frac{dz}{dx} = g(u,z,x)$

with initial conditions $u(0)=u_0$ and $z(0)=z_0$, deruve the second order Runge-Kutta method based on using the trapezium rule to give approximations $u_k$ and $z_k$ to $u(x_k)$ and $z(x_k)$ for $k = 1,...N$"

I have devised two first order ODE's:

$\frac{du}{dx}=\frac{1}{2}u-\frac{17}{16}u$

and

$\frac{dz}{dx}=\frac{1}{2}z-\frac{17}{16}u$

I think these are correct, but I am unsure on how to use them correctly. Every example we have from class is using a two variable function and I cannot find anything on the internet about it ( maybe using the wrong names ).

I look forward to what you guys have to say, cheers guys.

Certainly looks like you've split the equation up into a first order system correctly. I think the method you are trying to find is called 'The Improved Euler Method'. It would take too long to derive the method here, but you'd be looking at using

$u_{k+1} = h(f(u_k,z_k,x_k)+f(u_k+g(u_k,z_k,x_k),z_k+f(u_k,z_ k,x_k),x_k))$

and

$z_{k+1} = h(g(u_k,z_k,x_k)+g(u_k+g(u_k,z_k,x_k),z_k+f(u_k,z_ k,x_k),x_k))$

If you want a bit of code to solve this, just let me have your email and I'll send one to you. Looks like you'll be doing well in that exam