Is this correct second order approximation?

Click For Summary
SUMMARY

The discussion centers on the implementation of Heun's method, a two-stage Runge-Kutta technique, for solving a second-order differential equation of the form θ'' = F(θ, θ'). The proposed algorithm converts the second-order equation into two first-order equations and iteratively computes θ and ω using specific update formulas. While the second-order approximation is expected to yield better results, the user observes that the first-order approximation conserves energy more effectively in the phase space, raising questions about the accuracy of the second-order method. The user seeks clarification on the roles of F1 and F2 in the algorithm.

PREREQUISITES
  • Understanding of second-order differential equations
  • Familiarity with Heun's method and Runge-Kutta techniques
  • Knowledge of phase space analysis in dynamical systems
  • Basic programming skills for implementing numerical algorithms
NEXT STEPS
  • Study the derivation and application of Heun's method in numerical analysis
  • Explore the properties of phase space in non-dissipative systems
  • Learn about energy conservation in numerical methods for differential equations
  • Investigate the differences between first-order and second-order numerical approximations
USEFUL FOR

Mathematicians, physicists, and engineers working with differential equations, as well as students and researchers interested in numerical methods and dynamical systems analysis.

Alexandre
Messages
29
Reaction score
0
I have a second order differential equation of the form (theta is a function of time):
\theta ''=F\left(\theta ,\theta '\right)

Turning them to two first order equations I get:
\begin{cases} \theta '\:=\omega \\ \omega '=F\left(\theta ,\omega \right) \end{cases}

And here's the algorithm which I need to know whether it's correct or not:
Given the initial conditions \theta _1 and \omega _1 run loop for n
k_1=\omega _n
k_2=\omega _n+\Delta t\cdot k_1

j_1=F\left(\theta _n,\omega _n\right)
j_2=F\left(\theta _n+\Delta t\cdot j_1,\omega _n+\Delta t\cdot k_1\right)

\theta _{n+1}=\theta _n+\frac{\Delta t}{2}\cdot \left(k_1+k_2\right)
\omega _{n+1}=\omega _n+\frac{\Delta t}{2}\left(j_1+j_2\right)

It does give me a solution that is really close to first order approximation but the thing is, when I look at the phase space, first order approximation conserves energy better because curves are closer to being closed (the equation is non dissipative), so I'm wondering why is that. Second order approximation is supposed to be better.
 
Physics news on Phys.org
Is this Heun's method? I think it would go something like this given ##\theta_0,\,\omega_0##:

$$
\theta' = \omega = F_1(t,\theta) \\
\theta'' = \omega ' = F_2(t,\theta,\theta') \\
\\
k_1 = \theta_i + \Delta t F_1(t_i,\theta_1) \\
\theta_{i+1} = \theta_i + \frac{\Delta t}{2} \left [ F_1(t_i,\theta_i) + F_1(t_{i+1},k_1) \right ] \\
j_1 = \omega_i + \Delta t F_2(t_i,\theta_i,\omega_i) \\
\omega_{i+1} = \omega_i + \frac{\Delta t}{2} \left [ F_2(t_i,\theta_i,\omega_i) + F_2(t_{i+1}, \theta_{i+1}, j_1) \right ]
$$
 
Yes it's Heun's method, a.k.a. two stage Runge–Kutta method. In my case F is time independent.

I don't seem to understand what F1 and F2 are in your algorithm.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 65 ·
3
Replies
65
Views
8K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K