1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Runge Kutta method to solve second order ODE

  1. Mar 26, 2012 #1
    1. The problem statement, all variables and given/known data
    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


    2. Relevant equations




    3. 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?
     
  2. jcsd
  3. Mar 26, 2012 #2
    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.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook