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.
 
There are two things I don't understand about this problem. First, when finding the nth root of a number, there should in theory be n solutions. However, the formula produces n+1 roots. Here is how. The first root is simply ##\left(r\right)^{\left(\frac{1}{n}\right)}##. Then you multiply this first root by n additional expressions given by the formula, as you go through k=0,1,...n-1. So you end up with n+1 roots, which cannot be correct. Let me illustrate what I mean. For this...
Back
Top