Solving second-order ODE with Runge-Kutta 4

  • Thread starter Thread starter LANS
  • Start date Start date
  • Tags Tags
    Ode Runge-kutta
Click For Summary

Homework Help Overview

The discussion revolves around solving a second-order ordinary differential equation (ODE) using the Runge-Kutta 4 method. Participants are examining the correct formulation of the method's steps and addressing potential typographical errors in the equations presented.

Discussion Character

  • Exploratory, Assumption checking, Mathematical reasoning

Approaches and Questions Raised

  • Participants are questioning the placement of commas in the equations for K1, K2, K3, and K4. There is uncertainty about how to define K2, particularly regarding the values of z and the implications of the initial conditions. Some participants are unsure about how to proceed with the calculations given the undefined nature of certain function values.

Discussion Status

The discussion is active, with participants providing clarifications on the notation and the structure of the Runge-Kutta method. There are differing interpretations of how to handle the calculations for K2 and subsequent steps, indicating a productive exploration of the problem without a clear consensus yet.

Contextual Notes

There are mentions of potential typos in the problem statement and the need for clarity on the initial conditions, specifically regarding the value of dy/dt at t = 0. The participants are navigating these uncertainties as they work through the problem.

LANS
Messages
24
Reaction score
0

Homework Statement


0l0AByW.jpg

Note: I think there is a typo here but I'm not sure. Is there supposed to be a comma between the delta t/2 and y_n on K2 and K3, and delta t and y_n on K4?

Homework Equations


See above.

The Attempt at a Solution


Substituting dy/t = z gives
\frac{dz}{dt} = 3z - 2ty - cos(t)<br /> <br /> \frac{dy}{dt} = z

I'm not sure where to go from here. I can find K_1, but I'm not sure how to find K_2z as it depends on t, y, and z. What do I choose for z in K2? Do I need to redefine K_2 as

f \left ( t_n + \frac{\Delta t}{2}, y_n + \frac{K_1_y}{2}, z_n + \frac{k_1_z}{2} \right ) Is there some other way I should approach the problem?

Any help is appreciated, thanks.
 
Physics news on Phys.org
In K1, there should be a comma between tn and yn.

In K2, K3, and K4, there should be commas between the delta t terms and the yn terms.

Remember z = dy/dt, and you are given dy/dt = 0 at t = 0.
 
SteamKing said:
In K1, there should be a comma between tn and yn.

In K2, K3, and K4, there should be commas between the delta t terms and the yn terms.

Remember z = dy/dt, and you are given dy/dt = 0 at t = 0.

This is aimed towards SteamKing, K1 is found with dy/dt=0, but how is K2 solved when f(0.05,1) is undefined by the question and there is no obvious way to determine the f(0.05,1).

Thanks
 
You are incrementing t between calculating K1 and K2, which is not what is called for in the definition of K1 ... K4. For K2, you use the same values for yn and t as for K1. Once you have calculated K2, you use this value to calculate K3, and you use K3 to calculate K4. Once you have calculated K1 ... K4, then you increment t by delta t and determine y(n+1).
 

Similar threads

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