Project

Stability of Ordinary Differential equation ODE

(i) ODE(Ordinary differential equation) Stability depends on the type of method applied.

For example if we use the Eulers forward differential method i.e., the explicit method to find the solution of the ODE.

Eulers forward differential method (Explicit)

`y_(n+1)=y_n +h*f(x_n,y_n)` lets say equation-A

where, `h=x_1-x_0`

for `n=1`; `y_1=y_0+h*f(x_0,y_0)`

`y_1=y_(New)`; `y_0=y_(Old)` in the code.

It stays stable upto certain number of grid points & time steps after that it becomes unstable. For such cases the solution doesn\'t converge & starts to fluctuate from the actual value of solution. In order to see it lets use a python program to demonstrate it.

The program code to solve the ODE with explicit method is shown below.

Stable condition:

import math
import matplotlib.pyplot as plt 

def f(t,y):
	return -1000*y - math.exp(t)

t_start = 0
t_end = 0.1
n = 500 #large no. of grid points
dt = (t_end - t_start)/(n-1)
t = 0
y_old = 0
y_new = []
#y_analy = []

for i in range(0,n):

	y_new.append(y_old + dt*f(t,y_old))
	#y_analy.append(f(t,y_old))
	y_old = y_new[i]
	t = t + dt

plt.plot(y_new)
#plt.plot(y_analy,color=\'red\')
plt.show()
print(dt)

Here, for the function f(t) `-1000y -e^t`, I have taken the time step as 0.1 & number of grid points as 500. These intial values effect the solution a lot. \'For loop\' is used to get range of \'y_new\' values for \'n\' number of grid points & the equation-A is inculcated in the loop. Initially the y_old & t (time step) values are assumed to be 0 (zero) for ease of calculation. These values are plotted using matplot library.

The plot for this condition with (x,y) = (n,y_new) is shown below which seems to be stable for these number of grid points.

Unstable condition:

For the same code above if we change just the number of grid points to around 50 & keeping the time step constant as 0.1 the code & plot for that condition is shown below as follows.

import math
import matplotlib.pyplot as plt 

def f(t,y):
	return -1000*y - math.exp(t)

t_start = 0
t_end = 0.1
n = 50 #large no. of grid points
dt = (t_end - t_start)/(n-1)
t = 0
y_old = 0
y_new = []
#y_analy = []

for i in range(0,n):

	y_new.append(y_old + dt*f(t,y_old))
	#y_analy.append(f(t,y_old))
	y_old = y_new[i]
	t = t + dt

plt.plot(y_new)
#plt.plot(y_analy,color=\'red\')
plt.show()
print(dt)

The values of y_new starts to fluctuate & it starts to diverge from the actual solution with increasing frequency instead of converging. So for certain methods with small change in input parameters leads to large change in output values which is undesirable for the convergence of the solution i.e, referred to as unstable condition.

(ii) The stability of ODE effects the engineering simulation in many ways. Since, the computer programs employs numerical methods to get the desired solution for various applications of engineering aspects. Differential equations are a natural way to descibe dynamically changing systems. It is important that the ODE converges to a solution faster & accurately or else the simulations might predict different solution which is completely different from the reality of its phenomena.

Simulating a system means to solve its mathematical model based on actual physical phenomena & predict its behavior in different conditions. So, it is extremely important that the solution converges to a particular value i.e., which is the stability of the differential equations that we are solving for a particular problem.

(iii) There are certain methods which we can employ to find the stability of ODE for all types of problems & conditions. The methods are stated below.

  • Courant-Freiedrichs-Lewy condition: This condition can be used for n-dimensional cases & even for non-linear cases.
  • Eigen value stability condition: This condition is used for linear system of ODE\'s.
  • Von-Neumann Stability condition (Fourier stability condition): widely used for heat equations.

The converged values are closer to the actual analytical solution with slight minimal error which occurs due to deployment of numerical methods (subjected to errors) & also depends on sensitive of computer code for that problem.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.