Abstract
Abstract
While energy is not conserved in a damped harmonic oscillator (except exactly at critical damping), Noether’s theorem delivers a conserved quantity via invariances of a Lagrangian In this notebook, we observe the surprising result that this “Noether’s quantity” is not conserved in a numerical, early-discretized solution. In fact, it diverges with time. That is in stark contrast to the overall good energy conservation of discrete dynamics, at least in the mean. Of course, Noether’s quantity is conserved in the analytical solution.
[7]
.
The purpose of this notebook is to raise new questions about discrete dynamics:
◼
Why is Noether’s quantity poorly conserved in the early-discretized solution?
◼
Is the non-conservation of this quantity related to the diverging oscillations in energy already observed in earlier notebooks? If so, how?
We also point out a nagging ambiguity in the Lagrangian given in Reference 7. Because it delivers an analytically conserved quantity, we leave this ambiguity unresolved, but it raises another open question, though not about discrete dynamics.
Summary
Summary
The following summary of existing open questions from our series of notebooks establishes context for the new questions above.
[4,5,6,8]
For the conservative systems we have studied—simple harmonic oscillator, symmetrical top, spherical pendulum—early-discretized solutions have good long-term energy conservation about the mean, but puzzling periodic energy noise, with amplitude that diverges with time.
We have the following open questions:
◼
When energy is supposed to be conserved,
◼
discrete dynamics does a good job on average in the long term but a poor job in the short term, by oscillating about the mean
◼
energy oscillations diverge with time
◼
When energy is not supposed to be conserved
◼
discrete dynamics does a poor job conserving Noether’s quantity in both the long term and the short term
◼
RMS energy error and RMS error in Noether’s quantity decrease with time step
Because of these unanswered questions, we do not recommend early discretization across the board. By the same token, these puzzles make early discretization an interesting topic for continued study.
Analytical Solution
Analytical Solution
In[]:=
ClearAll[L,F,V,T,Ld];
Lagrangian
Lagrangian
This Lagrangian in this notebook differs from that in Reference 6 but delivers exactly the same Euler-Lagrange equations. The Lagrangian in Reference 6ß has a generalized, non-conservative force term on the right-hand side. The Lagrangian here is incorporates damping as a multiplicative factor.This Lagrangian is from Neuenschwander from which he derives the invariances and the conserved Noether’s quantity (but see the open question on ambiguity, below).
[7]
,
Potential Energy
Potential Energy
entailing spring constant κ as a free variable, i.e., not bound to a parameter of the function:
In[]:=
V[q_]:=κ
1
2
2
q
Kinetic Energy
Kinetic Energy
entailing mass as a free variable:
m
In[]:=
T[v_]:=m;
1
2
2
v
Lagrangian (with damping)
Lagrangian (with damping)
from Reference 7, entailing the damping constant as a free variable:
b
In[]:=
L[q_,v_,t_]:=(T[v]-V[q])
bt/m
Euler-Lagrange Equation
Euler-Lagrange Equation
t
∂L
∂v
∂L
∂q
(
1
)First Term
First Term
We correct the first term, a total time derivative, with explicit rules forcing the free variables to have zero total time derivatives.
In[]:=
ClearAll[constRules];constRules={Dt[m,t]->0,Dt[b,t]->0};Dt[D[L[q,v,t],v],t]/.constRules
Out[]=
bv+mDt[v,t]
bt
m
bt
m
Second Term
Second Term
Partial derivative of with respect to generalized coordinate .
L
q
In[]:=
D[L[q,v,t],q]
Out[]=
-qκ
bt
m
Sum of all Terms
Sum of all Terms
Prior to this point, and have been independent variables. Now we relate them: the abstract, generalized coordinate is a function of time—the observable displacement of the oscillation—and is its total time derivative, .
q
v
q
x(t)
v
v=q/t=x'[t]
In[]:=
deqn=((Dt[D[L[q,v,t],v],t]-D[L[q,v,t],q])/.constRules/.{v->Dt[q,t]}/.{q->x[t]})==0
Out[]=
bt
m
bt
m
′
x
bt
m
′′
x
Analytical Solution
Analytical Solution
Pick the pertinent part of the expression returned by DSolve. This is exactly the same solution as we get in Reference 6 by applying the Rayleigh dissipation function and the Lagrange-D’Alembert principle in a three-term modified Euler-Lagrange equation.
In[]:=
asoln=(DSolve[deqn,x,t])[[1,1,2]]
Out[]=
Function{t},t---4mκ+t-+-4mκ
1
2
b
m
2
b
m
1
1
2
b
m
2
b
m
2
Force Term
Force Term
We need this Rayleigh’s force term for the early-discretized formulation but not for the analytical solution.
In[]:=
F[q_,v_,t_]:=
b
2
2
v
◼
Dimensional Analysis
The exponent of , namely , is dimensionless because the damping constant, , has dimensions of .
bt/m
b
force/velocity
In[]:=
force/velocity/.force->masslength/.{velocity->length/time}
2
time
Out[]=
mass
time
Numerical Rules
Numerical Rules
For all subsequent plots and demonstrations, choose the following values for the constants , then manipulate , effectively sweeping over many possibilities for the damping constant.
κ,m,C[2],C[1]
b
In[]:=
ClearAll[numRules];numRules={κ->1,m->1,C[2]->1,C[1]->0};
Analytical Energy
Analytical Energy
We need generalized velocity via a new, “dummy” differentiation variable, , to avoid collision with plotting variable :
u
t
In[]:=
D[asoln[u],u]
Out[]=
1
2
1
2
b
m
2
b
m
b
m
2
b
m
1
1
2
1
2
b
m
2
b
m
b
m
2
b
m
2
Take only the real parts. Don’t mix in the non-physical imaginary part.
In[]:=
ClearAll[analyticalEnergy];analyticalEnergy[t_]:=V[Re[asoln[t]]]+T[Re[D[asoln[u],u]]]/.{u->t};
Analytical Conserved Quantity
Analytical Conserved Quantity
Noether’s quantity is , which checks out dimensionally. See Reference [7] for derivation.
E+bx(t)v(t)
1
2
bt/m
In[]:=
ClearAll[noethersQuantity];noethersQuantity[t_]:=analyticalEnergy[t]+bRe[asoln[t]]Re[D[asoln[u],u]/.{u->t}];
1
2
bt/m
For overdamped solutions with , we see numerical noise in Noether’s quantity as the exponential term compensates for the energy loss due to damping, but it is of no serious concern.
b>=2.2
In[]:=
Manipulate[Plot[{analyticalEnergy[t]/.numRules/.{b->bManip},noethersQuantity[t]/.numRules/.{b->bManip}},{t,0,tLim},GridLines->All,Frame->True,FrameLabel->{{"Energy [J] + Noether's",""},{"Time [s]","Analytical Energy and Noether's Quantity versus Time"}},PlotLegends->{"Energy","Noether's"}],{{bManip,0.2},0,4,Appearance->"Open"},SaveDefinitions->True]
Out[]=
A Nagging Ambiguity
A Nagging Ambiguity
In the Lagrangian, is the displacement of the oscillator from its equilibrium position, not the coordinate of the equilibrium position. Intuitively, we expect the Lagrangian to be invariant with respect to the coordinate of the equilibrium position: the dynamics should be the same wherever we place the oscillator. By the same token, we do not expect the Lagrangian to be invariant with respect to the displacement of the oscillator from its equilibrium position. However, the derivation in Reference 7 does not back up that intuition: invariance of the Lagrangian with respect to directly delivers a conserved quantity. Perhaps the resolution of the ambiguity lies in deeper mathematics. It may be possible to view the choice of position as a global choice of gauge and to characterize the invariance as a global gauge invariance. However, we leave this theoretical question open in this notebook because the Noether’s quantity from Reference 7 is manifestly conserved.
x(t)
x
x
x(t)
Discrete Solution
Discrete Solution
See Reference 4 for details.
In[]:=
ClearAll[FMinus,FPlus];FMinus[q_]:=D[F[q,v,t],v]/.v->;FPlus[q_]:=D[F[q,v,t],v]/.v->
q[k+1]-q[k]
h
q[k]-q[k-1]
h
and write
Pick the solution out of Wolfram’s structure and apply the numerical rules:
Compare Solutions
Compare Solutions
Displacement from Equilibrium
Displacement from Equilibrium
Settling for a direct, brute-force evaluation of the recurrence:
Energies
Energies
We need discrete velocities for kinetic energy. Employ a forward-backward mean difference, noting that the first and last velocities won’t be as accurate as those in the middle because they won’t have both terms.
Noether’s Quantity
Noether’s Quantity
The supposedly conserved Noether’s quantity is not conserved at all in the discrete solution! Rather than indulging in vague speculation about why that might be, we’ll leave it as the major open question raised from this investigation.
We do have the good result that the RMS error in the conserved quantity goes down as the time constant goes down, as shown in the following demonstration, which plots RMS error in Noether’s quantity versus the damping constant. This fact will be grist for the mill of future investigation.
Conclusion
Conclusion
We now have the following open questions resulting from this series of notebooks on discrete dynamics:
◼
Why is Noether’s quantity poorly conserved in the early-discretized solution?
◼
Is the non-conservation of this quantity related to the diverging oscillations in energy already observed in earlier notebooks? If so, how?
◼
The ambiguity between displacement and position in the Lagrangian of Reference 7, which delivers Noether’s quantity by an invariance calculation, is in question. This is an issue with the theory rather than with the numerical experiments.
For the conservative systems we have studied—simple harmonic oscillator, symmetrical top, spherical pendulum—early-discretized solutions have good long-term energy conservation, but puzzling periodic energy noise around the conserved mean, with amplitude that diverges with time.
◼
When energy is supposed to be conserved,
◼
discrete dynamics does a good job on average in the long term but a poor job in the short term, by oscillating about the mean
◼
energy oscillations diverge with time
◼
When energy is not supposed to be conserved
◼
discrete dynamics does a poor job conserving Noether’s quantity in both the long term and the short term
◼
RMS energy error and RMS error in Noether’s quantity decrease with time step
References
References
1
.Marsden and West, 2001, Discrete Mechanics and Variational Integrators, http://www.cds.caltech.edu/~marsden/bib/2001/09-MaWe2001/MaWe2001.pdf
2
.Matthew West, Variational Integrators, Caltech Thesis, May 2004, https://thesis.library.caltech.edu/2492/1/west_thesis.pdf
3
.Marin Kobilarov and Jerrold E. Marsden, Discrete Geometric Optimal Control on Lie Groups, IEEE Transactions on Robotics, Vol. 27, No. 4, August 2011.
4
.Discrete damped harmonic oscillator
by Brian Beckman
Wolfram Community, STAFF PICKS, May 13, 2024
https://community.wolfram.com/groups/-/m/t/3174169
by Brian Beckman
Wolfram Community, STAFF PICKS, May 13, 2024
https://community.wolfram.com/groups/-/m/t/3174169
7
.Dwight E Neuenschwander, Emmy Noether’s Wonderful Theorem, edition of 2011, page 75.
8
.Discrete variational symmetrical top: an archetype for rigid-body dynamics
by Brian Beckman
Wolfram Community, STAFF PICKS, January 1, 2025
https://community.wolfram.com/groups/-/m/t/3348245
by Brian Beckman
Wolfram Community, STAFF PICKS, January 1, 2025
https://community.wolfram.com/groups/-/m/t/3348245
CITE THIS NOTEBOOK
CITE THIS NOTEBOOK
A conserved quantity for the damped harmonic oscillator: analytical versus discrete dynamics
by Brian Beckman
Wolfram Community, STAFF PICKS, June 2, 2025
https://community.wolfram.com/groups/-/m/t/3472654
by Brian Beckman
Wolfram Community, STAFF PICKS, June 2, 2025
https://community.wolfram.com/groups/-/m/t/3472654

