Is this correct second order approximation?

AI Thread Summary
The discussion focuses on the correctness of a second order approximation for a second order differential equation, specifically using an algorithm that resembles Heun's method, a two-stage Runge-Kutta method. The user notes that while their implementation yields results close to a first order approximation, it appears to conserve energy less effectively in phase space, raising questions about its accuracy. They express confusion regarding the definitions of F1 and F2 in the context of their algorithm. The conversation emphasizes the relationship between numerical methods and energy conservation in non-dissipative systems. The method used is confirmed to be Heun's, with a clarification needed on the function definitions.
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.
 
Mathematics 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.
 
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Back
Top