Physlib

Physlib.ClassicalMechanics.HarmonicOscillator.WithDim

A. A harmonic oscillator with dimension-tagged parameters

This module applies `WithDim` to the existing harmonic-oscillator model. The mass and spring constant themselves carry their physical dimensions, and the potential energy is assembled from dimension-tagged quantities. Its output dimension is therefore checked by the type of the expression rather than attached only after evaluating a numerical function.

The explicit map `toHarmonicOscillator` connects the tagged model to the existing numerical model. The analytic results then reuse the general `WithDim` transport API and the existing numerical potential energy. The derivative remains an ordinary continuous linear map between the tagged coordinate spaces; a derivative whose value itself carries the quotient of output and input dimensions remains separate follow-up work.

A.1. Dimension-tagged oscillator data

A.2. Analytic reuse

8 declarations

definition

Conversion from dimension-tagged to numerical harmonic oscillator

Given a harmonic oscillator model SS whose parameters carry physical dimensions (of type `HarmonicOscillatorWithDim`), this function constructs a corresponding numerical harmonic oscillator (of type `HarmonicOscillator`). It achieves this by extracting the raw numerical values of the mass mm and the spring constant kk from the dimension-tagged quantities S.mS.m and S.kS.k, while preserving the requirements that m>0m > 0 and k>0k > 0.

definition

Squared norm ∥x∥2\|x\|^2 with dimension L2L^2

Given a position xx in a 1-dimensional Euclidean space R1\mathbb{R}^1 that carries the physical dimension of length LL (represented by LdL_{\mathfrak{d}}), this function calculates the squared norm ∥x∥2=⟨x,x⟩\|x\|^2 = \langle x, x \rangle of the position's underlying value. The resulting real number is tagged with the physical dimension of length squared L2L^2.

theorem

Numerical value of dimension-tagged squared norm ∥x∥2\|x\|^2 equals ⟨xval,xval⟩R\langle x_{\text{val}}, x_{\text{val}} \rangle_{\mathbb{R}}

For any position xx in a 1-dimensional Euclidean space R1\mathbb{R}^1 that carries the physical dimension of length LL, the numerical value of its dimension-tagged squared norm ∥x∥2\|x\|^2 is equal to the real inner product of the underlying numerical value of xx with itself, denoted by ⟨xval,xval⟩R\langle x_{\text{val}}, x_{\text{val}} \rangle_{\mathbb{R}}.

definition

Potential energy V(x)=12k∥x∥2V(x) = \frac{1}{2} k \|x\|^2 with dimension ML2T−2M L^2 T^{-2}

For a harmonic oscillator SS with dimension-tagged parameters, the potential energy function maps a position xx in a 1-dimensional Euclidean space R1\mathbb{R}^1 (with physical dimension of length LL) to the quantity 12k∥x∥2\frac{1}{2} k \|x\|^2, where kk is the spring constant of the oscillator. The resulting value is a real number carrying the physical dimension of energy, M⋅L2⋅T−2M \cdot L^2 \cdot T^{-2}.

theorem

Numerical value of dimension-tagged potential energy (VS(x))val=VSnum(xval)(V_S(x))_{\text{val}} = V_{S_{\text{num}}}(x_{\text{val}})

For a dimension-tagged harmonic oscillator SS and a position xx in a 1-dimensional Euclidean space with physical dimension of length LL, the numerical value of the dimension-tagged potential energy VS(x)V_S(x) is equal to the potential energy calculated by the corresponding numerical harmonic oscillator SnumS_{\text{num}} at the numerical position xvalx_{\text{val}}. That is, (VS(x))val=VSnum(xval)(V_S(x))_{\text{val}} = V_{S_{\text{num}}}(x_{\text{val}}) where (⋅)val(\cdot)_{\text{val}} denotes the extraction of the underlying numerical value from a dimension-tagged quantity.

theorem

Dimension-Tagged Potential Energy as a Transport of Numerical Potential Energy

For a harmonic oscillator SS with dimension-tagged parameters, the potential energy function VSV_S is equal to the transport of the numerical potential energy function of its corresponding numerical oscillator (constructed via `toHarmonicOscillator`). The transport operation lifts the numerical function to one that acts on an input with the dimension of length LdL_{\mathfrak{d}} and produces an output with the dimension of energy Md⋅Ld2⋅Td−2M_{\mathfrak{d}} \cdot L_{\mathfrak{d}}^2 \cdot T_{\mathfrak{d}}^{-2}.

theorem

Fréchet Differentiability of Dimension-Tagged Potential Energy for a Harmonic Oscillator

Let SS be a harmonic oscillator with dimension-tagged parameters and let VSV_S be its potential energy function, which maps a position xx with physical dimension of length LL to a value with dimension of energy M⋅L2⋅T−2M \cdot L^2 \cdot T^{-2}. For any such position xx, the potential energy function VSV_S is Fréchet differentiable at xx. Its derivative is given by the transported linear map of the Fréchet derivative of the corresponding numerical potential energy function VnumV_{\text{num}} (obtained from the numerical oscillator SnumS_{\text{num}}) evaluated at the numerical value of xx.

theorem

The potential energy of a dimension-tagged harmonic oscillator is continuous.

For a harmonic oscillator SS with dimension-tagged parameters, the potential energy function VSV_S is continuous.