Reverse Runge-Kutta: Solving e^(x) + y = dy/dx [-1,1]

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 5K views
ch2kb0x
Messages
31
Reaction score
0

Homework Statement



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


Homework Equations





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).
 
Physics news on Phys.org
Certainly- just take [/itex]\Delta x[/itex] to be negative. To use 4 steps from 0 down to -1, take [itex]\Delta x[/itex]= -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 [itex]\Delta x= 1/2[/itex] and two steps from 0 to -1 with [itex]\Delta x= -1/2[/itex].
 
[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.

Assistance would be helpful