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

In summary, the student is trying to solve a differential equation using a Runge-Kutta algorithm. They need the initial condition to solve the equation, and are not given that information.
  • #1
hachi_roku
61
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
  • #2
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
 
  • #3
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?
 
  • #4
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
 
  • #5
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?
 
  • #6
he knows x_0 is -1 from the interval [-1,1]
 
  • #7
yes that's how i got -1.
 
  • #8
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.
 
  • #9
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.
 

1. What is an ODE?

An ODE (Ordinary Differential Equation) is a mathematical equation that describes the relationship between a function and its derivatives. It is commonly used in physics, engineering, and other scientific fields to model systems that change over time.

2. What is the Runge Kutta method?

The Runge Kutta method is a numerical technique used to solve ODEs. It involves breaking down the problem into smaller steps and using a weighted average of multiple approximations to calculate a more accurate solution.

3. What is the order of Runge Kutta method?

The order of the Runge Kutta method refers to the number of approximations used in the calculation. The higher the order, the more accurate the solution will be. In this case, we are using a fourth-order Runge Kutta method, which means it uses four approximations to calculate the solution.

4. What is the interval [-1,1] n=5 in the context of solving ODEs with Runge Kutta of Order 4?

The interval [-1,1] represents the range of values for the independent variable (usually denoted as x) over which the ODE is being solved. The n=5 indicates that the interval is being divided into 5 smaller intervals, with a step size of 0.2. This is necessary for the Runge Kutta method to calculate the solution.

5. How accurate is the solution obtained using Runge Kutta of Order 4 on [-1,1] n=5?

The accuracy of the solution depends on the complexity of the ODE and the step size used. However, in general, a fourth-order Runge Kutta method is considered to be highly accurate and is widely used in scientific and engineering applications. The smaller the step size (i.e. the higher the value of n), the more accurate the solution will be.

Similar threads

  • Calculus and Beyond Homework Help
Replies
14
Views
2K
Replies
14
Views
199
  • Calculus and Beyond Homework Help
Replies
1
Views
2K
  • Programming and Computer Science
Replies
15
Views
2K
Replies
9
Views
2K
  • Calculus and Beyond Homework Help
Replies
5
Views
3K
  • Calculus and Beyond Homework Help
Replies
1
Views
1K
  • Calculus and Beyond Homework Help
Replies
7
Views
3K
  • Differential Equations
Replies
6
Views
2K
Replies
1
Views
9K
Back
Top