PhysLean Documentation

PhysLean.ClassicalMechanics.HarmonicOscillator.Basic

The Classical Harmonic Oscillator #

i. Description #

The classical harmonic oscillator is a classical mechanical system corresponding to a mass m under a force - k x where k is the spring constant and x is the position.

ii. Summary of the key results #

The key results in the study of the classical harmonic oscillator are the follows:

In the Basic module:

In the Solution module:

iii. Table of content for this module #

iiv. References #

References for the classical harmonic oscillator include:

A. The input data #

We start by defining a structure containing the input data of the harmonic oscillator, and proving basic properties thereof. The input data consists of the mass m of the particle and the spring constant k.

The classical harmonic oscillator is specified by a mass m, and a spring constant k. Both the mass and the string constant are assumed to be positive.

  • m :

    The mass of the harmonic Oscillator.

  • k :

    The spring constant of the harmonic oscillator.

  • m_pos : 0 < self.m
  • k_pos : 0 < self.k
Instances For

    B. The angular frequency #

    From the input data, it is possible to define the angular frequency ω of the harmonic oscillator, as √(k/m).

    The angular frequency appears in the solutions to the equations of motion of the harmonic oscillator.

    Here we both define and proof properties related to the angular frequency.

    The angular frequency of the classical harmonic osscilator, ω, is defined as √(k/m).

    Equations
    Instances For
      @[simp]

      The angular frequency of the classical harmonic osscilator is positive.

      The square of the angular frequency of the classical harmonic osscilator is equal to k/m.

      The angular frequency of the classical harmonic osscilator is not equal to zero.

      The inverse of the square of the angular frequency of the classical harmonic osscilator is m/k.

      C. The energies #

      The harmonic oscillator has a kinetic energy determined by it's velocity and a potential energy deetermined by it's position. These combine to give the total energy of the harmonic oscillator.

      Here we state and prove a number of properties of these energies.

      C.1. The definitions of the energies #

      We define the three energies, it is these energies which will control the dynamics of the harmonic oscillator, through the lagrangian.

      The kinetic energy of the harmonic oscillator is $\frac{1}{2} m ‖\dot x‖^2$.

      Equations
      Instances For

        The potential energy of the harmonic oscillator is 1/2 k x ^ 2

        Equations
        Instances For

          The energy of the harmonic oscillator is the kinetic energy plus the potential energy.

          Equations
          Instances For

            C.2. Simple equalties for the energies #

            C.2. Differentiability of the energies #

            On smooth trajectories the energies are differentiable.

            C.3. Time derivatives of the energies #

            For a general smooth trajectory (which may not satisfy the equations of motion) we can compute the time derivatives of the energies.

            theorem ClassicalMechanics.HarmonicOscillator.potentialEnergy_deriv (S : HarmonicOscillator) (xₜ : TimeSpace 1) (hx : ContDiff (↑) xₜ) :
            (Time.deriv fun (t : Time) => S.potentialEnergy (xₜ t)) = fun (t : Time) => inner (Time.deriv xₜ t) (S.k xₜ t)
            theorem ClassicalMechanics.HarmonicOscillator.energy_deriv (S : HarmonicOscillator) (xₜ : TimeSpace 1) (hx : ContDiff (↑) xₜ) :
            Time.deriv (S.energy xₜ) = fun (t : Time) => inner (Time.deriv xₜ t) (S.m Time.deriv (Time.deriv xₜ) t + S.k xₜ t)

            D. Lagrangian and the equation of motion #

            We state the lagrangian, and derive from that the equation of motion for the harmonic oscillator.

            D.1. The Lagrangian #

            We define the lagrangian of the harmonic oscillator, as a function of phase-space. It is given by

            $$L(t, x, v) := \frac{1}{2} m ‖v‖^2 - \frac{1}{2} k ‖x‖^2$$

            In theory this definition is the kinetic energy minus the potential energy, however to make the lagrangian a function on phase-space we reserve this result for a lemma.

            The lagrangian of the harmonic oscillator is the kinetic energy minus the potential energy.

            Equations
            Instances For

              Part D.1.I #

              Equalitites for the lagrangian. We prove some simple equalities for the lagrangian, in particular that when applied to a trajectory it is the kinetic energy minus the potential energy.

              Part D.1.II #

              The lagrangian is smooth in all its arguments.

              Part D.1.III #

              We now show results related to the gradients of the lagrangian with respect to the position and velocity.

              D.2. The Euler-Lagrange operator #

              We now write down the Euler-Lagrange operator for the harmonic oscillator, for a trajectory $x(t)$ this is equal to

              $$t\mapsto \left.\frac{\partial L(t, \dot x (t), q)}{\partial q}\right|_{q = x(t)} - \frac{d}{dt} \left.\frac{\partial L(t, v, x(t))}{\partial v}\right|_{v = \dot x (t)}$$

              Setting this equal to zero corresponds to the Euler-Lagrange equations, and thereby the equation of motion.

              The Euler-Lagrange operator for the classical harmonic osscilator.

              Equations
              Instances For

                Part D.2.I #

                Basic equaltities for the Euler-Lagrange operator.

                theorem ClassicalMechanics.HarmonicOscillator.eulerLagrangeOp_eq (S : HarmonicOscillator) (xₜ : TimeSpace 1) :
                S.eulerLagrangeOp xₜ = fun (t : Time) => gradient (fun (x : Space 1) => S.lagrangian t x (Time.deriv xₜ t)) (xₜ t) - Time.deriv (fun (t' : Time) => gradient (fun (x : EuclideanSpace (Fin 1)) => S.lagrangian t' (xₜ t') x) (Time.deriv xₜ t')) t

                Part D.2.II #

                Relation of the Euler-Lagrange operator to variational derivative of the action.

                theorem ClassicalMechanics.HarmonicOscillator.variational_gradient_action (S : HarmonicOscillator) (xₜ : TimeSpace 1) (hq : ContDiff (↑) xₜ) :
                varGradient (fun (q' : TimeSpace 1) (t : Time) => S.lagrangian t (q' t) ((fderiv q' t) 1)) xₜ = S.eulerLagrangeOp xₜ

                Part D.3. The equation of motion #

                The equation of motion for the harmonic oscillator is given by setting the Euler-Lagrange operator equal to zero.

                THe equation of motion for the Harmonic oscillator.

                Equations
                Instances For

                  Part D.3.I. #

                  We write a simple iff statment for the definition of the equation of motions.

                  E. Newton's second law #

                  We define the force of the harmonic oscillator, and show that the equation of motion is equivalent to Newton's second law.

                  E.1. The force #

                  We define the force of the harmoic oscillator as the negative gradient of the potential energy, and show that this is equal to - k x.

                  The force of the classical harmonic oscillator defined as - dU(x)/dx where U(x) is the potential energy.

                  Equations
                  Instances For

                    part E.1.I #

                    We now show that the force is equal to - k x.

                    The force on the classical harmonic oscillator is - k x.

                    E.2. Euler-Lagrange operator and force #

                    We relate the Euler-Lagrange operator to the force, and show the relation to Newton's second law.

                    theorem ClassicalMechanics.HarmonicOscillator.eulerLagrangeOp_eq_force (S : HarmonicOscillator) (xₜ : TimeSpace 1) (hx : ContDiff (↑) xₜ) :
                    S.eulerLagrangeOp xₜ = fun (t : Time) => S.force (xₜ t) - S.m Time.deriv (Time.deriv xₜ) t

                    The Euler lagrange operator corresponds to Newton's second law.

                    E.3. Equation of motion if and only if Newton's second law #

                    We show that the equation of motion is equivalent to Newton's second law.

                    F. Energy conservation #

                    In this section we show that any trajectory satisfying the equation of motion conserves energy. This result simply follows from the definition of the energies, and their derivatives, as well as the statement that the equations of motion are equivalent to Newton's second law.

                    F.1. Energy conservation in terms of time derivatives #

                    We prove that the time derivative of the energy is zero for any trajectory satisfying the equation of motion.

                    F.1. Energy conservation in terms of constant energy #

                    We prove that the energy is constant for any trajectory satisfying the equation of motion.

                    G. Hamiltonian formulation #

                    We now turn to the Hamiltonian formulation of the harmonic oscillator. We define the canonical momentum, the Hamiltonian, and show that the equations of motion are equivalent to Hamilton's equations.

                    G.1. The canonical momentum #

                    We define the canonical momentum as the gradient of the lagrangian with respect to the velocity.

                    The equivalence between velocity and canonical momentum.

                    Equations
                    • One or more equations did not get rendered due to their size.
                    Instances For

                      Part G.1.I. #

                      An simple equality for the canonical momentum.

                      G.2. The Hamiltonian #

                      THe hamiltonian is defined as a function of time, canonical momentum and position, as

                      H = ⟪p, v⟫ - L(t, x, v)
                      

                      where v is a function of p and x through the canonical momentum.

                      The hamiltonian as a function of time, momentum and position.

                      Equations
                      Instances For

                        Part G.2.I. #

                        We prove a simple equality for the Hamiltonian, to help in computations.

                        theorem ClassicalMechanics.HarmonicOscillator.hamiltonian_eq (S : HarmonicOscillator) :
                        S.hamiltonian = fun (x : Time) (p : EuclideanSpace (Fin 1)) (x : Space 1) => 1 / 2 * (1 / S.m) * inner p p + 1 / 2 * S.k * inner x x

                        Part G.2.II. #

                        We show that the Hamiltonian is smooth in all its arguments.

                        Part G.2.II. #

                        We now write down the graidents of the Hamiltonian with respect to the momentum and position.

                        G.3. Relation between Hamiltonian and energy #

                        We show that the Hamiltonian, when evaluated on any trajectory, is equal to the energy. This is independent of whether the trajectory satisfies the equations of motion or not.

                        theorem ClassicalMechanics.HarmonicOscillator.hamiltonian_eq_energy (S : HarmonicOscillator) (xₜ : TimeSpace 1) :
                        (fun (t : Time) => S.hamiltonian t ((S.toCanonicalMomentum t (xₜ t)) (Time.deriv xₜ t)) (xₜ t)) = S.energy xₜ

                        G.3. Hamilton equation operator #

                        We define the operator on momentum-position phase-space whose vanishing is equivalent to Hamilton's equations.

                        The operator on the momentum-position phase-space whose vanishing is equivalent to the hamilton's equations between the momentum and position.

                        Equations
                        Instances For

                          G.4. Equation of motion if and only if Hamilton's equations #

                          We show that the equation of motion is equivalent to Hamilton's equations, that is to the vanishing of the Hamilton equation operator.

                          H. Equivalences between the different formulations of the equations of motion #

                          We show that the following are equivalent statements for a smooth trajectory xₜ:

                          theorem ClassicalMechanics.HarmonicOscillator.equationOfMotion_tfae (S : HarmonicOscillator) (xₜ : TimeSpace 1) (hx : ContDiff (↑) xₜ) :
                          [S.EquationOfMotion xₜ, ∀ (t : Time), S.m Time.deriv (Time.deriv xₜ) t = S.force (xₜ t), S.hamiltonEqOp (fun (t : Time) => (S.toCanonicalMomentum t (xₜ t)) (Time.deriv xₜ t)) xₜ = 0, varGradient (fun (q' : TimeSpace 1) (t : Time) => S.lagrangian t (q' t) ((fderiv q' t) 1)) xₜ = 0, (varGradient (fun (pq' : TimeEuclideanSpace (Fin 1) × Space 1) (t : Time) => inner (pq' t).1 (Time.deriv (Prod.snd pq') t) - S.hamiltonian t (pq' t).1 (pq' t).2) fun (t : Time) => ((S.toCanonicalMomentum t (xₜ t)) (Time.deriv xₜ t), xₜ t)) = 0].TFAE