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

Click For Summary
SUMMARY

The discussion focuses on applying the Runge-Kutta method of order 4 to solve the ordinary differential equation (ODE) e^(x) + y = dy/dx over the interval [-1, 1] with the initial condition y(0) = 1 and N = 4. The calculated values for y at specific x points were confirmed, showing a consistent pattern. The user inquired about the feasibility of obtaining numerical solutions in the interval [-1, 0) using the same initial condition, and provided calculations that yielded values for y at x = 0, 0.25, 0.5, and 0.75, but expressed uncertainty about their significance.

PREREQUISITES
  • Understanding of ordinary differential equations (ODEs)
  • Familiarity with the Runge-Kutta method, specifically order 4
  • Basic knowledge of numerical methods for solving differential equations
  • Ability to perform calculations with step sizes and intervals
NEXT STEPS
  • Learn the implementation of the Runge-Kutta method in Python using libraries like NumPy or SciPy
  • Explore the concept of stability in numerical methods for ODEs
  • Study the implications of varying step sizes in numerical solutions
  • Investigate alternative numerical methods for solving ODEs, such as Euler's method and adaptive step size methods
USEFUL FOR

Students and professionals in mathematics, engineering, and computational sciences who are working on numerical solutions for ordinary differential equations, particularly those interested in the Runge-Kutta method.

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 \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.
 
[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
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 6 ·
Replies
6
Views
51K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
7
Views
2K
Replies
14
Views
5K