# Reverse Runge Kutta?

1. Nov 5, 2009

### ch2kb0x

1. The problem statement, all variables and given/known data

e^(x) + y = dy/dx, [-1,1], y(0) = 1, N = 4.

2. Relevant equations

3. The attempt at a solution
h = b-a / N = 0.5
x0= 0, y0 =1
x1= 0.5, y1 = 2.472
x2= 1, y2 = 5.433
x3= 1.5, y3= 11.195
x4=2, y4= 22.146
=====================
These were the values I got for the x's and y's. However, I would like to know if it is possible to do a reverse (backwards) runge kutta to [-1,1] range. If so, how do I compute this? (what would be my starting x0, y0).

2. Nov 5, 2009

### HallsofIvy

Staff Emeritus
Certainly- just take [/itex]\Delta x[/itex] to be negative. To use 4 steps from 0 down to -1, take $\Delta x$= -1/4.

But if your problem was to solve on [-1, 1] with N= 4, you should really be taking just two steps from 0 to 1, with $\Delta x= 1/2$ and two steps from 0 to -1 with $\Delta x= -1/2$.

3. Nov 10, 2009

### ch2kb0x

[bump]
Question revised:
1) Apply Runge-Kutta of order 4 to solve the ODE on [-1, 1] with N=4. At the very least solve for the points in the interval that are in [0,1]. Is it possible with the initial condition y(0)=1 to obtain numerical solutions in [-1,0) using Runge-Kutta? If so then how can it be done?
ODE = e^(x) + y = dy/dx, [-1,1], y(0) = 1, N = 4.
Compare with using the initial condition for the interval [-1,1]

=============================================
Basically, solving for y(0)=1 over [-1,1], N=4, I got the same answers as above which are again:
h = b-a / N = 0.5
x0= 0, y0 =1
x1= 0.5, y1 = 2.472
x2= 1, y2 = 5.433
x3= 1.5, y3= 11.195
x4=2, y4= 22.146
*Can anybody confirm these are the correct #'s, or if its necessary to go to x4, since it's 4th order runge kutta.

The second part of this question is whether it is possible with the initial condition y(0)=1 to obtain numerical solutions in [-1,0).
For this part, I am kind of confused.
I basically used x0=0 and y0=1, over [-1,0) with h = 0-(-1)/4 = .25
From this, I calculated and my answers were:
x0=0, y0=1
x1=.25, y1=1.605
x2=.5, y2=2.473
x3=.75, y3=3.705
x4=1, y4=5.437
Upon calculating these answers, I do not see any significance....or maybe there is? I do not know.