PhysLean Documentation

PhysLean.ClassicalMechanics.HarmonicOscillator.Solution

Solutions to the classical harmonic oscillator #

i. Overview #

In this module we define the solutions to the classical harmonic oscillator, prove that they satisfy the equation of motion, and prove some properties of the solutions.

ii. Key results #

iii. Table of contents #

iv. References #

References for the classical harmonic oscillator include:

A. The initial conditions #

We define the type of initial conditions for the harmonic oscillator. The initial conditions are currently defined as an initial position and an initial velocity, that is the values of the solution and its time derivative at time 0.

A.1. Definition of the initial conditions #

We start by defining the type of initial conditions for the harmonic oscillator.

The initial conditions for the harmonic oscillator specified by an initial position, and an initial velocity.

Instances For

    A.1.1. Extensionality lemma #

    We prove an extensionality lemma for InitialConditions. That is, a lemma which states that two initial conditions are equal if their initial positions and initial velocities are equal.

    theorem ClassicalMechanics.HarmonicOscillator.InitialConditions.ext {IC₁ IC₂ : InitialConditions} (h1 : IC₁.x₀ = IC₂.x₀) (h2 : IC₁.v₀ = IC₂.v₀) :
    IC₁ = IC₂

    A.2. Relation to other types of initial conditions #

    We relate the initial condition given by an initial position and an initial velocity to other specifications of initial conditions.

    In this section, we implement alternative ways to specify initial conditions for the harmonic oscillator. The standard InitialConditions type specifies position and velocity at time t=0, but in practice it is often useful to specify initial conditions at other times or in other forms.

    Currently implemented:

    Future work (to be added in separate PRs) :

    All alternative forms can be converted to the standard InitialConditions type via conversion functions, and we prove that the converted initial conditions produce trajectories that satisfy the original specifications.

    A.2.1. Initial conditions at arbitrary time #

    We define a type for initial conditions specified at an arbitrary time t₀, rather than at t=0. This is useful when the natural reference point for a problem is not at time zero.

    Initial conditions for the harmonic oscillator specified at an arbitrary time t₀.

    This structure allows specifying the position and velocity at any time t₀, not necessarily at t=0. This is useful for problems where the natural reference time is not zero.

    The conditions can be converted to the standard InitialConditions format (at t=0) using the toInitialConditions function.

    Instances For
      A.2.1.1. Extensionality lemma #

      We prove an extensionality lemma for InitialConditionsAtTime.

      theorem ClassicalMechanics.HarmonicOscillator.InitialConditionsAtTime.ext {IC₁ IC₂ : InitialConditionsAtTime} (h1 : IC₁.t₀ = IC₂.t₀) (h2 : IC₁.x_t₀ = IC₂.x_t₀) (h3 : IC₁.v_t₀ = IC₂.v_t₀) :
      IC₁ = IC₂
      A.2.1.2. Conversion to standard initial conditions #

      We now define the conversion from InitialConditionsAtTime to the standard InitialConditions.

      The conversion works by "running the trajectory backward in time" from t₀ to 0. Given that we know x(t₀) and v(t₀), we use the harmonic oscillator solution formula with time-reversal to determine what x(0) and v(0) must have been.

      Mathematically, if x(t) = cos(ωt)·x₀ + (sin(ωt)/ω)·v₀, then setting t = t₀: x(t₀) = cos(ωt₀)·x₀ + (sin(ωt₀)/ω)·v₀ v(t₀) = -ω·sin(ωt₀)·x₀ + cos(ωt₀)·v₀

      Solving this linear system for x₀ and v₀ gives the formulas below.

      Convert initial conditions at time t₀ to standard initial conditions at t=0.

      This conversion uses the harmonic oscillator solution formula with time-reversal. The resulting InitialConditions will produce a trajectory that passes through x_t₀ with velocity v_t₀ at time t₀.

      See toInitialConditions_trajectory_at_t₀ and toInitialConditions_velocity_at_t₀ for the correctness proofs.

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

        The correctness proofs showing that the conversion produces the expected trajectory are given later in section D.1, after the trajectory machinery has been defined.

        A.3. The zero initial conditions #

        The zero initial conditions are the initial conditions with zero initial position and zero initial velocity.

        In the end, we will see that this corresponds to the solution which is identically zero, i.e. the particle remains at rest at the origin.

        A.3.1. Simple results for the zero initial conditions #

        Some simple results about the zero initial conditions.

        @[simp]

        The zero initial condition has zero starting point.

        @[simp]

        The zero initial condition has zero starting velocity.

        B. Trajectories associated with the initial conditions #

        To each initial condition we association a trajectory. We will prove some basic properties of these trajectories.

        Eventually we will show that these trajectories satisfy the equation of motion, for now we can think of them as some choice of trajectory associated with the initial conditions.

        B.1. The trajectory associated with the initial conditions #

        Given initial conditions, the solution to the classical harmonic oscillator.

        Equations
        Instances For

          B.1.1. Definitional equality for the trajectory #

          We show a basic definitional equality for the trajectory.

          B.2. The trajectory for zero initial conditions #

          The trajectory for zero initial conditions is the zero function.

          @[simp]

          For zero initial conditions, the trajectory is zero.

          B.3. Smoothness of the trajectories #

          The trajectories for any initial conditions are smooth functions of time.

          B.4. Velocity of the trajectories #

          We give a simplification of the velocity of the trajectory.

          B.5. Acceleration of the trajectories #

          We give a simplification of the acceleration of the trajectory.

          B.6. The initial conditions of the trajectories #

          We show that, unsurprisingly, the trajectories have the initial conditions used to define them.

          @[simp]

          For a set of initial conditions IC the position of the solution at time 0 is IC.x₀.

          C. Trajectories and Equation of motion #

          The trajectories satisfy the equation of motion for the harmonic oscillator.

          C.1. Uniqueness of the solutions #

          We show that the trajectories are the unique solutions to the equation of motion for the given initial conditions. This is currently a TODO.

          The trajectories to the equation of motion for a given set of initial conditions are unique.

          Semiformal implementation:

          • One may needed the added condition of smoothness on x here.
          • EquationOfMotion needs defining before this can be proved.

          D. The energy of the trajectories #

          For a given set of initial conditions, the energy of the trajectory is constant, due to the conservation of energy. Here we show it's value.

          D.1. Correctness of InitialConditionsAtTime conversion #

          We now prove the correctness lemmas for the InitialConditionsAtTime.toInitialConditions conversion function. These show that the conversion produces a trajectory that passes through the specified position and velocity at the specified time.

          The energy of the trajectory at time t₀ equals the energy computed from the initial conditions at t₀.

          E. The trajectories at zero velocity #

          We study the properties of the trajectories when the velocity is zero.

          E.1. The times at which the velocity is zero #

          We show that if the velocity of the trajectory is zero, then the time satisfies the condition that

          tan (S.ω * t) = IC.v₀ 0 / (S.ω * IC.x₀ 0)
          

          E.2. A time when the velocity is zero #

          We show that as long as the initial position is non-zero, then at the time arctan (IC.v₀ 0 / (S.ω * IC.x₀ 0)) / S.ω the velocity is zero.

          E.3. The position when the velocity is zero #

          We show that the position is equal to √(‖IC.x₀‖^2 + (‖IC.v₀‖/S.ω)^2) when the velocity is zero.

          F. Some open TODOs #

          We give some open TODOs for the classical harmonic oscillator.