Solve ODE with Runge Kutta of Order 4 on [-1,1] n=5

  • Thread starter Thread starter hachi_roku
  • Start date Start date
  • Tags Tags
    Method Runge kutta
Click For Summary

Homework Help Overview

The problem involves applying the Runge-Kutta method of order 4 to solve a first-order ordinary differential equation (ODE) on the interval [-1, 1] with n = 5. The specific ODE is given as (e^x + y)dx - dy = 0, but no initial conditions are provided.

Discussion Character

  • Exploratory, Assumption checking

Approaches and Questions Raised

  • Participants discuss the need for initial conditions to apply the Runge-Kutta method effectively. There is uncertainty about how to determine the initial value y_0 without explicit information provided in the problem statement.

Discussion Status

The discussion is ongoing, with participants exploring the implications of the missing initial condition. Some suggest that the original poster might need to derive y_0 from the differential equation itself, while others emphasize the importance of having a specific value for y_0 to proceed with the calculations.

Contextual Notes

There is a reference to notes indicating that x_0 = a and y(x_0) = y_0, but the exact relationship or value for y_0 remains unclear. The step size h has been calculated as 0.4 based on the interval and number of steps, but further progress is contingent on determining y_0.

hachi_roku
Messages
61
Reaction score
0

Homework Statement


apply the runge kutta of order 4 to solve the ode on [-1,1] with n = 5 of
(e^x+y)dx-dy=0


Homework Equations





The Attempt at a Solution


the problems i have done so far gave me an initial condition to find the k values, then to plus them into the formula...i don't know how to start with no initial conditions. please help
 
Physics news on Phys.org
i have x_0 = -1

and for y_0 I am guessing i solve the diff eq and plug in -1? if i do that i get y_0= 1/2e
 
hachi_roku said:
i have x_0 = -1

and for y_0 I am guessing i solve the diff eq and plug in -1? if i do that i get y_0= 1/2e
Are you given that x0 = -1? You didn't include that fact in the initial post.

It seems to me that you need the initial condition to solve the differential equation, so you can't just solve the diff. equation to find the initial condition.

What is the exact statement of the problem?
 
the exact problem is 1) apply runge kutta of 4th order to solve the ode on [-1,1] with n = 5
(e^x+y)dx-dy=0

were i got x_0 is -1 is from my notes that said x_0 = a.
in my notes it says that y(x_0) = y_0

im pretty sure my x_0 is right but i don't know how to get y_0
 
Maybe you're supposed to do hand calculations with those two values: x_0 = a and y(a) = y_0. If your notes say x_0 = a, how do you get x_0 = -1 from that?
 
he knows x_0 is -1 from the interval [-1,1]
 
yes that's how i got -1.
 
Your differential equation is dy/dx = f(x, y) = ex + y . To use Runge-Kutta of order 4 you need to either be given h, the stepsize, or just choose one, if it's not given in the problem.

The algorithm is yn + 1 = yn + 1/6(k1 + 2k2 + 2k3 + k4), with
k1 = h*f(xn, yn)
k2 = h*f(xn + h/2, yn + k1/2)
k3 = h*f(xn + h/2, yn + k2/2)
k4 = h*f(xn + h, yn + k3)

For your problem, x0 = -1, and y0 = y(x0) = y0, according to your earlier post. It would be better if you had an actual value for y0.
 
it would be better, but none is given. do you know how i can figure out y_0?

i have h = .4 from b-a/n 1--1/5 = .4

once i have y_0 i can finish the problem, this is what i need help with.
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 65 ·
3
Replies
65
Views
9K
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 7 ·
Replies
7
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 6 ·
Replies
6
Views
51K