Literature review ODE Stability
An Ordinary Differential Equation is a equation containing one or more functions of a single indepandent variable. Consider the equation of a simple undamped cylinder.
PHYSICAL STABILITY: (When does a ODE become unstable?)
If every solution `psi(t)` of the system close to `phi(t)` at initial time t = 0 remains close for all the future times. In other words, the stability definition talks about the maximum error `abs(psi(t) - pgi(t))`that can be accomodated. This is the physical stability of an ODE equation.
When the same equation is solved numerically, \'Numerical Stabiliy\' comes into play. The step size chosen to solve the equation numerically, plays an important role in numerical solvers.
NUMERICAL STABILITY [used for engineering simulations]
Numerically, a given ODE is stable when small changes in the initial data for the differential equation produce correspondingly small changes in the subsequent approximations. In other words, if \'`bar(y)`\' is the solution to x(t,x1), for each `epsilon>0` there is a `delta > 0` sufficiently small so that `abs(y - bar(y)) < epsilon` whenever `abs(x1 - x) < delta`.
`(d^2theta)/dt^2 = -g/l sin theta` ; This is a ordinary differential equation of second order; Writing this in first order form by considering `y1 = theta` and `y2 = (d theta)/dt`. The ODE is said to be stable when a solution `phi(t)` ;
Using Euler\'s method (`frac{dx(t)}{dt} = frac{x(t+h) - x(t)}{h}`), a forward differencing scheme, to compute the derivative of the above equation, we get a solution plot:
Is is observed that the solution is becoming unbounded over time contrary to how the physical system behaves. In Explicit methods, the next iterate is defined based on previous values of iterates. Explicit method are conditionally stable and small steps sizes are required.
Now Euler backward differecing scheme is employed in finding the derivative (`frac{dx(t)}{dt} = frac{x(t) - x(t-h)}{h}`). This is the plot that we obtain:
In the Euler explicit we found that the time between zeros was increasing every step and in Implict scheme, the time between zeros is decreasing. Implicit systems are unconditionally stable and trades off higher timesteps for accuracy. Finally, the pendulum equation is solved using Runge Kutta method and we obtain the plot:
We find that the R-K method is stable and distance between zeros is almost constant. The R-K method uses a fourth order scheme.
- Hence the numerical stability scheme employed is very important in Engineering simulations as it decides the stability of the system
- Based on time on hand and accuracy needed, the scheme is chosen for Industrial applications.
- Higher order schemes give results with higher accuracy but have more simulation time.
- The step size is very important in determining accuracy.
- When a engineering simulation problem becomes unstable, the solution is not usable and the solver has to be initialized again which results in waste of time, money and resources.
The following python program compares the Euler Explicit and Implicit scheme. Higher the value of dt, the explicit scheme blows up:
import numpy as np
import matplotlib.pyplot as plt
def explicit_euler(total_t, dt):
t = np.arange(0, total_t, dt)
y = np.zeros(len(t))
for i in range(1, len(t)):
y[i] = y[i-1] + dt*(-1000*y[i-1] - np.exp(-t[i-1]))
return [t,y]
def implicit_euler(total_t, dt):
t = np.arange(0, total_t, dt)
y = np.zeros(len(t))
for i in range(1, len(t)):
y[i] = (y[i-1] -np.exp(t[i-1])*dt)/(1+1000*dt)
return [t,y]
total_t = 0.1
dt = 1.5e-3
t, y_explicit = explicit_euler(total_t,dt)
t, y_implicit = implicit_euler(total_t, dt)
plt.plot(t, y_explicit)
plt.plot(t,y_implicit)
plt.legend([\'Explicit\',\'Implicit\'])
plt.show()
Can stability condition be derived for all types of problems?
For ODE systems, stability analysis is divided into the following:
- Linear ODE Stability
- Stability of autonomous ODE systems
- Non-Linear stability systems.
- ODE stability for Multivariable systems
The above mentioned topics are broad topics with its own theorems and claims. These topics covers almost all types of stability systems needed for complex Engineering simulation problems.