Harmonic Oscillator Chain¤
Main module for a harmonic oscillator chain.
HarmonicOscillatorsChain
¤
Generate time series data for a coupled harmonic oscillator chain with periodic boundary condition.
A one-dimensional circle of \(N\) interacting harmonic oscillators can be described by the Lagrangian action \(\(S_L[x_i] = \int_{t_0}^{t_1}\mathbb{d} t \left\{ \sum_{i=0}^{N-1} \frac{1}{2}m \dot x_i^2 - \frac{1}{2}m\omega^2\left(x_i - x_{i+1}\right)^2 \right\}\,,\)\) where \(x_N \coloneqq x_0\).
This system can be solved in terms of travelling waves, obtained by discrete Fourier transform.
Since the original degrees of freedom are real, the initial conditions of the propagating waves need to satisfy \(Y_k = Y^*_{-k \mod N}\), see Wikipedia.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
omega |
float
|
frequence parameter |
required |
initial_conditions |
Sequence[Mapping[str, float | tuple[float, float]]]
|
a sequence of initial conditions on the Fourier modes. The first element in the sequence is that of the zero mode, taking a position and a velocity. Rest of the elements are that of the independent travelling waves, taking two amplitudes and two initial phases. |
required |
odd_dof |
bool
|
The system will have |
required |
Source code in hamilflow/models/harmonic_oscillator_chain.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|
definition: dict[str, float | dict[str, dict[str, float | list[float]]] | list[dict[str, dict[str, float | tuple[float, float]]]]]
cached
property
¤
Model params and initial conditions defined as a dictionary.
__call__(t)
¤
Generate time series data for the harmonic oscillator chain.
Returns float(s) representing the displacement at the given time(s).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
t |
Sequence[float] | ArrayLike
|
time. |
required |
Source code in hamilflow/models/harmonic_oscillator_chain.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
|