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

In summary, the conversation discusses using the Runge-Kutta method of order 4 to solve the ODE e^(x) + y = dy/dx on the interval [-1,1] with N=4 and the initial condition y(0)=1. The calculated values for x and y are x0=0, y0=1, x1=0.5, y1=2.472, x2=1, y2=5.433, x3=1.5, y3=11.195, and x4=2, y4=22.146. The second part of the conversation asks if it is possible to obtain numerical solutions in the interval [-1,0)
  • #1
ch2kb0x
31
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
  • #2
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].
 
  • #3
[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
 

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

1. What is Reverse Runge-Kutta?

Reverse Runge-Kutta is a numerical method used to solve differential equations. It is the opposite of the commonly used Runge-Kutta method, and is used to solve equations that cannot be easily solved using traditional methods.

2. How does Reverse Runge-Kutta work?

Reverse Runge-Kutta works by starting at the final point and working backwards to calculate the values at each previous point. It uses a series of iterations to approximate the solution to the equation.

3. What is the purpose of using Reverse Runge-Kutta?

The purpose of using Reverse Runge-Kutta is to solve differential equations that are difficult or impossible to solve using traditional methods. It is also useful for solving equations with a large number of points, as it is more efficient than other methods.

4. How accurate is Reverse Runge-Kutta?

The accuracy of Reverse Runge-Kutta depends on the number of iterations used and the step size. Generally, the more iterations and smaller the step size, the more accurate the solution will be. However, it may still introduce some error, especially for complex equations.

5. What are the limitations of Reverse Runge-Kutta?

Reverse Runge-Kutta may not work for all types of differential equations. It may also be less accurate for equations with steep or discontinuous solutions. Additionally, it may require a large number of iterations for highly accurate solutions, which can be computationally expensive.

Similar threads

  • Calculus and Beyond Homework Help
Replies
1
Views
2K
  • Calculus and Beyond Homework Help
Replies
12
Views
2K
  • Calculus and Beyond Homework Help
Replies
12
Views
2K
  • Programming and Computer Science
Replies
15
Views
2K
  • Calculus and Beyond Homework Help
Replies
7
Views
1K
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
8
Views
2K
  • Calculus and Beyond Homework Help
Replies
6
Views
50K
Replies
14
Views
9K
  • Calculus and Beyond Homework Help
Replies
8
Views
1K
Back
Top