# Runge Kutta method to solve second order ODE

• maciejj
In summary, the problem is to solve the second order ODE xy''+y'+xy=0 using Runge Kutta on the interval [1,3]. The algorithm for solving second order ODEs using this method could not be found, so the strategy is to convert the equation into two first order ODEs and then apply the standard Runge Kutta method. The steps involved include defining v(x)=y'(x) and v'(x)=y''(x), writing the equations in vector form, and using the standard RK formulae to find the values of y_n+1 and v_n+1 from y_n and v_n.
maciejj

## Homework Statement

Need to solve
xy''+y'+xy=0 using Runge Kutta on x[1,3]
Couldn't find algorythm to solve second order ODE using this method
I know how to do 1st order

## The Attempt at a Solution

I know I have to make this equation into 2 first order ODE
xy''+y'+xy=0
Let v(x)=y'(x)
v'(x)=y''(x)
y'=v
xv'+v+xy=0

y'=v f1(x,y,v)
v'=-v/x-y f2(x,y,v)

now what I need to do next?

Well firstly write v'= -(xy+v)/x = f2(x,y,v) instead of what you wrote.
Your usual k1,k2,k3,k4 for first order RK now became vectors of dimension 2 ie (k1, j1), (k2,j2)...
Then just apply the standard RK method for working them out, being careful as you will need the j's to work out the k's and vice versa. You can then use the formulae to work out the y_n+1 and v_n+1 from y_n and v_n, using the (k,j) vectors as usual.

## What is the Runge Kutta method for solving second order ODE?

The Runge Kutta method is a numerical technique used to approximate the solution of a second order ordinary differential equation (ODE). It involves breaking down the ODE into a system of first order equations and using a series of calculations to iteratively find an approximate solution.

## How does the Runge Kutta method work?

The Runge Kutta method works by taking small steps in the independent variable and using a weighted combination of the derivative at different points within each step to approximate the solution. This weighted combination is calculated using a set of coefficients that are specific to the chosen version of the Runge Kutta method.

## What are the advantages of using the Runge Kutta method?

The Runge Kutta method is a widely used technique for solving ODEs because it is relatively easy to implement, accurate, and stable. It also allows for greater control over the accuracy of the solution by choosing different versions of the method with varying numbers of steps and coefficients.

## What are some common versions of the Runge Kutta method?

Some common versions of the Runge Kutta method include the classical fourth order method, the midpoint method, and the Heun's method. Each version has its own set of coefficients and steps, but they all follow the same basic principle of using a weighted combination of derivatives to approximate the solution.

## When should the Runge Kutta method be used?

The Runge Kutta method should be used when an analytical solution for a second order ODE is not possible or is too complex to calculate. It is particularly useful for solving systems of ODEs and for situations where high precision is required. However, it may not be the most efficient method for all cases, so it is important to consider other numerical techniques as well.

Replies
14
Views
2K
Replies
1
Views
2K
Replies
4
Views
941
Replies
2
Views
1K
Replies
7
Views
3K
Replies
5
Views
3K
Replies
6
Views
50K
Replies
6
Views
590
Replies
4
Views
2K
Replies
33
Views
3K