4th order RK to solve 2nd order ODE

Click For Summary

Homework Help Overview

The discussion revolves around solving a second-order ordinary differential equation (ODE) using the 4th Order Runge-Kutta Method. The specific problem involves converting the ODE into a system of two first-order equations and approximating the solution at given points.

Discussion Character

  • Exploratory, Problem interpretation, Assumption checking

Approaches and Questions Raised

  • Participants discuss the conversion of the second-order ODE into a system of first-order equations, with attempts to define the relationships between the variables. Questions arise regarding the formulation of the function f(xn, yn) needed for the Runge-Kutta method.

Discussion Status

Some participants have provided insights into the structure of the Runge-Kutta method and its application to systems of equations. There is an ongoing exploration of how to properly express the equations and utilize LaTeX for clarity. Multiple interpretations of the problem setup are being considered.

Contextual Notes

There is an emphasis on the need for clarity in mathematical notation, with suggestions to use LaTeX for better readability. Participants are also addressing the formatting of equations within the posts.

Kanashii
Messages
9
Reaction score
0

Homework Statement


Consider the initial value problem x" + x′ t+ 3x = t; x(0) = 1, x′(0) = 2 Convert this problem to a system of two first order equations and determine approximate values of the solution at t=0.5 and t=1.0 using the 4th Order Runge-Kutta Method with h=0.1.

Homework Equations


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

The Attempt at a Solution


I tried to convert the equation into two linear ODEs:

x = x1
x′= x1' = x2
x′′= x1'' = x2'

x2' = -x2 t + t - 3x1 (first linear ODE)
x1' = x2 (second linear ODE)

I do not know what to do from here.
From 4th Order RK equations, I do not know what f(xn, yn) is.
 
Last edited by a moderator:
Physics news on Phys.org
The Runge-Kutta method give the solution to the differential equation:
$$x'(t)=f(x,t)$$

This can also be generalized to several equations by allowing ##x(t)## and ##f(x,t)## being vectors, i.e. ##x=(x_1,x_2,...,x_n)## and ##f=(f_1,f_2,...,f_n)##. So, in your case ##f=(f_1,f_2)## is a two-dimensional array containing the right-hand side of each equation.

By the way, I recommend that you use Latex to write your equations. In your post it is difficult to read them.
 
Kanashii said:

Homework Statement


Consider the initial value problem x" + x′ t+ 3x = t; x(0) = 1, x′(0) = 2 Convert this problem to a system of two first order equations and determine approximate values of the solution at t=0.5 and t=1.0 using the 4th Order Runge-Kutta Method with h=0.1.

Homework Equations


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

The Attempt at a Solution


I tried to convert the equation into two linear ODEs:

x = x1
x′= x1′ = x2
x′′= x1′′ = x2′

x2′ = -x2 t + t - 3x1 (first linear ODE)
x1′ = x2 (second linear ODE)

I do not know what to do from here.
From 4th Order RK equations, I do not know what f(xn, yn) is.

See
http://math.stackexchange.com/quest...-order-method-on-a-system-of-2-first-order-od
for a detailed explanation plus worked example.

BTW: I do not agree that your work is difficult to read; in fact, it reads surprisingly well and looks quite good. However, post #2 is correct in suggesting the use of LaTeX; you would find it much easier and faster than constantly using the [ S U B] ... [/ S U B] construction, and it wold look even better than what you have already.
 
Some of the ' need to be outside of the [ SUB] ' [/SUB]
 
epenguin said:
Some of the ' need to be outside of the [ SUB] ' [/SUB]
I moved them, so it should be OK now.
 

Similar threads

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