Imports
/-
Copyright (c) 2026 Nicola Bernini. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Nicola Bernini, Florian Wiesner
-/
module
public import Physlib.ClassicalMechanics.HarmonicOscillator.BasicThe damped harmonic oscillator
i. Overview
The damped harmonic oscillator is a classical mechanical system consisting of a mass m
under a restoring force - k x and a damping force - γ ẋ, where k is the spring
constant, γ is the damping coefficient, x is the position, and ẋ is the velocity.
The equation of motion for the damped harmonic oscillator is:
m ẍ + γ ẋ + k x = 0
Depending on the relationship between the damping coefficient and the natural frequency, the system exhibits three different behaviors:
Underdamped (γ^2 < 4 * m * k) : oscillatory motion with exponentially decaying
amplitude.
Critically damped (γ^2 = 4 * m * k) : fastest return to equilibrium without
oscillation.
Overdamped (4 * m * k < γ^2) : slow return to equilibrium without oscillation.
In this file, the position and velocity both have type EuclideanSpace ℝ (Fin 1). This
coordinate model is useful for a first formalization, but it works only because the
one-dimensional configuration space and its tangent space are both isomorphic to
one-dimensional Euclidean space. A more geometric formalization should represent the
configuration space and its tangent bundle directly.
ii. Key results
The key results in the study of the classical damped harmonic oscillator are the following:
In the Basic module:
DampedHarmonicOscillator contains the input data to the problem.
EquationOfMotion defines the damped oscillator equation m ẍ + γ ẋ + k x = 0.
energy_dissipation_rate computes the rate at which damping removes mechanical energy.
IsUnderdamped, IsCriticallyDamped, and IsOverdamped define the three damping
regimes from the discriminant γ^2 - 4 * m * k.
angularFrequency selects the real frequency parameter from the damping regime.
toUndamped_equationOfMotion relates the damped and undamped equations of motion when
the damping coefficient is zero.
lagrangian defines the Caldirola–Kanai lagrangian exp (γ/m * t) * (T - V).
gradLagrangian defines the variational gradient of the corresponding action, and
equationOfMotion_iff_gradLagrangian_zero shows that its vanishing is equivalent to
the equation of motion.
In the Solution module:
InitialConditions contains the initial position and velocity.
trajectory gives the explicit solution selected from the damping regime.
iii. Table of contents
A. The input data
B. The equation of motion and energy dissipation
B.1. The equation of motion
B.2. Energy dissipation
C. Newton's second law
C.1. The force
C.2. Equation of motion if and only if Newton's second law
D. Damping regimes
E. To undamped oscillator
F. The Caldirola–Kanai lagrangian and the equation of motion
F.1. The lagrangian
F.1.1. Equalities for the lagrangian
F.1.2. Smoothness of the lagrangian
F.1.3. Gradients of the lagrangian
F.2. The variational gradient of the action
F.2.1. The variational gradient and Newton's second law
F.3. Equation of motion iff the variational gradient vanishes
iv. References
References for the damped harmonic oscillator include:
Landau & Lifshitz, Mechanics, page 76, section 25.
Goldstein, Classical Mechanics, Chapter 2.
References for the Caldirola–Kanai lagrangian include:
Caldirola, Nuovo Cimento 18 (1941) 393.
Kanai, Progress of Theoretical Physics 3 (1948) 440.
@[expose] public sectionTODO "Create a new file for the geometric model which properly models the
position as a configuration space and velocity as its tangent space, see the
HarmonicOscillator file."TODO "Define and prove properties of the quality factor Q."TODO "Define and prove properties of the relaxation time τ."A. The input data
We start by defining a structure containing the input data of the damped harmonic oscillator.
The mass m and spring constant k are inherited from HarmonicOscillator; this file adds
the damping coefficient γ.
The classical damped harmonic oscillator is specified by a mass m, a spring
constant k, and a damping coefficient γ.
The mass and spring constant are inherited from HarmonicOscillator and are positive.
The damping coefficient is assumed to be nonnegative.
The damping coefficient of the oscillator.
The damping coefficient is nonnegative.
The mass/spring nonzero lemmas, the natural angular frequency, and the undamped energy API
are inherited from HarmonicOscillator.
B. The equation of motion and energy dissipation
B.1. The equation of motion
Solving the equation of motion for the acceleration: along a solution the second derivative
is -(k/m) x - (γ/m) ẋ.
S:DampedHarmonicOscillatorz:Time → EuclideanSpace ℝ (Fin 1)hEOM:S.EquationOfMotion zt:Timehm:S.m ≠ 0hsum:S.m • ∂ₜ (∂ₜ z) t + (S.γ • ∂ₜ z t + S.k • z t) = 0hma:S.m • ∂ₜ (∂ₜ z) t = -(S.k • z t) - S.γ • ∂ₜ z thkey:∂ₜ (∂ₜ z) t = S.m⁻¹ • S.m • ∂ₜ (∂ₜ z) t⊢ S.m⁻¹ • (-(S.k • z t) - S.γ • ∂ₜ z t) = -(S.m⁻¹ * S.k) • z t + -(S.m⁻¹ * S.γ) • ∂ₜ z t
module All goals completed! 🐙B.2. Energy dissipation
The damped oscillator inherits the mechanical energy from the undamped harmonic oscillator.
Along a solution of the damped equation of motion, that energy decreases at a rate
proportional to -γ ‖ẋ‖^2.
Along a smooth solution of the damped equation of motion, the derivative of the
mechanical energy is -γ ‖ẋ‖^2.
lemma energy_dissipation_rate (xₜ : Time → EuclideanSpace ℝ (Fin 1)) (t : Time)
(h1 : S.EquationOfMotion xₜ)
(hx : ContDiff ℝ ∞ xₜ) :
∂ₜ (S.energy xₜ) t = - S.γ * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ := by S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)t:Timeh1:S.EquationOfMotion xₜhx:ContDiff ℝ ∞ xₜ⊢ ∂ₜ (S.energy xₜ) t = -S.γ * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ
rw [S.energy_deriv xₜ hx S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)t:Timeh1:S.EquationOfMotion xₜhx:ContDiff ℝ ∞ xₜ⊢ (fun t => ⟪∂ₜ xₜ t, S.m • ∂ₜ (∂ₜ xₜ) t + S.k • xₜ t⟫_ℝ) t = -S.γ * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)t:Timeh1:S.EquationOfMotion xₜhx:ContDiff ℝ ∞ xₜ⊢ (fun t => ⟪∂ₜ xₜ t, S.m • ∂ₜ (∂ₜ xₜ) t + S.k • xₜ t⟫_ℝ) t = -S.γ * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ] S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)t:Timeh1:S.EquationOfMotion xₜhx:ContDiff ℝ ∞ xₜ⊢ (fun t => ⟪∂ₜ xₜ t, S.m • ∂ₜ (∂ₜ xₜ) t + S.k • xₜ t⟫_ℝ) t = -S.γ * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ
have hforce : S.m • ∂ₜ (∂ₜ xₜ) t + S.k • xₜ t = - S.γ • ∂ₜ xₜ t := by S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)t:Timeh1:S.EquationOfMotion xₜhx:ContDiff ℝ ∞ xₜ⊢ ∂ₜ (S.energy xₜ) t = -S.γ * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)t:Timeh1:S.EquationOfMotion xₜhx:ContDiff ℝ ∞ xₜhforce:S.m • ∂ₜ (∂ₜ xₜ) t + S.k • xₜ t = -S.γ • ∂ₜ xₜ t⊢ (fun t => ⟪∂ₜ xₜ t, S.m • ∂ₜ (∂ₜ xₜ) t + S.k • xₜ t⟫_ℝ) t = -S.γ * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ
linear_combination (norm := module All goals completed! 🐙 S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)t:Timeh1:S.EquationOfMotion xₜhx:ContDiff ℝ ∞ xₜhforce:S.m • ∂ₜ (∂ₜ xₜ) t + S.k • xₜ t = -S.γ • ∂ₜ xₜ t⊢ (fun t => ⟪∂ₜ xₜ t, S.m • ∂ₜ (∂ₜ xₜ) t + S.k • xₜ t⟫_ℝ) t = -S.γ * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ) h1 t S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)t:Timeh1:S.EquationOfMotion xₜhx:ContDiff ℝ ∞ xₜhforce:S.m • ∂ₜ (∂ₜ xₜ) t + S.k • xₜ t = -S.γ • ∂ₜ xₜ t⊢ (fun t => ⟪∂ₜ xₜ t, S.m • ∂ₜ (∂ₜ xₜ) t + S.k • xₜ t⟫_ℝ) t = -S.γ * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ
simp [hforce, inner_smul_right] All goals completed! 🐙
If 0 < γ and the velocity is nonzero at a time, the mechanical energy is strictly
decreasing at that time.
lemma energy_not_conserved (xₜ : Time → EuclideanSpace ℝ (Fin 1)) (t : Time)
(h1 : S.EquationOfMotion xₜ) (hx : ContDiff ℝ ∞ xₜ) (hdx : ∂ₜ xₜ t ≠ 0) (hγ : 0 < S.γ) :
∂ₜ (S.energy xₜ) t < 0 := by S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)t:Timeh1:S.EquationOfMotion xₜhx:ContDiff ℝ ∞ xₜhdx:∂ₜ xₜ t ≠ 0hγ:0 < S.γ⊢ ∂ₜ (S.energy xₜ) t < 0
rw [energy_dissipation_rate S xₜ t h1 hx, S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)t:Timeh1:S.EquationOfMotion xₜhx:ContDiff ℝ ∞ xₜhdx:∂ₜ xₜ t ≠ 0hγ:0 < S.γ⊢ -S.γ * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ < 0 S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)t:Timeh1:S.EquationOfMotion xₜhx:ContDiff ℝ ∞ xₜhdx:∂ₜ xₜ t ≠ 0hγ:0 < S.γ⊢ -(S.γ * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ) < 0 neg_mul S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)t:Timeh1:S.EquationOfMotion xₜhx:ContDiff ℝ ∞ xₜhdx:∂ₜ xₜ t ≠ 0hγ:0 < S.γ⊢ -(S.γ * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ) < 0 S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)t:Timeh1:S.EquationOfMotion xₜhx:ContDiff ℝ ∞ xₜhdx:∂ₜ xₜ t ≠ 0hγ:0 < S.γ⊢ -(S.γ * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ) < 0] S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)t:Timeh1:S.EquationOfMotion xₜhx:ContDiff ℝ ∞ xₜhdx:∂ₜ xₜ t ≠ 0hγ:0 < S.γ⊢ -(S.γ * ⟪∂ₜ xₜ t, ∂ₜ xₜ t⟫_ℝ) < 0
exact neg_neg_of_pos (mul_pos hγ (real_inner_self_pos.mpr hdx)) All goals completed! 🐙C. Newton's second law
We define the force of the damped oscillator, and show that the equation of motion is equivalent to Newton's second law.
C.1. The force
We define the force of the damped oscillator as - k x - γ v.
C.2. 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.
lemma equationOfMotion_iff_newtons_2nd_law (xₜ : Time → EuclideanSpace ℝ (Fin 1)) :
S.EquationOfMotion xₜ ↔
(∀ t : Time, S.m • ∂ₜ (∂ₜ xₜ) t = force S xₜ t) := by S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)⊢ S.EquationOfMotion xₜ ↔ ∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t
simp only [EquationOfMotion, force] S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t + S.k • xₜ t = 0) ↔
∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = -S.k • xₜ t - S.γ • ∂ₜ xₜ t
constructor mp S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t + S.k • xₜ t = 0) →
∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = -S.k • xₜ t - S.γ • ∂ₜ xₜ tmpr S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = -S.k • xₜ t - S.γ • ∂ₜ xₜ t) →
∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t + S.k • xₜ t = 0
· mp S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t + S.k • xₜ t = 0) →
∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = -S.k • xₜ t - S.γ • ∂ₜ xₜ t intro h t mp S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)h:∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t + S.k • xₜ t = 0t:Time⊢ S.m • ∂ₜ (∂ₜ xₜ) t = -S.k • xₜ t - S.γ • ∂ₜ xₜ t
linear_combination (norm := module All goals completed! 🐙) h t
· mpr S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = -S.k • xₜ t - S.γ • ∂ₜ xₜ t) →
∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t + S.k • xₜ t = 0 intro h t mpr S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)h:∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = -S.k • xₜ t - S.γ • ∂ₜ xₜ tt:Time⊢ S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t + S.k • xₜ t = 0
linear_combination (norm := module All goals completed! 🐙) h tD. Damping regimes
The sign of the discriminant γ^2 - 4 * m * k separates the underdamped, critically
damped, and overdamped regimes. We also define the decay rate and the regime-selected
real frequency that appears in the explicit solution formulas.
The system is underdamped when γ² < 4mk.
def IsUnderdamped : Prop := S.discriminant < 0The system is critically damped when γ² = 4mk.
def IsCriticallyDamped : Prop := S.discriminant = 0The system is overdamped when 4mk < γ².
def IsOverdamped : Prop := 0 < S.discriminantEvery damped oscillator is underdamped, critically damped, or overdamped.
lemma isUnderdamped_or_isCriticallyDamped_or_isOverdamped :
S.IsUnderdamped ∨ S.IsCriticallyDamped ∨ S.IsOverdamped :=
lt_trichotomy S.discriminant 0The system is undamped when γ = 0.
def IsUndamped : Prop := S.γ = 0The relationship between the discriminant, decay rate, and natural angular frequency.
lemma discriminant_eq_four_mul_m_sq_mul_decayRate_sq_sub_ω_sq :
S.discriminant = 4 * S.m^2 * (S.decayRate^2 - S.ω^2) := by S:DampedHarmonicOscillator⊢ S.discriminant = 4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2)
rw [discriminant, S:DampedHarmonicOscillator⊢ S.γ ^ 2 - 4 * S.m * S.k = 4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2) S:DampedHarmonicOscillator⊢ S.γ ^ 2 - 4 * S.m * S.k = 4 * S.m ^ 2 * ((S.γ / (2 * S.m)) ^ 2 - S.k / S.m) decayRate, S:DampedHarmonicOscillator⊢ S.γ ^ 2 - 4 * S.m * S.k = 4 * S.m ^ 2 * ((S.γ / (2 * S.m)) ^ 2 - S.ω ^ 2) S:DampedHarmonicOscillator⊢ S.γ ^ 2 - 4 * S.m * S.k = 4 * S.m ^ 2 * ((S.γ / (2 * S.m)) ^ 2 - S.k / S.m) S.ω_sq S:DampedHarmonicOscillator⊢ S.γ ^ 2 - 4 * S.m * S.k = 4 * S.m ^ 2 * ((S.γ / (2 * S.m)) ^ 2 - S.k / S.m) S:DampedHarmonicOscillator⊢ S.γ ^ 2 - 4 * S.m * S.k = 4 * S.m ^ 2 * ((S.γ / (2 * S.m)) ^ 2 - S.k / S.m)] S:DampedHarmonicOscillator⊢ S.γ ^ 2 - 4 * S.m * S.k = 4 * S.m ^ 2 * ((S.γ / (2 * S.m)) ^ 2 - S.k / S.m)
field_simp [S.m_ne_zero] S:DampedHarmonicOscillator⊢ (S.γ ^ 2 - 4 * S.m * S.k) * 2 ^ 2 = 4 * (S.γ ^ 2 - S.m * S.k * 2 ^ 2)
ring All goals completed! 🐙The decay rate is nonnegative.
lemma decayRate_nonneg : 0 ≤ S.decayRate := by S:DampedHarmonicOscillator⊢ 0 ≤ S.decayRate
exact div_nonneg S.γ_nonneg (by S:DampedHarmonicOscillator⊢ 0 ≤ 2 * S.m nlinarith [S.m_pos] All goals completed! 🐙)An undamped oscillator lies in the underdamped regime.
lemma isUnderdamped_of_gamma_eq_zero (hγ : S.γ = 0) : S.IsUnderdamped := by S:DampedHarmonicOscillatorhγ:S.γ = 0⊢ S.IsUnderdamped
rw [IsUnderdamped, S:DampedHarmonicOscillatorhγ:S.γ = 0⊢ S.discriminant < 0 S:DampedHarmonicOscillatorhγ:S.γ = 0⊢ 0 ^ 2 - 4 * S.m * S.k < 0 discriminant, S:DampedHarmonicOscillatorhγ:S.γ = 0⊢ S.γ ^ 2 - 4 * S.m * S.k < 0 S:DampedHarmonicOscillatorhγ:S.γ = 0⊢ 0 ^ 2 - 4 * S.m * S.k < 0 hγ S:DampedHarmonicOscillatorhγ:S.γ = 0⊢ 0 ^ 2 - 4 * S.m * S.k < 0 S:DampedHarmonicOscillatorhγ:S.γ = 0⊢ 0 ^ 2 - 4 * S.m * S.k < 0] S:DampedHarmonicOscillatorhγ:S.γ = 0⊢ 0 ^ 2 - 4 * S.m * S.k < 0
nlinarith [mul_pos S.m_pos S.k_pos] All goals completed! 🐙An underdamped system has decay rate less than the natural frequency.
lemma isUnderdamped_decayRate (hS : S.IsUnderdamped) : S.decayRate < S.ω := by S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ S.decayRate < S.ω
rw [IsUnderdamped, S:DampedHarmonicOscillatorhS:S.discriminant < 0⊢ S.decayRate < S.ω S:DampedHarmonicOscillatorhS:4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2) < 0⊢ S.decayRate < S.ω discriminant_eq_four_mul_m_sq_mul_decayRate_sq_sub_ω_sq S:DampedHarmonicOscillatorhS:4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2) < 0⊢ S.decayRate < S.ω S:DampedHarmonicOscillatorhS:4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2) < 0⊢ S.decayRate < S.ω] at hS S:DampedHarmonicOscillatorhS:4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2) < 0⊢ S.decayRate < S.ω
have hsq : S.decayRate ^ 2 < S.ω ^ 2 := by nlinarith [sq_pos_of_pos S.m_pos] S:DampedHarmonicOscillatorhS:4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2) < 0hsq:S.decayRate ^ 2 < S.ω ^ 2⊢ S.decayRate < S.ω S:DampedHarmonicOscillatorhS:4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2) < 0hsq:S.decayRate ^ 2 < S.ω ^ 2⊢ S.decayRate < S.ω
nlinarith [S.decayRate_nonneg, S.ω_pos] All goals completed! 🐙A critically damped system has decay rate equal to the natural frequency.
lemma isCriticallyDamped_decayRate (hS : S.IsCriticallyDamped) : S.ω = S.decayRate := by S:DampedHarmonicOscillatorhS:S.IsCriticallyDamped⊢ S.ω = S.decayRate
rw [IsCriticallyDamped, S:DampedHarmonicOscillatorhS:S.discriminant = 0⊢ S.ω = S.decayRate S:DampedHarmonicOscillatorhS:4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2) = 0⊢ S.ω = S.decayRate discriminant_eq_four_mul_m_sq_mul_decayRate_sq_sub_ω_sq S:DampedHarmonicOscillatorhS:4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2) = 0⊢ S.ω = S.decayRate S:DampedHarmonicOscillatorhS:4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2) = 0⊢ S.ω = S.decayRate] at hS S:DampedHarmonicOscillatorhS:4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2) = 0⊢ S.ω = S.decayRate
have hsq : S.decayRate ^ 2 = S.ω ^ 2 := by nlinarith [sq_pos_of_pos S.m_pos] S:DampedHarmonicOscillatorhS:4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2) = 0hsq:S.decayRate ^ 2 = S.ω ^ 2⊢ S.ω = S.decayRate S:DampedHarmonicOscillatorhS:4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2) = 0hsq:S.decayRate ^ 2 = S.ω ^ 2⊢ S.ω = S.decayRate
nlinarith [S.decayRate_nonneg, S.ω_pos] All goals completed! 🐙The damping coefficient is twice mass times the decay rate.
lemma gamma_eq_two_mul_m_mul_decayRate : S.γ = 2 * S.m * S.decayRate := by S:DampedHarmonicOscillator⊢ S.γ = 2 * S.m * S.decayRate
rw [decayRate S:DampedHarmonicOscillator⊢ S.γ = 2 * S.m * (S.γ / (2 * S.m)) S:DampedHarmonicOscillator⊢ S.γ = 2 * S.m * (S.γ / (2 * S.m))] S:DampedHarmonicOscillator⊢ S.γ = 2 * S.m * (S.γ / (2 * S.m))
field_simp [S.m_ne_zero] All goals completed! 🐙
The spring constant is m * ω^2.
lemma k_eq_m_mul_ω_sq : S.k = S.m * S.ω^2 := by S:DampedHarmonicOscillator⊢ S.k = S.m * S.ω ^ 2
rw [S.ω_sq S:DampedHarmonicOscillator⊢ S.k = S.m * (S.k / S.m) S:DampedHarmonicOscillator⊢ S.k = S.m * (S.k / S.m)] S:DampedHarmonicOscillator⊢ S.k = S.m * (S.k / S.m)
field_simp [S.m_ne_zero] All goals completed! 🐙
In the critically damped regime, k = m * decayRate^2.
lemma k_eq_m_mul_decayRate_sq_of_criticallyDamped (hS : S.IsCriticallyDamped) :
S.k = S.m * S.decayRate^2 := by S:DampedHarmonicOscillatorhS:S.IsCriticallyDamped⊢ S.k = S.m * S.decayRate ^ 2
rw [S.k_eq_m_mul_ω_sq, S:DampedHarmonicOscillatorhS:S.IsCriticallyDamped⊢ S.m * S.ω ^ 2 = S.m * S.decayRate ^ 2 All goals completed! 🐙 S.isCriticallyDamped_decayRate hS S:DampedHarmonicOscillatorhS:S.IsCriticallyDamped⊢ S.m * S.decayRate ^ 2 = S.m * S.decayRate ^ 2 All goals completed! 🐙] All goals completed! 🐙An overdamped system has decay rate greater than the natural frequency.
lemma isOverdamped_decayRate (hS : S.IsOverdamped) : S.ω < S.decayRate := by S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ S.ω < S.decayRate
rw [IsOverdamped, S:DampedHarmonicOscillatorhS:0 < S.discriminant⊢ S.ω < S.decayRate S:DampedHarmonicOscillatorhS:0 < 4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2)⊢ S.ω < S.decayRate discriminant_eq_four_mul_m_sq_mul_decayRate_sq_sub_ω_sq S:DampedHarmonicOscillatorhS:0 < 4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2)⊢ S.ω < S.decayRate S:DampedHarmonicOscillatorhS:0 < 4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2)⊢ S.ω < S.decayRate] at hS S:DampedHarmonicOscillatorhS:0 < 4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2)⊢ S.ω < S.decayRate
have hsq : S.ω ^ 2 < S.decayRate ^ 2 := by nlinarith [sq_pos_of_pos S.m_pos] S:DampedHarmonicOscillatorhS:0 < 4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2)hsq:S.ω ^ 2 < S.decayRate ^ 2⊢ S.ω < S.decayRate S:DampedHarmonicOscillatorhS:0 < 4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2)hsq:S.ω ^ 2 < S.decayRate ^ 2⊢ S.ω < S.decayRate
nlinarith [S.decayRate_nonneg, S.ω_pos] All goals completed! 🐙In the underdamped regime, the selected frequency uses the oscillation frequency.
lemma angularFrequency_eq_underdamped (hS : S.IsUnderdamped) :
S.angularFrequency = sqrt (- S.discriminant) / (2 * S.m) := by S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ S.angularFrequency = √(-S.discriminant) / (2 * S.m)
simp [angularFrequency, hS] All goals completed! 🐙In the critically damped regime, the selected frequency is zero.
lemma angularFrequency_eq_criticallyDamped (hS : S.IsCriticallyDamped) :
S.angularFrequency = 0 := by S:DampedHarmonicOscillatorhS:S.IsCriticallyDamped⊢ S.angularFrequency = 0
rw [IsCriticallyDamped S:DampedHarmonicOscillatorhS:S.discriminant = 0⊢ S.angularFrequency = 0 S:DampedHarmonicOscillatorhS:S.discriminant = 0⊢ S.angularFrequency = 0] at hS S:DampedHarmonicOscillatorhS:S.discriminant = 0⊢ S.angularFrequency = 0
simp [angularFrequency, IsUnderdamped, IsCriticallyDamped, hS] All goals completed! 🐙In the overdamped regime, the selected frequency uses the real split rate.
lemma angularFrequency_eq_overdamped (hS : S.IsOverdamped) :
S.angularFrequency = sqrt S.discriminant / (2 * S.m) := by S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ S.angularFrequency = √S.discriminant / (2 * S.m)
rw [IsOverdamped S:DampedHarmonicOscillatorhS:0 < S.discriminant⊢ S.angularFrequency = √S.discriminant / (2 * S.m) S:DampedHarmonicOscillatorhS:0 < S.discriminant⊢ S.angularFrequency = √S.discriminant / (2 * S.m)] at hS S:DampedHarmonicOscillatorhS:0 < S.discriminant⊢ S.angularFrequency = √S.discriminant / (2 * S.m)
simp [angularFrequency, IsUnderdamped, IsCriticallyDamped, not_lt.mpr hS.le, hS.ne'] All goals completed! 🐙
In the underdamped regime, the selected angular frequency squares to
ω^2 - decayRate^2.
lemma angularFrequency_sq_of_underdamped (hS : S.IsUnderdamped) :
S.angularFrequency^2 = S.ω^2 - S.decayRate^2 := by S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ S.angularFrequency ^ 2 = S.ω ^ 2 - S.decayRate ^ 2
rw [S.angularFrequency_eq_underdamped hS, S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ (√(-S.discriminant) / (2 * S.m)) ^ 2 = S.ω ^ 2 - S.decayRate ^ 2 S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ -S.discriminant / (2 * S.m) ^ 2 = S.ω ^ 2 - S.decayRate ^ 2S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ 0 ≤ -S.discriminant div_pow, S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ √(-S.discriminant) ^ 2 / (2 * S.m) ^ 2 = S.ω ^ 2 - S.decayRate ^ 2 S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ -S.discriminant / (2 * S.m) ^ 2 = S.ω ^ 2 - S.decayRate ^ 2S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ 0 ≤ -S.discriminant sq_sqrt S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ -S.discriminant / (2 * S.m) ^ 2 = S.ω ^ 2 - S.decayRate ^ 2S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ 0 ≤ -S.discriminant S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ -S.discriminant / (2 * S.m) ^ 2 = S.ω ^ 2 - S.decayRate ^ 2S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ 0 ≤ -S.discriminant] S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ -S.discriminant / (2 * S.m) ^ 2 = S.ω ^ 2 - S.decayRate ^ 2S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ 0 ≤ -S.discriminant
· S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ -S.discriminant / (2 * S.m) ^ 2 = S.ω ^ 2 - S.decayRate ^ 2 rw [discriminant_eq_four_mul_m_sq_mul_decayRate_sq_sub_ω_sq S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ -(4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2)) / (2 * S.m) ^ 2 = S.ω ^ 2 - S.decayRate ^ 2 S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ -(4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2)) / (2 * S.m) ^ 2 = S.ω ^ 2 - S.decayRate ^ 2] S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ -(4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2)) / (2 * S.m) ^ 2 = S.ω ^ 2 - S.decayRate ^ 2
field_simp [S.m_ne_zero] S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ -(4 * (S.decayRate ^ 2 - S.ω ^ 2)) = 2 ^ 2 * (S.ω ^ 2 - S.decayRate ^ 2)
ring All goals completed! 🐙
· S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ 0 ≤ -S.discriminant exact (neg_pos.mpr hS).le All goals completed! 🐙The selected angular frequency is positive in the underdamped regime.
lemma angularFrequency_pos_of_underdamped (hS : S.IsUnderdamped) :
0 < S.angularFrequency := by S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ 0 < S.angularFrequency
rw [S.angularFrequency_eq_underdamped hS S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ 0 < √(-S.discriminant) / (2 * S.m) S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ 0 < √(-S.discriminant) / (2 * S.m)] S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ 0 < √(-S.discriminant) / (2 * S.m)
exact div_pos (sqrt_pos.mpr (neg_pos.mpr hS)) (by S:DampedHarmonicOscillatorhS:S.IsUnderdamped⊢ 0 < 2 * S.m linarith [S.m_pos] All goals completed! 🐙)The selected angular frequency is nonzero in the underdamped regime.
lemma angularFrequency_ne_zero_of_underdamped (hS : S.IsUnderdamped) :
S.angularFrequency ≠ 0 :=
(S.angularFrequency_pos_of_underdamped hS).ne'
In the overdamped regime, the selected angular frequency squares to
decayRate^2 - ω^2.
lemma angularFrequency_sq_of_overdamped (hS : S.IsOverdamped) :
S.angularFrequency^2 = S.decayRate^2 - S.ω^2 := by S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ S.angularFrequency ^ 2 = S.decayRate ^ 2 - S.ω ^ 2
rw [S.angularFrequency_eq_overdamped hS, S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ (√S.discriminant / (2 * S.m)) ^ 2 = S.decayRate ^ 2 - S.ω ^ 2 S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ S.discriminant / (2 * S.m) ^ 2 = S.decayRate ^ 2 - S.ω ^ 2S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ 0 ≤ S.discriminant div_pow, S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ √S.discriminant ^ 2 / (2 * S.m) ^ 2 = S.decayRate ^ 2 - S.ω ^ 2 S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ S.discriminant / (2 * S.m) ^ 2 = S.decayRate ^ 2 - S.ω ^ 2S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ 0 ≤ S.discriminant sq_sqrt S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ S.discriminant / (2 * S.m) ^ 2 = S.decayRate ^ 2 - S.ω ^ 2S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ 0 ≤ S.discriminant S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ S.discriminant / (2 * S.m) ^ 2 = S.decayRate ^ 2 - S.ω ^ 2S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ 0 ≤ S.discriminant] S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ S.discriminant / (2 * S.m) ^ 2 = S.decayRate ^ 2 - S.ω ^ 2S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ 0 ≤ S.discriminant
· S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ S.discriminant / (2 * S.m) ^ 2 = S.decayRate ^ 2 - S.ω ^ 2 rw [discriminant_eq_four_mul_m_sq_mul_decayRate_sq_sub_ω_sq S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ 4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2) / (2 * S.m) ^ 2 = S.decayRate ^ 2 - S.ω ^ 2 S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ 4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2) / (2 * S.m) ^ 2 = S.decayRate ^ 2 - S.ω ^ 2] S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ 4 * S.m ^ 2 * (S.decayRate ^ 2 - S.ω ^ 2) / (2 * S.m) ^ 2 = S.decayRate ^ 2 - S.ω ^ 2
field_simp [S.m_ne_zero] S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ 4 * (S.decayRate ^ 2 - S.ω ^ 2) = (S.decayRate ^ 2 - S.ω ^ 2) * 2 ^ 2
ring All goals completed! 🐙
· S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ 0 ≤ S.discriminant exact le_of_lt hS All goals completed! 🐙The selected angular frequency is positive in the overdamped regime.
lemma angularFrequency_pos_of_overdamped (hS : S.IsOverdamped) :
0 < S.angularFrequency := by S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ 0 < S.angularFrequency
rw [S.angularFrequency_eq_overdamped hS S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ 0 < √S.discriminant / (2 * S.m) S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ 0 < √S.discriminant / (2 * S.m)] S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ 0 < √S.discriminant / (2 * S.m)
exact div_pos (sqrt_pos.mpr hS) (by S:DampedHarmonicOscillatorhS:S.IsOverdamped⊢ 0 < 2 * S.m linarith [S.m_pos] All goals completed! 🐙)The selected angular frequency is nonzero in the overdamped regime.
lemma angularFrequency_ne_zero_of_overdamped (hS : S.IsOverdamped) :
S.angularFrequency ≠ 0 :=
(S.angularFrequency_pos_of_overdamped hS).ne'E. To undamped oscillator
We show that the damped harmonic oscillator reduces to the undamped harmonic oscillator when the
damping coefficient is zero. The underlying mass and spring data are already inherited from
HarmonicOscillator; the proof argument records that this conversion is being used only in
the zero-damping case.
We also show that the equations of motion are equivalent in this case.
Convert a damped oscillator to its underlying undamped oscillator when γ = 0.
set_option linter.unusedVariables false in@[nolint unusedArguments]
def toUndamped (S : DampedHarmonicOscillator) (_hS : S.IsUndamped) :
HarmonicOscillator :=
S.toHarmonicOscillator
When γ = 0, the damped equation of motion is equivalent to the equation of motion
for the corresponding undamped harmonic oscillator.
lemma toUndamped_equationOfMotion (S : DampedHarmonicOscillator) (hS : S.IsUndamped)
(xₜ : Time → EuclideanSpace ℝ (Fin 1)) (hx : ContDiff ℝ ∞ xₜ) :
S.EquationOfMotion xₜ ↔ (S.toUndamped hS).EquationOfMotion xₜ := by S:DampedHarmonicOscillatorhS:S.IsUndampedxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜ⊢ S.EquationOfMotion xₜ ↔ (S.toUndamped hS).EquationOfMotion xₜ
have hγ : S.γ = 0 := by simpa [IsUndamped] using hS S:DampedHarmonicOscillatorhS:S.IsUndampedxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhγ:S.γ = 0⊢ S.EquationOfMotion xₜ ↔ (S.toUndamped hS).EquationOfMotion xₜ S:DampedHarmonicOscillatorhS:S.IsUndampedxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhγ:S.γ = 0⊢ S.EquationOfMotion xₜ ↔ (S.toUndamped hS).EquationOfMotion xₜ
rw [S.equationOfMotion_iff_newtons_2nd_law xₜ, S:DampedHarmonicOscillatorhS:S.IsUndampedxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhγ:S.γ = 0⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t) ↔ (S.toUndamped hS).EquationOfMotion xₜ S:DampedHarmonicOscillatorhS:S.IsUndampedxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhγ:S.γ = 0⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t) ↔
∀ (t : Time), (S.toUndamped hS).m • ∂ₜ (∂ₜ xₜ) t = (S.toUndamped hS).force (xₜ t)
(S.toUndamped hS).equationOfMotion_iff_newtons_2nd_law xₜ hx S:DampedHarmonicOscillatorhS:S.IsUndampedxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhγ:S.γ = 0⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t) ↔
∀ (t : Time), (S.toUndamped hS).m • ∂ₜ (∂ₜ xₜ) t = (S.toUndamped hS).force (xₜ t) S:DampedHarmonicOscillatorhS:S.IsUndampedxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhγ:S.γ = 0⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t) ↔
∀ (t : Time), (S.toUndamped hS).m • ∂ₜ (∂ₜ xₜ) t = (S.toUndamped hS).force (xₜ t)] S:DampedHarmonicOscillatorhS:S.IsUndampedxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhγ:S.γ = 0⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t) ↔
∀ (t : Time), (S.toUndamped hS).m • ∂ₜ (∂ₜ xₜ) t = (S.toUndamped hS).force (xₜ t)
refine forall_congr' fun t => ?_ S:DampedHarmonicOscillatorhS:S.IsUndampedxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhγ:S.γ = 0t:Time⊢ S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t ↔ (S.toUndamped hS).m • ∂ₜ (∂ₜ xₜ) t = (S.toUndamped hS).force (xₜ t)
rw [show (S.toUndamped hS).m = S.m from rfl, S:DampedHarmonicOscillatorhS:S.IsUndampedxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhγ:S.γ = 0t:Time⊢ S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t ↔ S.m • ∂ₜ (∂ₜ xₜ) t = (S.toUndamped hS).force (xₜ t) All goals completed! 🐙
show HarmonicOscillator.force (S.toUndamped hS) (xₜ t) = force S xₜ t from by S:DampedHarmonicOscillatorhS:S.IsUndampedxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhγ:S.γ = 0t:Time⊢ (S.toUndamped hS).force (xₜ t) = S.force xₜ t All goals completed! 🐙
simp [force, HarmonicOscillator.force_eq_linear, toUndamped, hγ] All goals completed! 🐙 All goals completed! 🐙] All goals completed! 🐙F. The Caldirola–Kanai lagrangian and the equation of motion
The damped harmonic oscillator is not conservative, so the undamped lagrangian
T - V does not reproduce the damped equation of motion. Instead we use the
Caldirola–Kanai lagrangian, which multiplies the undamped lagrangian by the
time-dependent factor exp (γ/m * t):
$$L(t, x, v) = e^{(\gamma/m) t}\left(\frac{1}{2} m |v|^2 - \frac{1}{2} k |x|^2\right)$$
Setting the variational gradient of the corresponding action equal to zero
recovers exactly the damped equation of motion m ẍ + γ ẋ + k x = 0.
F.1. The lagrangian
We define the Caldirola–Kanai lagrangian as the lagrangian of the underlying
undamped harmonic oscillator multiplied by the exponential factor exp (γ/m * t).
F.1.1. Equalities for the lagrangian
We prove some simple equalities for the lagrangian, in particular that when applied to a trajectory it is the exponential factor times the kinetic energy minus the potential energy, and that it reduces to the undamped lagrangian when the damping coefficient is zero.
lemma lagrangian_eq : S.lagrangian = fun (t : Time) (x v : EuclideanSpace ℝ (Fin 1)) =>
exp (S.γ / S.m * t) * (1 / (2 : ℝ) * S.m * ⟪v, v⟫_ℝ - 1 / (2 : ℝ) * S.k * ⟪x, x⟫_ℝ) := by S:DampedHarmonicOscillator⊢ S.lagrangian = fun t x v => rexp (S.γ / S.m * t.val) * (1 / 2 * S.m * ⟪v, v⟫_ℝ - 1 / 2 * S.k * ⟪x, x⟫_ℝ)
funext t x v S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)⊢ S.lagrangian t x v = rexp (S.γ / S.m * t.val) * (1 / 2 * S.m * ⟪v, v⟫_ℝ - 1 / 2 * S.k * ⟪x, x⟫_ℝ)
rw [lagrangian, S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)⊢ rexp (S.γ / S.m * t.val) * S.lagrangian t x v =
rexp (S.γ / S.m * t.val) * (1 / 2 * S.m * ⟪v, v⟫_ℝ - 1 / 2 * S.k * ⟪x, x⟫_ℝ) All goals completed! 🐙 S.toHarmonicOscillator.lagrangian_eq S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)⊢ rexp (S.γ / S.m * t.val) * (fun t x v => 1 / 2 * S.m * ⟪v, v⟫_ℝ - 1 / 2 * S.k * ⟪x, x⟫_ℝ) t x v =
rexp (S.γ / S.m * t.val) * (1 / 2 * S.m * ⟪v, v⟫_ℝ - 1 / 2 * S.k * ⟪x, x⟫_ℝ) All goals completed! 🐙] All goals completed! 🐙
lemma lagrangian_eq_exp_mul_kineticEnergy_sub_potentialEnergy (t : Time)
(xₜ : Time → EuclideanSpace ℝ (Fin 1)) :
S.lagrangian t (xₜ t) (∂ₜ xₜ t) =
exp (S.γ / S.m * t) * (S.kineticEnergy xₜ t - S.potentialEnergy (xₜ t)) := by S:DampedHarmonicOscillatort:Timexₜ:Time → EuclideanSpace ℝ (Fin 1)⊢ S.lagrangian t (xₜ t) (∂ₜ xₜ t) = rexp (S.γ / S.m * t.val) * (S.kineticEnergy xₜ t - S.potentialEnergy (xₜ t))
rw [lagrangian, S:DampedHarmonicOscillatort:Timexₜ:Time → EuclideanSpace ℝ (Fin 1)⊢ rexp (S.γ / S.m * t.val) * S.lagrangian t (xₜ t) (∂ₜ xₜ t) =
rexp (S.γ / S.m * t.val) * (S.kineticEnergy xₜ t - S.potentialEnergy (xₜ t)) All goals completed! 🐙 S.toHarmonicOscillator.lagrangian_eq_kineticEnergy_sub_potentialEnergy S:DampedHarmonicOscillatort:Timexₜ:Time → EuclideanSpace ℝ (Fin 1)⊢ rexp (S.γ / S.m * t.val) * (S.kineticEnergy xₜ t - S.potentialEnergy (xₜ t)) =
rexp (S.γ / S.m * t.val) * (S.kineticEnergy xₜ t - S.potentialEnergy (xₜ t)) All goals completed! 🐙] All goals completed! 🐙When the damping coefficient is zero, the Caldirola–Kanai lagrangian is the lagrangian of the underlying undamped harmonic oscillator.
lemma lagrangian_of_isUndamped (hS : S.IsUndamped) :
S.lagrangian = S.toHarmonicOscillator.lagrangian := by S:DampedHarmonicOscillatorhS:S.IsUndamped⊢ S.lagrangian = S.lagrangian
have hγ : S.γ = 0 := by simpa [IsUndamped] using hS S:DampedHarmonicOscillatorhS:S.IsUndampedhγ:S.γ = 0⊢ S.lagrangian = S.lagrangian S:DampedHarmonicOscillatorhS:S.IsUndampedhγ:S.γ = 0⊢ S.lagrangian = S.lagrangian
funext t x v S:DampedHarmonicOscillatorhS:S.IsUndampedhγ:S.γ = 0t:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)⊢ S.lagrangian t x v = S.lagrangian t x v
simp [lagrangian, hγ] All goals completed! 🐙F.1.2. Smoothness of the lagrangian
The lagrangian is smooth in all its arguments.
@[fun_prop]
lemma contDiff_lagrangian (n : WithTop ℕ∞) : ContDiff ℝ n ↿S.lagrangian := by S:DampedHarmonicOscillatorn:ℕ∞ω⊢ ContDiff ℝ n ↿S.lagrangian
show ContDiff ℝ n fun p : Time × EuclideanSpace ℝ (Fin 1) × EuclideanSpace ℝ (Fin 1) =>
exp (S.γ / S.m * p.1) * ↿S.toHarmonicOscillator.lagrangian p S:DampedHarmonicOscillatorn:ℕ∞ω⊢ ContDiff ℝ n fun p => rexp (S.γ / S.m * p.1.val) * ↿S.lagrangian p
fun_prop All goals completed! 🐙F.1.3. Gradients of the lagrangian
We now show results related to the gradients of the lagrangian with respect to the
position and velocity. They follow from the corresponding gradients of the undamped
lagrangian, using that the gradient scales with the constant exp (γ/m * t).
private lemma gradient_const_mul {f : EuclideanSpace ℝ (Fin 1) → ℝ} {x : EuclideanSpace ℝ (Fin 1)}
(c : ℝ) (hf : DifferentiableAt ℝ f x) :
gradient (fun y => c * f y) x = c • gradient f x := by f:EuclideanSpace ℝ (Fin 1) → ℝx:EuclideanSpace ℝ (Fin 1)c:ℝhf:DifferentiableAt ℝ f x⊢ gradient (fun y => c * f y) x = c • gradient f x
simp [gradient, fderiv_const_mul hf, map_smul] All goals completed! 🐙
lemma gradient_lagrangian_position_eq (t : Time) (x v : EuclideanSpace ℝ (Fin 1)) :
gradient (fun x => S.lagrangian t x v) x = -(exp (S.γ / S.m * t) * S.k) • x := by S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)⊢ gradient (fun x => S.lagrangian t x v) x = -(rexp (S.γ / S.m * t.val) * S.k) • x
have hf : DifferentiableAt ℝ (fun y => S.toHarmonicOscillator.lagrangian t y v) x := by
simp only [HarmonicOscillator.lagrangian_eq] S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)⊢ DifferentiableAt ℝ (fun y => 1 / 2 * S.m * ⟪v, v⟫_ℝ - 1 / 2 * S.k * ⟪y, y⟫_ℝ) x S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun y => S.lagrangian t y v) x⊢ gradient (fun x => S.lagrangian t x v) x = -(rexp (S.γ / S.m * t.val) * S.k) • x
fun_prop S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun y => S.lagrangian t y v) x⊢ gradient (fun x => S.lagrangian t x v) x = -(rexp (S.γ / S.m * t.val) * S.k) • x S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun y => S.lagrangian t y v) x⊢ gradient (fun x => S.lagrangian t x v) x = -(rexp (S.γ / S.m * t.val) * S.k) • x
rw [show (fun y => S.lagrangian t y v) =
fun y => exp (S.γ / S.m * t) * S.toHarmonicOscillator.lagrangian t y v from rfl, S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun y => S.lagrangian t y v) x⊢ gradient (fun y => rexp (S.γ / S.m * t.val) * S.lagrangian t y v) x = -(rexp (S.γ / S.m * t.val) * S.k) • x S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun y => S.lagrangian t y v) x⊢ rexp (S.γ / S.m * t.val) • -S.k • x = -(rexp (S.γ / S.m * t.val) * S.k) • x
gradient_const_mul _ hf, S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun y => S.lagrangian t y v) x⊢ rexp (S.γ / S.m * t.val) • gradient (fun y => S.lagrangian t y v) x = -(rexp (S.γ / S.m * t.val) * S.k) • x S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun y => S.lagrangian t y v) x⊢ rexp (S.γ / S.m * t.val) • -S.k • x = -(rexp (S.γ / S.m * t.val) * S.k) • x S.toHarmonicOscillator.gradient_lagrangian_position_eq S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun y => S.lagrangian t y v) x⊢ rexp (S.γ / S.m * t.val) • -S.k • x = -(rexp (S.γ / S.m * t.val) * S.k) • x S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun y => S.lagrangian t y v) x⊢ rexp (S.γ / S.m * t.val) • -S.k • x = -(rexp (S.γ / S.m * t.val) * S.k) • x] S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun y => S.lagrangian t y v) x⊢ rexp (S.γ / S.m * t.val) • -S.k • x = -(rexp (S.γ / S.m * t.val) * S.k) • x
module All goals completed! 🐙
lemma gradient_lagrangian_velocity_eq (t : Time) (x v : EuclideanSpace ℝ (Fin 1)) :
gradient (S.lagrangian t x) v = (exp (S.γ / S.m * t) * S.m) • v := by S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)⊢ gradient (S.lagrangian t x) v = (rexp (S.γ / S.m * t.val) * S.m) • v
have hf : DifferentiableAt ℝ (fun w => S.toHarmonicOscillator.lagrangian t x w) v := by
simp only [HarmonicOscillator.lagrangian_eq] S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)⊢ DifferentiableAt ℝ (fun w => 1 / 2 * S.m * ⟪w, w⟫_ℝ - 1 / 2 * S.k * ⟪x, x⟫_ℝ) v S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun w => S.lagrangian t x w) v⊢ gradient (S.lagrangian t x) v = (rexp (S.γ / S.m * t.val) * S.m) • v
fun_prop S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun w => S.lagrangian t x w) v⊢ gradient (S.lagrangian t x) v = (rexp (S.γ / S.m * t.val) * S.m) • v S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun w => S.lagrangian t x w) v⊢ gradient (S.lagrangian t x) v = (rexp (S.γ / S.m * t.val) * S.m) • v
rw [show S.lagrangian t x =
fun w => exp (S.γ / S.m * t) * S.toHarmonicOscillator.lagrangian t x w from rfl, S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun w => S.lagrangian t x w) v⊢ gradient (fun w => rexp (S.γ / S.m * t.val) * S.lagrangian t x w) v = (rexp (S.γ / S.m * t.val) * S.m) • v All goals completed! 🐙
gradient_const_mul _ hf, S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun w => S.lagrangian t x w) v⊢ rexp (S.γ / S.m * t.val) • gradient (fun w => S.lagrangian t x w) v = (rexp (S.γ / S.m * t.val) * S.m) • v All goals completed! 🐙 S.toHarmonicOscillator.gradient_lagrangian_velocity_eq, S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun w => S.lagrangian t x w) v⊢ rexp (S.γ / S.m * t.val) • S.m • v = (rexp (S.γ / S.m * t.val) * S.m) • v All goals completed! 🐙 smul_smul S:DampedHarmonicOscillatort:Timex:EuclideanSpace ℝ (Fin 1)v:EuclideanSpace ℝ (Fin 1)hf:DifferentiableAt ℝ (fun w => S.lagrangian t x w) v⊢ (rexp (S.γ / S.m * t.val) * S.m) • v = (rexp (S.γ / S.m * t.val) * S.m) • v All goals completed! 🐙] All goals completed! 🐙F.2. The variational gradient of the action
We now write down the variational gradient of the action of the damped harmonic oscillator, for a trajectory $x(t)$ this is equal to
$$t\mapsto \left.\frac{\partial L(t, q, \dot x (t))}{\partial q}\right|{q = x(t)} - \frac{d}{dt} \left.\frac{\partial L(t, x(t), v)}{\partial v}\right|{v = \dot x (t)}$$
Setting this equal to zero corresponds to the Euler-Lagrange equations, and thereby the equation of motion.
lemma gradLagrangian_eq_eulerLagrangeOp (xₜ : Time → EuclideanSpace ℝ (Fin 1))
(hq : ContDiff ℝ ∞ xₜ) :
S.gradLagrangian xₜ = eulerLagrangeOp S.lagrangian xₜ := by S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hq:ContDiff ℝ ∞ xₜ⊢ S.gradLagrangian xₜ = eulerLagrangeOp S.lagrangian xₜ
rw [gradLagrangian, S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hq:ContDiff ℝ ∞ xₜ⊢ varGradient (fun q' t => S.lagrangian t (q' t) ((fderiv ℝ q' t) 1)) xₜ = eulerLagrangeOp S.lagrangian xₜ All goals completed! 🐙
ClassicalMechanics.euler_lagrange_varGradient _ _ hq (S.contDiff_lagrangian _) S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hq:ContDiff ℝ ∞ xₜ⊢ eulerLagrangeOp S.lagrangian xₜ = eulerLagrangeOp S.lagrangian xₜ All goals completed! 🐙] All goals completed! 🐙F.2.1. The variational gradient and Newton's second law
We simplify the variational gradient of the action to the exponential factor times the difference between the force and mass times acceleration.
private lemma deriv_exp_smul (a : ℝ) (y : Time → EuclideanSpace ℝ (Fin 1))
(hy : Differentiable ℝ y) (t : Time) :
∂ₜ (fun t' : Time => exp (a * t'.val) • y t') t =
exp (a * t.val) • (∂ₜ y t + a • y t) := by a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ ∂ₜ (fun t' => rexp (a * t'.val) • y t') t = rexp (a * t.val) • (∂ₜ y t + a • y t)
rw [Time.deriv, a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ (fderiv ℝ (fun t' => rexp (a * t'.val) • y t') t) 1 = rexp (a * t.val) • (∂ₜ y t + a • y t) a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ (rexp (a * t.val) • fderiv ℝ y t +
(rexp (a * t.val) • (a • fderiv ℝ Time.val t + t.val • fderiv ℝ (fun t' => a) t)).smulRight (y t))
1 =
rexp (a * t.val) • (∂ₜ y t + a • y t) fderiv_fun_smul (by a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ DifferentiableAt ℝ (fun t' => rexp (a * t'.val)) t a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ (rexp (a * t.val) • fderiv ℝ y t +
(rexp (a * t.val) • (a • fderiv ℝ Time.val t + t.val • fderiv ℝ (fun t' => a) t)).smulRight (y t))
1 =
rexp (a * t.val) • (∂ₜ y t + a • y t) fun_prop All goals completed! 🐙 a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ (rexp (a * t.val) • fderiv ℝ y t +
(rexp (a * t.val) • (a • fderiv ℝ Time.val t + t.val • fderiv ℝ (fun t' => a) t)).smulRight (y t))
1 =
rexp (a * t.val) • (∂ₜ y t + a • y t)) (hy t), fderiv_exp (by a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ DifferentiableAt ℝ (fun t' => a * t'.val) t a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ (rexp (a * t.val) • fderiv ℝ y t +
(rexp (a * t.val) • (a • fderiv ℝ Time.val t + t.val • fderiv ℝ (fun t' => a) t)).smulRight (y t))
1 =
rexp (a * t.val) • (∂ₜ y t + a • y t) fun_prop All goals completed! 🐙 a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ (rexp (a * t.val) • fderiv ℝ y t +
(rexp (a * t.val) • (a • fderiv ℝ Time.val t + t.val • fderiv ℝ (fun t' => a) t)).smulRight (y t))
1 =
rexp (a * t.val) • (∂ₜ y t + a • y t)),
fderiv_fun_mul (by a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ DifferentiableAt ℝ (fun t' => a) t a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ (rexp (a * t.val) • fderiv ℝ y t +
(rexp (a * t.val) • (a • fderiv ℝ Time.val t + t.val • fderiv ℝ (fun t' => a) t)).smulRight (y t))
1 =
rexp (a * t.val) • (∂ₜ y t + a • y t) fun_prop All goals completed! 🐙 a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ (rexp (a * t.val) • fderiv ℝ y t +
(rexp (a * t.val) • (a • fderiv ℝ Time.val t + t.val • fderiv ℝ (fun t' => a) t)).smulRight (y t))
1 =
rexp (a * t.val) • (∂ₜ y t + a • y t)) (by a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ DifferentiableAt ℝ Time.val t a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ (rexp (a * t.val) • fderiv ℝ y t +
(rexp (a * t.val) • (a • fderiv ℝ Time.val t + t.val • fderiv ℝ (fun t' => a) t)).smulRight (y t))
1 =
rexp (a * t.val) • (∂ₜ y t + a • y t) fun_prop All goals completed! 🐙 a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ (rexp (a * t.val) • fderiv ℝ y t +
(rexp (a * t.val) • (a • fderiv ℝ Time.val t + t.val • fderiv ℝ (fun t' => a) t)).smulRight (y t))
1 =
rexp (a * t.val) • (∂ₜ y t + a • y t))] a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ (rexp (a * t.val) • fderiv ℝ y t +
(rexp (a * t.val) • (a • fderiv ℝ Time.val t + t.val • fderiv ℝ (fun t' => a) t)).smulRight (y t))
1 =
rexp (a * t.val) • (∂ₜ y t + a • y t)
simp only [_root_.add_apply, _root_.smul_apply,
ContinuousLinearMap.smulRight_apply, Time.fderiv_val, smul_eq_mul, mul_one] a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ rexp (a * t.val) • (fderiv ℝ y t) 1 + (rexp (a * t.val) * (a + t.val * (fderiv ℝ (fun t' => a) t) 1)) • y t =
rexp (a * t.val) • (∂ₜ y t + a • y t)
rw [← Time.deriv_eq a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ rexp (a * t.val) • ∂ₜ y t + (rexp (a * t.val) * (a + t.val * (fderiv ℝ (fun t' => a) t) 1)) • y t =
rexp (a * t.val) • (∂ₜ y t + a • y t) a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ rexp (a * t.val) • ∂ₜ y t + (rexp (a * t.val) * (a + t.val * (fderiv ℝ (fun t' => a) t) 1)) • y t =
rexp (a * t.val) • (∂ₜ y t + a • y t)] a:ℝy:Time → EuclideanSpace ℝ (Fin 1)hy:Differentiable ℝ yt:Time⊢ rexp (a * t.val) • ∂ₜ y t + (rexp (a * t.val) * (a + t.val * (fderiv ℝ (fun t' => a) t) 1)) • y t =
rexp (a * t.val) • (∂ₜ y t + a • y t)
simp [smul_add, smul_smul] All goals completed! 🐙The variational gradient of the Caldirola–Kanai action is the exponential factor times the difference of the force and mass times acceleration appearing in Newton's second law.
lemma gradLagrangian_eq_force (xₜ : Time → EuclideanSpace ℝ (Fin 1)) (hx : ContDiff ℝ ∞ xₜ) :
S.gradLagrangian xₜ = fun t : Time =>
exp (S.γ / S.m * t) • (force S xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t) := by S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜ⊢ S.gradLagrangian xₜ = fun t => rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t)
have hdx : Differentiable ℝ (∂ₜ xₜ) := deriv_differentiable_of_contDiff xₜ hx S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)⊢ S.gradLagrangian xₜ = fun t => rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t)
funext t S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Time⊢ S.gradLagrangian xₜ t = rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t)
rw [gradLagrangian_eq_eulerLagrangeOp S xₜ hx, S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Time⊢ eulerLagrangeOp S.lagrangian xₜ t = rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t) S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Time⊢ gradient (fun x => S.lagrangian t x (∂ₜ xₜ t)) (xₜ t) -
∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t) eulerLagrangeOp S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Time⊢ gradient (fun x => S.lagrangian t x (∂ₜ xₜ t)) (xₜ t) -
∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t) S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Time⊢ gradient (fun x => S.lagrangian t x (∂ₜ xₜ t)) (xₜ t) -
∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t)] S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Time⊢ gradient (fun x => S.lagrangian t x (∂ₜ xₜ t)) (xₜ t) -
∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t)
have h2 : ∂ₜ (fun t' => gradient (S.lagrangian t' (xₜ t') ·) (∂ₜ xₜ t')) t =
exp (S.γ / S.m * t) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t) := by S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜ⊢ S.gradLagrangian xₜ = fun t => rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t) S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ gradient (fun x => S.lagrangian t x (∂ₜ xₜ t)) (xₜ t) -
∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t)
conv_lhs =>
arg 1 S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Time| fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t') S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ gradient (fun x => S.lagrangian t x (∂ₜ xₜ t)) (xₜ t) -
∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t)
ext t' S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timet':Time| gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t') S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ gradient (fun x => S.lagrangian t x (∂ₜ xₜ t)) (xₜ t) -
∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t)
rw [gradient_lagrangian_velocity_eq, ← smul_smul] S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timet':Time| rexp (S.γ / S.m * t'.val) • S.m • ∂ₜ xₜ t' S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ gradient (fun x => S.lagrangian t x (∂ₜ xₜ t)) (xₜ t) -
∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t)
rw [deriv_exp_smul (S.γ / S.m) (fun t' => S.m • ∂ₜ xₜ t') (hdx.const_smul S.m) t, S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Time⊢ rexp (S.γ / S.m * t.val) • (∂ₜ (fun t' => S.m • ∂ₜ xₜ t') t + (S.γ / S.m) • S.m • ∂ₜ xₜ t) =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t) S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ gradient (fun x => S.lagrangian t x (∂ₜ xₜ t)) (xₜ t) -
∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t)
Time.deriv_smul _ _ hdx, S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Time⊢ rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (fun t => ∂ₜ xₜ t) t + (S.γ / S.m) • S.m • ∂ₜ xₜ t) =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t) S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ gradient (fun x => S.lagrangian t x (∂ₜ xₜ t)) (xₜ t) -
∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t) smul_smul, S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Time⊢ rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (fun t => ∂ₜ xₜ t) t + (S.γ / S.m * S.m) • ∂ₜ xₜ t) =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t) S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ gradient (fun x => S.lagrangian t x (∂ₜ xₜ t)) (xₜ t) -
∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t) div_mul_cancel₀ _ S.m_ne_zero S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Time⊢ rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (fun t => ∂ₜ xₜ t) t + S.γ • ∂ₜ xₜ t) =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t) S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ gradient (fun x => S.lagrangian t x (∂ₜ xₜ t)) (xₜ t) -
∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t)] S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ gradient (fun x => S.lagrangian t x (∂ₜ xₜ t)) (xₜ t) -
∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t) S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ gradient (fun x => S.lagrangian t x (∂ₜ xₜ t)) (xₜ t) -
∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t)
rw [gradient_lagrangian_position_eq, S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ -(rexp (S.γ / S.m * t.val) * S.k) • xₜ t - ∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t) S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ -(rexp (S.γ / S.m * t.val) * S.k) • xₜ t - rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t) =
rexp (S.γ / S.m * t.val) • (-S.k • xₜ t - S.γ • ∂ₜ xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t) h2, S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ -(rexp (S.γ / S.m * t.val) * S.k) • xₜ t - rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t) =
rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t) S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ -(rexp (S.γ / S.m * t.val) * S.k) • xₜ t - rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t) =
rexp (S.γ / S.m * t.val) • (-S.k • xₜ t - S.γ • ∂ₜ xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t) force S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ -(rexp (S.γ / S.m * t.val) * S.k) • xₜ t - rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t) =
rexp (S.γ / S.m * t.val) • (-S.k • xₜ t - S.γ • ∂ₜ xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t) S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ -(rexp (S.γ / S.m * t.val) * S.k) • xₜ t - rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t) =
rexp (S.γ / S.m * t.val) • (-S.k • xₜ t - S.γ • ∂ₜ xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t)] S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜhdx:Differentiable ℝ (∂ₜ xₜ)t:Timeh2:∂ₜ (fun t' => gradient (fun x => S.lagrangian t' (xₜ t') x) (∂ₜ xₜ t')) t =
rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t)⊢ -(rexp (S.γ / S.m * t.val) * S.k) • xₜ t - rexp (S.γ / S.m * t.val) • (S.m • ∂ₜ (∂ₜ xₜ) t + S.γ • ∂ₜ xₜ t) =
rexp (S.γ / S.m * t.val) • (-S.k • xₜ t - S.γ • ∂ₜ xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t)
module All goals completed! 🐙F.3. Equation of motion iff the variational gradient vanishes
The equation of motion of the damped harmonic oscillator holds if and only if the variational gradient of the Caldirola–Kanai action vanishes, since the exponential factor is never zero.
lemma equationOfMotion_iff_gradLagrangian_zero (xₜ : Time → EuclideanSpace ℝ (Fin 1))
(hx : ContDiff ℝ ∞ xₜ) :
S.EquationOfMotion xₜ ↔ S.gradLagrangian xₜ = 0 := by S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜ⊢ S.EquationOfMotion xₜ ↔ S.gradLagrangian xₜ = 0
rw [S.equationOfMotion_iff_newtons_2nd_law xₜ, S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜ⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t) ↔ S.gradLagrangian xₜ = 0 S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜ⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t) ↔
∀ (x : Time), rexp (S.γ / S.m * x.val) • (S.force xₜ x - S.m • ∂ₜ (∂ₜ xₜ) x) = 0 x gradLagrangian_eq_force S xₜ hx, S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜ⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t) ↔
(fun t => rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t)) = 0 S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜ⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t) ↔
∀ (x : Time), rexp (S.γ / S.m * x.val) • (S.force xₜ x - S.m • ∂ₜ (∂ₜ xₜ) x) = 0 x funext_iff S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜ⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t) ↔
∀ (x : Time), rexp (S.γ / S.m * x.val) • (S.force xₜ x - S.m • ∂ₜ (∂ₜ xₜ) x) = 0 x S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜ⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t) ↔
∀ (x : Time), rexp (S.γ / S.m * x.val) • (S.force xₜ x - S.m • ∂ₜ (∂ₜ xₜ) x) = 0 x] S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜ⊢ (∀ (t : Time), S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t) ↔
∀ (x : Time), rexp (S.γ / S.m * x.val) • (S.force xₜ x - S.m • ∂ₜ (∂ₜ xₜ) x) = 0 x
refine forall_congr' fun t => ?_ S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜt:Time⊢ S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t ↔ rexp (S.γ / S.m * t.val) • (S.force xₜ t - S.m • ∂ₜ (∂ₜ xₜ) t) = 0 t
simp only [Pi.zero_apply, smul_eq_zero, Real.exp_ne_zero, false_or, sub_eq_zero] S:DampedHarmonicOscillatorxₜ:Time → EuclideanSpace ℝ (Fin 1)hx:ContDiff ℝ ∞ xₜt:Time⊢ S.m • ∂ₜ (∂ₜ xₜ) t = S.force xₜ t ↔ S.force xₜ t = S.m • ∂ₜ (∂ₜ xₜ) t
exact eq_comm All goals completed! 🐙