Second Order Runge Kutta for Simple Harmonic Motion

In summary, the ordinary differential equation for simple harmonic motion can be rewritten as two first-order ODEs suitable for solution using Runge-Kutta methods. The second-order Runge-Kutta solution for this system after the first time step can be found by setting y1 = x and y2 = v and using the equations k1 = hf(xn, yn), k2 = hf(x+h, y+k1), and y_(n+1) = y_n+(1/2)k_1+(1/2)k_2. The leading error term in x(h) is proportional to h^3.
  • #1
Abigail1997
6
0

Homework Statement


The ordinary differential equation describing shm is
d^2x/dt^2=-w^2x
where x is the displacement, t is the time and w is the frequency. If x=0 at t=0, the analytical solution is x=Asin(wt), where A is the amplitude.

1) Rewite equation 1 as two first oder ode's suitable for solution using Runge Kutta Methods
2)Determine the second order runge-kutta solution for this system after the first time step h and show the leading error term in x(h) is proportional to h^3

Homework Equations


k1=hf(xn,yn)
k2=hf(x+h, y+k1)
y_(n+1)=y_n+(1/2)k_1+(1/2)k_2

The Attempt at a Solution


I have completed part 1 and got dx/dt=v and dv/dt=-w^2x but I am unsure how to proceed. The lecturer didn't do a great job of explaining the method and I don't know how to do it when you have two equations and are not given the step size.
 
Physics news on Phys.org
  • #2
The relate what you got and the equations of the Runge-Kutta algorithm, set ##y_1 \equiv x## and ##y_2 \equiv v##, and remember that
$$
\frac{d y_n}{dt} = f_n
$$
 

1. What is Second Order Runge Kutta?

Second Order Runge Kutta is a numerical method used to solve differential equations. It is an improvement over the first order Runge Kutta method and is more accurate for solving second order differential equations.

2. How does Second Order Runge Kutta work?

Second Order Runge Kutta works by using a weighted average of two slopes to estimate the next value in a sequence. It uses the current value and the slope at that point, as well as an estimate for the next value using a midpoint slope. This results in a more accurate estimation compared to the first order method.

3. What is Simple Harmonic Motion?

Simple Harmonic Motion is a type of periodic motion where the restoring force is directly proportional to the displacement from the equilibrium position. Examples of simple harmonic motion include a mass on a spring or a pendulum swinging back and forth.

4. How is Second Order Runge Kutta used for Simple Harmonic Motion?

To use Second Order Runge Kutta for Simple Harmonic Motion, the differential equation describing the motion is first converted into a system of first order differential equations. Then, the method is applied to each equation to calculate the position and velocity at each time step. This can be repeated to simulate the motion over time.

5. What are the advantages of using Second Order Runge Kutta for Simple Harmonic Motion?

Second Order Runge Kutta is more accurate compared to the first order method, providing a better estimation of the position and velocity at each time step. It is also more efficient and requires fewer steps to achieve the same level of accuracy. Additionally, it can be easily applied to more complex systems of differential equations, making it a versatile method for solving problems in physics and engineering.

Similar threads

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