I Conservation of finite difference for vibration equations

feynman1
Messages
435
Reaction score
29
Let's discuss whether the energy under a finite difference (FD) scheme is conserved. Take the simplest vibration eq mx''+kx=0, which one will use a FD scheme to solve. The energy is mx'^2/2+kx^2/2. Whether the energy is conserved doesn't depend on the FD scheme for the ODE but upon the FD scheme for the x' term in the energy?
 
Physics news on Phys.org
THe example you have given is an ODE with two dimensions: <br /> \begin{align*}<br /> x&#039; &amp;= v \\ v&#039; &amp;= - x \end{align*} where time is scaled to that k/m = 1. Then the energy is E = \frac{12}(v^2 + x^2).

The result of your numeric integration is a sequence (x_n,v_n) which approximates the solution at time (t_n. But there will be errors, so x_{n+1} = x(t_{n+1}) + \epsilon_x(n) and similarly for v. Hence <br /> \begin{align*}<br /> E_{n} &amp;= \frac12 \left( (v(t_n) + \epsilon_v)^2 + (x(t_n) + \epsilon_x)^2 \right) \\<br /> &amp;= E(t_n) + v(t_n) \epsilon_v + x(t_n)\epsilon_x + \frac12 (\epsilon_v^2 + \epsilon_x^2).<br /> \end{align*}<br /> so assuming (x_n,v_n) is exact, at time t_{n+1} you will see that the energy has changed by an amount \Delta E = v(t_{n+1}) \epsilon_v(n+1) + x(t_{n+1})\epsilon_x(n+1) + \frac12 (\epsilon_v^2(n+1) + \epsilon_x^2(n+1))<br /> which in general is not zero.

So for a PDE the answer must be that whether or not energy is conserved depends on both the time integration and the spatial discretization.
 
pasmith said:
THe example you have given is an ODE with two dimensions: <br /> \begin{align*}<br /> x&#039; &amp;= v \\ v&#039; &amp;= - x \end{align*} where time is scaled to that k/m = 1. Then the energy is E = \frac{12}(v^2 + x^2).

The result of your numeric integration is a sequence (x_n,v_n) which approximates the solution at time (t_n. But there will be errors, so x_{n+1} = x(t_{n+1}) + \epsilon_x(n) and similarly for v. Hence <br /> \begin{align*}<br /> E_{n} &amp;= \frac12 \left( (v(t_n) + \epsilon_v)^2 + (x(t_n) + \epsilon_x)^2 \right) \\<br /> &amp;= E(t_n) + v(t_n) \epsilon_v + x(t_n)\epsilon_x + \frac12 (\epsilon_v^2 + \epsilon_x^2).<br /> \end{align*}<br /> so assuming (x_n,v_n) is exact, at time t_{n+1} you will see that the energy has changed by an amount \Delta E = v(t_{n+1}) \epsilon_v(n+1) + x(t_{n+1})\epsilon_x(n+1) + \frac12 (\epsilon_v^2(n+1) + \epsilon_x^2(n+1))<br /> which in general is not zero.

So for a PDE the answer must be that whether or not energy is conserved depends on both the time integration and the spatial discretization.
Thank you very much for the analysis. I actually meant the same, that is I didn't mean to say that the FD scheme for the ODE doesn't affect but rather meant that the x' term in the energy would even if the FD scheme for the ODE gave an exact solution.
Your analysis is beautiful. Can we conclude that a FD scheme is either dissipative (positive/negative) or dispersive (positive/negative)? Is there any conservative FD scheme for this simplest vibration equation?
 
Thread 'Direction Fields and Isoclines'
I sketched the isoclines for $$ m=-1,0,1,2 $$. Since both $$ \frac{dy}{dx} $$ and $$ D_{y} \frac{dy}{dx} $$ are continuous on the square region R defined by $$ -4\leq x \leq 4, -4 \leq y \leq 4 $$ the existence and uniqueness theorem guarantees that if we pick a point in the interior that lies on an isocline there will be a unique differentiable function (solution) passing through that point. I understand that a solution exists but I unsure how to actually sketch it. For example, consider a...
Back
Top