Runge Kutta method to solve second order ODE

maciejj
Messages
6
Reaction score
0

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


Homework Equations






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?
 
Physics news on Phys.org
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.
 
Back
Top