Physlib.ClassicalMechanics.HarmonicOscillator.Basic
The Classical Harmonic Oscillator
i. Overview
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.
In this file, a coordinate system is assumed where position and velocity both have type `EuclideanSpace ℝ (Fin 1)`. This is a simpler model often used for pedagogical purpose, but only works because both the configuration space (position) and its tangent space (velocity) are isomorphic to Euclidean Space. A proper formalisation should include the geometric properties of the state space via manifolds and tangent bundles.
ii. Key results
The key results in the study of the classical harmonic oscillator are the follows:
In the `Basic` module: - `HarmonicOscillator` contains the input data to the problem. - `EquationOfMotion` defines the equation of motion for the harmonic oscillator. - `energy_conservation_of_equationOfMotion` proves that a trajectory satisfying the equation of motion conserves energy. - `equationOfMotion_tfae` proves that the equation of motion of motion is equivalent to - Newton's second law, - Hamilton's equations, - the variational principal for the action, - the Hamilton variation principal.
In the `Solution` module: - `InitialConditions` is a structure for the initial conditions for the harmonic oscillator. - `trajectories` is the trajectories to the harmonic oscillator for given initial conditions. - `trajectories_equationOfMotion` proves that the solution satisfies the equation of motion.
iii. Table of contents
- A. The input data - B. The angular frequency - C. The energies - C.1. The definitions of the energies - C.2. Simple equalities for the energies - C.3. Differentiability of the energies - C.4. Time derivatives of the energies - D. Lagrangian and the equation of motion - D.1. The Lagrangian - D.1.1. Equalities for the lagrangian - D.1.2. Smoothness of the lagrangian - D.1.3. Gradients of the lagrangian - D.2. The variational derivative of the action - D.2.1. Equality for the variational derivative - D.3. The equation of motion - D.3.1. Equation of motion if and only if variational-gradient of Lagrangian is zero - E. Newton's second law - E.1. The force - E.1.1. The force is equal to `- k x` - E.2. Variational derivative of lagrangian and force - E.3. Equation of motion if and only if Newton's second law - F. Energy conservation - F.1. Energy conservation in terms of time derivatives - F.2. Energy conservation in terms of constant energy - G. Hamiltonian formulation - G.1. The canonical momentum - G.1.1. Equality for the canonical momentum - G.2. The Hamiltonian - G.2.1. Equality for the Hamiltonian - G.2.2. Smoothness of the Hamiltonian - G.2.3. Gradients of the Hamiltonian - G.3. Relation between Hamiltonian and energy - G.4. Hamilton equation operator - G.5. Equation of motion if and only if Hamilton's equations - H. Equivalences between the different formulations of the equations of motion
iv. References
References for the classical harmonic oscillator include: - Landau & Lifshitz, Mechanics, page 58, section 21.
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`.
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.
C. The energies
The harmonic oscillator has a kinetic energy determined by it's velocity and a potential energy determined 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.
C.2. Simple equalities for the energies
C.3. Differentiability of the energies
On smooth trajectories the energies are differentiable.
C.4. 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.
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
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.
#### D.1.1. Equalities for the lagrangian
Equalities 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.
#### D.1.2. Smoothness of the lagrangian
The lagrangian is smooth in all its arguments.
#### D.1.3. Gradients of the lagrangian
We now show results related to the gradients of the lagrangian with respect to the position and velocity.
D.2. The variational derivative of the action
We now write down the variational derivative for the harmonic oscillator, for a trajectory this is equal to
Setting this equal to zero corresponds to the Euler-Lagrange equations, and thereby the equation of motion.
#### D.2.1. Equality for the variational derivative
Basic equalities for the variational derivative of the action.
D.3. The equation of motion
The equation of motion for the harmonic oscillator is given by setting the variational derivative of the action equal to zero.
#### D.3.1. Equation of motion if and only if variational-gradient of Lagrangian is zero
We write a simple iff statement 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 harmonic oscillator as the negative gradient of the potential energy, and show that this is equal to `- k x`.
#### E.1.1. The force is equal to `- k x`
We now show that the force is equal to `- k x`.
E.2. Variational derivative of lagrangian and force
We relate the variational derivative of lagrangian to the force, and show the relation 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.2. 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.
#### G.1.1. Equality for the canonical momentum
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.
#### G.2.1. Equality for the Hamiltonian
We prove a simple equality for the Hamiltonian, to help in computations.
#### G.2.2. Smoothness of the Hamiltonian
We show that the Hamiltonian is smooth in all its arguments.
#### G.2.3. Gradients of the Hamiltonian
We now write down the gradients 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.
G.4. Hamilton equation operator
We define the operator on momentum-position phase-space whose vanishing is equivalent to Hamilton's equations.
G.5. 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ₜ`: - The equation of motion holds. (aka the Euler-Lagrange equations hold.) - Newton's second law holds. - Hamilton's equations hold. - The variational principle for the action holds. - The Hamilton variational principle holds.
49 declarations
The spring constant of a classical harmonic oscillator is non-zero, that is, .
The mass of a classical harmonic oscillator is non-zero, that is, .
Angular frequency
For a classical harmonic oscillator with mass and spring constant , the angular frequency is defined as the square root of the ratio of the spring constant to the mass:
The angular frequency of a classical harmonic oscillator is strictly positive, that is, .
For a classical harmonic oscillator with mass and spring constant , the square of the angular frequency is equal to the ratio of the spring constant to the mass:
For a classical harmonic oscillator, the angular frequency is not equal to zero, i.e., .
For a classical harmonic oscillator with mass , spring constant , and angular frequency , the inverse of the square of the angular frequency is equal to the ratio of the mass to the spring constant:
Kinetic energy
For a classical harmonic oscillator with mass , the kinetic energy of a trajectory in a 1-dimensional Euclidean space is a function of time defined by: where denotes the time derivative of the position and is the real inner product. This is equivalent to the expression .
Potential energy
The potential energy of a classical harmonic oscillator with spring constant at position is defined as , where denotes the real inner product on the 1-dimensional Euclidean space.
Total energy
For a classical harmonic oscillator and a trajectory in a 1-dimensional Euclidean space, the total energy at time is defined as the sum of the kinetic energy and the potential energy : where is the kinetic energy of the trajectory and is the potential energy at position .
Kinetic energy
For a classical harmonic oscillator with mass and a trajectory in a 1-dimensional Euclidean space, the kinetic energy at time is given by where denotes the time derivative of the position and represents the standard real inner product.
The potential energy is equal to
For a classical harmonic oscillator with spring constant , the potential energy at a position is given by , where denotes the standard real inner product on the 1-dimensional Euclidean space.
Total energy
For a classical harmonic oscillator and a trajectory in a 1-dimensional Euclidean space, the total energy at any time is the sum of the kinetic energy of the trajectory and the potential energy at position :
Kinetic Energy is Differentiable for Smooth Trajectories
For a classical harmonic oscillator with mass , if a trajectory in 1-dimensional Euclidean space is a smooth () function of time, then the kinetic energy is differentiable with respect to .
Potential Energy is Differentiable for Smooth Trajectories
Consider a classical harmonic oscillator with spring constant . Let be a smooth () trajectory. Then the potential energy as a function of time, , is differentiable with respect to .
Total Energy is Differentiable for Smooth Trajectories
Consider a classical harmonic oscillator . Let be a trajectory in 1-dimensional Euclidean space that is a smooth () function of time. Then the total energy , defined as the sum of the kinetic energy and the potential energy, is differentiable with respect to time .
for Harmonic Oscillator
Consider a classical harmonic oscillator with mass . Let be a smooth () trajectory in 1-dimensional Euclidean space. Then the time derivative of the kinetic energy is given by: where is the velocity (the first time derivative of ), is the acceleration (the second time derivative of ), and denotes the real inner product.
Time Derivative of Potential Energy for a Harmonic Oscillator
Let be a classical harmonic oscillator with spring constant . For a smooth () trajectory in 1-dimensional Euclidean space, the time derivative of the potential energy is given by: where denotes the time derivative of the position (velocity) at time , and represents the standard inner product on the 1-dimensional Euclidean space.
Time Derivative of Total Energy for the Harmonic Oscillator
Consider a classical harmonic oscillator with mass and spring constant . For any smooth () trajectory in 1-dimensional Euclidean space, the time derivative of the total energy is given by: where and denote the first and second time derivatives of the position (velocity and acceleration respectively), and represents the standard real inner product.
Lagrangian of the harmonic oscillator
For a classical harmonic oscillator with mass and spring constant , the Lagrangian is a real-valued function of time , position , and velocity . It is defined as the difference between the kinetic energy and the potential energy: where denotes the standard inner product on the 1-dimensional Euclidean space.
Lagrangian of the harmonic oscillator
For a classical harmonic oscillator with mass and spring constant , the Lagrangian is the function of time , position , and velocity defined by: where and denotes the standard real inner product.
The Lagrangian of the Harmonic Oscillator is
For a classical harmonic oscillator with mass and spring constant , let be a trajectory in 1-dimensional Euclidean space and be its time derivative. At any time , the Lagrangian evaluated at position and velocity is equal to the kinetic energy of the trajectory minus the potential energy of the position:
The Lagrangian of the harmonic oscillator is
For any , the Lagrangian of the classical harmonic oscillator is -times continuously differentiable () with respect to its arguments: time , position , and velocity . This implies that the Lagrangian is a smooth () function of .
The inverse Riesz representation of is
In the 1-dimensional real Euclidean space equipped with the standard inner product , let be the Riesz representation isomorphism (the `toDual` map) which identifies a vector with the continuous linear functional . For any vector , let be the continuous linear functional defined by . Then the inverse of the Riesz isomorphism applied to returns the original vector :
The gradient of is
For any vector in the 1-dimensional real Euclidean space (represented as `EuclideanSpace ℝ (Fin 1)`), the gradient of the function (the squared norm) evaluated at is equal to .
in 1D Euclidean Space
Let be a real constant and be a vector in the 1-dimensional real Euclidean space . The gradient of the function evaluated at is equal to , where denotes the standard inner product on .
for the Harmonic Oscillator
For a classical harmonic oscillator with spring constant , let be the Lagrangian defined as the difference between kinetic and potential energy. For any time , position , and velocity , the gradient of the Lagrangian with respect to the position is equal to : where denotes the 1-dimensional real Euclidean space.
for the Harmonic Oscillator
For a classical harmonic oscillator with mass and spring constant , the gradient of the Lagrangian with respect to the velocity is equal to . Here, denotes time, denotes the position in 1-dimensional Euclidean space , and is the standard inner product.
Variational gradient of the action for a harmonic oscillator
Given a trajectory , this definition computes the variational gradient of the action functional , where is the Lagrangian of the harmonic oscillator. This result is a function of time representing the Euler-Lagrange operator evaluated along the trajectory: where the derivatives of the Lagrangian are evaluated at position and velocity .
Variational Gradient of Action equals Euler-Lagrange Operator for Harmonic Oscillators
For a classical harmonic oscillator and a smooth () trajectory , the variational gradient of the action functional is equal to the Euler-Lagrange operator applied to the Lagrangian of the harmonic oscillator. That is, where is the Lagrangian , and denotes the time derivative of the trajectory.
Equation of motion for a harmonic oscillator
For a trajectory of a classical harmonic oscillator, the property `EquationOfMotion` is satisfied if the variational gradient of the action (the Euler-Lagrange operator) is zero for all . This corresponds to the Euler-Lagrange equation: where is the Lagrangian of the harmonic oscillator, and the derivatives are evaluated along the trajectory .
Equation of Motion for a Harmonic Oscillator
For a classical harmonic oscillator and a trajectory , the property that satisfies the equation of motion is equivalent to the condition that the variational gradient of the action is identically zero for all . Here, the variational gradient (the Euler-Lagrange operator) is defined as: where is the Lagrangian of the harmonic oscillator.
Force of a harmonic oscillator
For a classical harmonic oscillator , the force at a position is defined as the negative gradient of the potential energy , denoted as .
Force of a Harmonic Oscillator equals
For a classical harmonic oscillator with spring constant , the force at a position in the 1-dimensional Euclidean space is given by .
for the Harmonic Oscillator
For a classical harmonic oscillator with mass , and a smooth () trajectory , the variational gradient of the action (also known as the Euler-Lagrange operator) at any time is equal to the force minus the product of the mass and the second time derivative of the trajectory : where is the restoring force of the oscillator and denotes the acceleration .
Equation of Motion Newton's Second Law for the Harmonic Oscillator
For a classical harmonic oscillator with mass , let be a smooth () trajectory. The trajectory satisfies the equation of motion (defined by the vanishing of the variational gradient of the action, or the Euler-Lagrange equation) if and only if it satisfies Newton's second law for all times : where is the second time derivative of the position and is the force acting on the oscillator at position .
Equation of Motion Implies for the Harmonic Oscillator
For a classical harmonic oscillator , let be a smooth () trajectory. If satisfies the equation of motion for the system, then the time derivative of the total energy is zero for all :
Equation of Motion Implies for the Harmonic Oscillator
For a classical harmonic oscillator , let be a smooth () trajectory. If satisfies the equation of motion for the system, then for any time , the total energy is equal to the initial energy at time : where is the sum of the kinetic and potential energies of the oscillator at time .
Linear equivalence between velocity and canonical momentum
Given a classical harmonic oscillator with mass , at a specific time and position , this definition establishes a linear isomorphism between the velocity space and the canonical momentum space (both modeled as ). The mapping is defined by the gradient of the Lagrangian with respect to velocity, , which for this system is . The inverse mapping is .
Canonical Momentum for the Harmonic Oscillator
For a classical harmonic oscillator with mass and spring constant , the canonical momentum at time and position corresponding to a velocity is given by the product of the mass and the velocity: where .
Hamiltonian of the harmonic oscillator
For a classical harmonic oscillator with mass and spring constant , the Hamiltonian is a real-valued function of time , momentum , and position . It is defined via the Legendre transformation of the Lagrangian as: where denotes the standard inner product on the 1-dimensional Euclidean space, and the velocity is expressed as a function of momentum using the inverse of the canonical momentum mapping .
For a classical harmonic oscillator with mass and spring constant , the Hamiltonian as a function of time , momentum , and position is given by: where and denotes the standard real inner product.
The Hamiltonian of the Harmonic Oscillator is
For a classical harmonic oscillator , the Hamiltonian function , considered as a function of time , momentum , and position , is -times continuously differentiable over for any .
for the Harmonic Oscillator
For a classical harmonic oscillator with spring constant , the gradient of the Hamiltonian with respect to the position is equal to , where is the time and is the momentum. Here, and are vectors in the 1-dimensional real Euclidean space .
for the Harmonic Oscillator
For a classical harmonic oscillator with mass , the gradient of the Hamiltonian with respect to the momentum at a given time and position is equal to the momentum divided by the mass: where is the canonical momentum.
Hamiltonian Equals Total Energy for the Harmonic Oscillator
For a classical harmonic oscillator with mass and spring constant , and for any trajectory in a 1-dimensional Euclidean space , the Hamiltonian evaluated at time , position , and the canonical momentum is equal to the total energy of the system at that time. That is, where is the canonical momentum corresponding to the velocity and is the sum of the kinetic and potential energies.
Hamilton equation operator for the harmonic oscillator
For a classical harmonic oscillator with Hamiltonian , the Hamilton equation operator maps a momentum trajectory and a position trajectory to a function of time defined by the pair: In this expression, and denote the time derivatives of the position and momentum trajectories, while and denote the gradients of the oscillator's Hamiltonian with respect to momentum and position, respectively. The vanishing of this operator for a given pair signifies that the trajectories satisfy the classical Hamilton's equations.
Equation of Motion Hamilton's Equations for the Harmonic Oscillator
For a classical harmonic oscillator , let be a smooth () trajectory. Let be the canonical momentum trajectory corresponding to the velocity at position , defined by . The trajectory satisfies the equation of motion (the Euler-Lagrange equation) if and only if the pair satisfies Hamilton's canonical equations, which is equivalent to the vanishing of the Hamilton equation operator:
Equivalence of Formulations of the Equations of Motion for the Harmonic Oscillator
For a classical harmonic oscillator with mass , let be a smooth () trajectory. The following statements are equivalent: 1. The trajectory satisfies the equation of motion (the Euler-Lagrange equation). 2. The trajectory satisfies Newton's second law for all : , where is the second time derivative of the position and is the force of the oscillator. 3. The phase-space trajectory satisfies Hamilton's equations (i.e., the Hamilton equation operator vanishes), where is the canonical momentum. 4. The variational gradient of the action functional is zero at , where is the Lagrangian of the harmonic oscillator. 5. The variational gradient of the phase-space action functional is zero at the trajectory , where is the Hamiltonian and is the standard inner product.
