# Energy conservation in a driven harmonic oscillator

The ODE for a driven harmonic oscillator is given by $$\ddot{x}+2\gamma \dot{x}+\omega_0^2 x = \frac{F}{m}\cos(\omega_dt)$$

By assuming balance of forces, i.e. energy conservation, one can solve for x and eventually arrive at $$\sigma=\arctan \left(\frac{\gamma \omega_d}{\omega_0^2-\omega_d^2}\right)$$

which describes the phase relationship between the oscillator and the driving force. I understand that this phase shift gives rise to the Lorentzian line shape of the amplitude of the oscillator, since at resonance the driving force is in phase with the velocity of the oscillator, resulting in maximum power. At non-resonant frequencies the driving force is in phase only some of the times during a period. However, intuitively I'm unable to see why this phase shift is a necessary condition for (or how it relates to) energy conservation.

• Balance of forces is not energy conservation. The phase relationship is valid for the stationary solution, after the transient decayed. Commented Mar 21, 2023 at 23:29

Balance of forces is not equivalent to energy conservation, and the driven oscillator is a good example of this.

Newton's second law, which is what I assume you used to find this equation of motion, does not follow from the conservation of energy. It just states that the acceleration of a body is determined by the forces acting on it according to

$$$$\mathbf{a}(t) = \frac{1}{m} \mathbf{F}(t).$$$$

Energy, on the other hand, is a quantity related to time translation symmetry via Noether's theorem. Newton's second law does not require or follow from energy conservation.

For the driven oscillator, both the damping and the driving force break energy conservation. The damping term is a simple way to model the loss of energy of your oscillator to the environment, by heat dissipation for instance. The oscillatory driving force is constantly injecting energy into the oscillator. Since there exist these external systems which exchange energy with the oscillator, but whose dynamics are not considered in the force law, energy is not conserved.

If you decided to include the detailed description of the environment and whatever it is that is responsible for the cosine force, you would then find that energy is conserved as a whole, but can still flow from one subsystem to another. This, however, would make the equations of motion impossibly complicated and for most purposes this level of detail is not even necessary in order to understand the relevant physics, so it is usually better to just give up energy conservation and model how your system loses or gains energy phenomenologically, which is how you get the damped driven oscillator.

If you have two harmonic quantites $$x,y$$: $$x=\Re(Xe^{i\omega t})\\ y=\Re(Ye^{i\omega t})\\$$ then the average over a period of the product is given by: $$\langle xy\rangle_T=\frac{1}{2}\Re (XY^*) =|X||Y|\cos\phi$$ where $$\phi$$ is the phase difference between the signals. Interpreting the product as a form of power, the more in phase the signals are, the more power you get.

You can use this to do an energy balance of your system. The power of the force must equal the power dissipated in the stationary state since energy does not vary on average. Thus the relative phase between velocity and force (or equivalently between position and force up to an additional phase) is important to calculate the injected power.

Mathematically, you get the equality of the powers: $$P=2\gamma\langle \dot x^2\rangle_T= \langle f \dot x\rangle_T$$ from multiplying by $$\dot x$$ the equation of motion and taking the time average. Note that on the LHS, you get an additional term $$\dot E$$, the time derivative of energy, but its average value in the stationary state is zero.

Using the previous result, you get: $$2\gamma\omega^2 |X|=F\sin\sigma$$ (there is a $$\pi/2$$ phase difference between $$x$$ and $$\dot x$$). Energy conservation thus gives a relation between amplitude $$|X|$$ and dephasing.

From this relation for example, you can see that the presence of damping forces dephasing in order keep a finite amplitude. In fact, it indicates that resonance, a maximum of $$X$$ is accompanied by a lagging of $$\pi/2$$.

Note that energy conservation alone does not give you both amplitude and dephasing, only a relation between the two. Therefore, you need some information beforehand about amplitude in order to use conservation of energy to deduce your dephasing and vice versa.

Hope this helps.

You need to be careful, try to avoid energy conservation, but rather energy balance. Even if the averaged energy per period does not change, there is still dissipation and injection, i.e. fluxes. Therefore, there is global balance and not detailed balance (synonymous to energy conservation).

Within a period, there is not even energy balance. Recall that energy is: $$E = \frac{1}{2}\dot x^2+\frac{\omega_0^2}{2}x^2$$ so using complex notation: $$x^2 = \frac{1}{2}\Re (X^2e^{i2\omega t})+\frac{1}{2}|X|^2$$ you get: $$E = \frac{-\omega_d^2+\omega_0^2}{4}\Re(X^2e^{i2\omega_d t})+\frac{\omega_d^2+\omega_0^2}{4}|X|^2$$ The second term is the constant value that you get from averaging. However, the first term shows that in general, $$E$$ fluctuates at frequency $$2\omega_d$$, ie twice as fast as a period.

Note that at resonance, $$E$$ is constant even within the period. However, the same caveat applies. There will still be dissipation and injection, so you only have global balance at each time. This is why you avoid saying that energy is conserved.

• Can you please explain how you get to the last equation and what ω stands for? I understand that power is dependent on the phase difference between force and velocity but I'm not sure how you arrive at the LHS of the equation. Commented Mar 22, 2023 at 18:56
• It’s your $\omega_d$. I used $\dot x=i\omega x$
– LPZ
Commented Mar 22, 2023 at 20:12
• Understood. Thanks. I have another question. In all these derivations it's common to take the average over one cycle, since the energy does change within that cycle. But surely energy conservation must still be obeyed within that one cycle. Commented Mar 23, 2023 at 14:44