Runge Kutta method to solve second order ODE

  • Thread starter maciejj
  • Start date
  • #1
6
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?
 

Answers and Replies

  • #2
13
0
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.
 

Related Threads on Runge Kutta method to solve second order ODE

Replies
5
Views
1K
Replies
3
Views
3K
  • Last Post
Replies
3
Views
1K
  • Last Post
Replies
2
Views
2K
  • Last Post
Replies
2
Views
2K
Replies
6
Views
48K
Replies
2
Views
2K
Replies
0
Views
8K
Replies
1
Views
1K
Top