WOLFRAM NOTEBOOK

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
[7]
.
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.
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

    The following summary of existing open questions from our series of notebooks
    [4,5,6,8]
    establishes context for the new questions above.
    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

    In[]:=
    ClearAll[L,F,V,T,Ld];

    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
    [7]
    ,
    from which he derives the invariances and the conserved Noether’s quantity (but see the open question on ambiguity, below).

    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

    entailing mass
    m
    as a free variable:
    In[]:=
    T[v_]:=
    1
    2
    m
    2
    v
    ;

    Lagrangian (with damping)

    from Reference 7, entailing the damping constant
    b
    as a free variable:
    In[]:=
    L[q_,v_,t_]:=(T[v]-V[q])
    bt/m

    Euler-Lagrange Equation

    t
    L
    v
    -
    L
    q
    =0
    (
    1
    )

    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[]=
    b
    bt
    m
    v+
    bt
    m
    mDt[v,t]

    Second Term

    Partial derivative of
    L
    with respect to generalized coordinate
    q
    .
    In[]:=
    D[L[q,v,t],q]
    Out[]=
    -
    bt
    m
    qκ

    Sum of all Terms

    Prior to this point,
    q
    and
    v
    have been independent variables. Now we relate them: the abstract, generalized coordinate
    q
    is a function of time—the observable displacement
    x(t)
    of the oscillation—and
    v
    is its total time derivative,
    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
    κx[t]+b
    bt
    m
    x
    [t]+
    bt
    m
    m
    x
    [t]0

    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},
    1
    2
    t-
    b
    m
    -
    2
    b
    -4mκ
    m
    1
    +
    1
    2
    t-
    b
    m
    +
    2
    b
    -4mκ
    m
    2

    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
    bt/m
    , is dimensionless because the damping constant,
    b
    , has dimensions of
    force/velocity
    .
    In[]:=
    force/velocity/.force->masslength
    2
    time
    /.{velocity->length/time}
    Out[]=
    mass
    time

    Numerical Rules

    For all subsequent plots and demonstrations, choose the following values for the constants
    κ,m,C[2],C[1]
    , then manipulate
    b
    , effectively sweeping over many possibilities for the damping constant.
    In[]:=
    ClearAll[numRules];numRules={κ->1,m->1,C[2]->1,C[1]->0};

    Analytical Energy

    We need generalized velocity via a new, “dummy” differentiation variable,
    u
    , to avoid collision with plotting variable
    t
    :
    In[]:=
    D[asoln[u],u]
    Out[]=
    1
    2
    1
    2
    u-
    b
    m
    -
    2
    b
    -4mκ
    m
    -
    b
    m
    -
    2
    b
    -4mκ
    m
    1
    +
    1
    2
    1
    2
    u-
    b
    m
    +
    2
    b
    -4mκ
    m
    -
    b
    m
    +
    2
    b
    -4mκ
    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

    Noethers quantity is
    E+
    1
    2
    bx(t)v(t)
    bt/m
    , which checks out dimensionally. See Reference [7] for derivation.
    In[]:=
    ClearAll[noethersQuantity];noethersQuantity[t_]:=analyticalEnergy[t]+
    1
    2
    bRe[asoln[t]]Re[D[asoln[u],u]/.{u->t}]
    bt/m
    ;
    For overdamped solutions with
    b>=2.2
    , 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.
    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[]=
    bManip
    0.68
    Energy
    Noether's

    A Nagging Ambiguity

    In the Lagrangian,
    x(t)
    is the displacement of the oscillator from its equilibrium position, not the
    x
    coordinate of the equilibrium position. Intuitively, we expect the Lagrangian to be invariant with respect to the
    x
    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
    x(t)
    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.

    Discrete Solution

    See Reference 4 for details.
    In[]:=
    ClearAll[FMinus,FPlus];FMinus[q_]:=D[F[q,v,t],v]/.v->
    q[k+1]-q[k]
    h
    ;FPlus[q_]:=D[F[q,v,t],v]/.v->
    q[k]-q[k-1]
    h
    and write
    Pick the solution out of Wolfram’s structure and apply the numerical rules:

    Compare Solutions

    Displacement from Equilibrium

    Settling for a direct, brute-force evaluation of the recurrence:

    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

    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

    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

    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.
    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

    CITE THIS NOTEBOOK

    Wolfram Cloud

    You are using a browser not supported by the Wolfram Cloud

    Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


    I understand and wish to continue anyway »

    You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.