pyoomph.equations.harmonic_oscillator module

class pyoomph.equations.harmonic_oscillator.HarmonicOscillator(*, omega=1, damping=0, driving=0, name='y', first_derivative_name=None)[source]

Bases: ODEEquations

Represents a harmonic oscillator defined by the second-order ordinary differential equation (ODE):

\[\partial_t^2 y + 2\delta \partial_t y + \omega^2 y = f(t)\]

where \(y\) is the dependent variable, \(t\) is the independent variable (time), \(\delta\) is the damping coefficient, and \(\omega\) is the angular frequency. f(t) is an optional forcing term.

Parameters:
  • omega (Union[Expression, int, float]) – The angular frequency of the harmonic oscillator. Default is 1.

  • damping (Union[Expression, int, float]) – The damping coefficient of the harmonic oscillator. Default is 0.

  • driving (Union[Expression, int, float]) – Driving term f

  • name (str) – The name of the dependent variable. Default is “y”.

  • first_derivative_name (Optional[str]) – The name of the first derivative of the dependent variable. Default is None, meaning that the equation is a second-order ODE.