Is this correct second order approximation?

In summary: Can you clarify it for me?In summary, the conversation discusses a second order differential equation for theta, which can be turned into two first order equations. The algorithm used to solve the equations is Heun's method, which consists of two stages of calculating theta and omega. However, the speaker notes that the first order approximation seems to conserve energy better than the second order approximation, and wonders why this is the case. They then provide an example of the Heun's method with specific initial conditions.
  • #1
Alexandre
29
0
I have a second order differential equation of the form (theta is a function of time):
[itex] \theta ''=F\left(\theta ,\theta '\right) [/itex]

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

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

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

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

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
  • #2
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 ]
$$
 
  • #3
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.
 

Related to Is this correct second order approximation?

1. What is a second order approximation?

A second order approximation is a mathematical technique used to estimate a value or function by using a polynomial of degree two. It involves finding the equation of a curve that best fits the given data points, taking into account both the slope and curvature of the curve.

2. How accurate is a second order approximation?

The accuracy of a second order approximation depends on the complexity of the data being approximated and the number of data points used. Generally, a second order approximation can provide a good estimate for a smooth and continuous function, but it may not be accurate for data with sharp changes or outliers.

3. When should a second order approximation be used?

A second order approximation is often used when a linear approximation is not accurate enough, but a higher order approximation would be too complex. It is also commonly used in physics and engineering to model curved or nonlinear relationships between variables.

4. How is a second order approximation calculated?

To calculate a second order approximation, you need to have at least three data points. These points are used to find the coefficients of a quadratic equation, which is then used to estimate the value or function at any given point within the range of the data points.

5. Are there any limitations to using a second order approximation?

Yes, there are some limitations to using a second order approximation. It may not accurately represent data with sharp changes or outliers, and it may not be appropriate for highly nonlinear relationships. Additionally, the accuracy of the approximation may decrease as the distance from the data points increases.

Similar threads

Replies
2
Views
1K
Replies
2
Views
1K
  • Differential Equations
Replies
1
Views
942
  • Introductory Physics Homework Help
Replies
2
Views
786
Replies
1
Views
9K
Replies
1
Views
602
  • Differential Equations
Replies
1
Views
1K
  • Differential Equations
Replies
5
Views
2K
Replies
3
Views
265
Replies
0
Views
424
Back
Top