Engee documentation
Notebook

Approximation of the time delay in an open-loop continuous model

This example shows how to approximate delays in an open continuous time system using pade.

The Pad approximation is useful when using analysis or design tools that do not support time delays. Using too high an approximation order can lead to numerical errors and possibly unstable poles. Therefore, avoid approximations of the same order. .

Setting the task

Create a sample of an open-loop system with delayed output.

TimeDelayApproximationInContinuousTimeOpenLoopModelExample_01.png
In [ ]:
Pkg.add(["ControlSystems"])
In [ ]:
using ControlSystems

By default, the delay is 2.6, but you can set your own parameter. As a result, you will get a P-object in the form of a state space (ss) with a time delay of 2.6 seconds.

In [ ]:
s = tf('s');

L = 2.6 # @param {type:"slider", min:0, max:9, step:0.1}
P = exp(-L*s)/(s^2+0.9*s+1)
Out[0]:
DelayLtiSystem{Float64, Float64}

P: StateSpace{Continuous, Float64}
A = 
  0.0   1.0
 -1.0  -0.9
B = 
 0.0  0.0
 1.0  0.0
C = 
 0.0  0.0
 1.0  0.0
D = 
 0.0  1.0
 0.0  0.0

Continuous-time state-space model

Delays: [2.6]

First-order approximation

Calculate the first-order Pade approximation for P.

In [ ]:
Pnd1 = pade(P,1)
Out[0]:
StateSpace{Continuous, Float64}
A = 
  0.0   1.0   0.0
 -1.0  -0.9   0.0
  1.0   0.0  -0.7692307692307692
B = 
 0.0
 1.0
 0.0
C = 
 -1.0  0.0  1.5384615384615383
D = 
 0.0

Continuous-time state-space model

This command replaces all time delays in P with a first-order approximation. Thus, Pnd1 is a third—order system without delays.

Compare the frequency response of the initial and approximate models using bodeplot.

In [ ]:
bodeplot([P, Pnd1], label = ["P" "Pnd1"])
Out[0]:

The amplitude characteristics of P and Pnd1 are exactly the same. However, the Pnd1 phase differs from the P phase by about 1 rad/s.

Third-order approximation

Increase the Pad approximation order to expand the frequency range for which the phase approximation is good.

In [ ]:
Pnd3 = pade(P,3);

Compare the frequency characteristics of P, Pnd1 and Pnd3.

In [ ]:
bodeplot([P, Pnd1, Pnd3], label = ["P" "Pnd1" "Pnd3"])
Out[0]:

The error of the phase characteristic decreases when using the Padet approximation of the third order.

Compare the transient characteristics of the original and approximated systems in the time domain using step.

In [ ]:
plot(
    [step(P), step(Pnd1), step(Pnd3)], 
    label = ["P" "Pnd1" "Pnd3"]
)
Out[0]:

Conclusions

The use of the Pade approximation leads to the appearance of a non-minimal phase in the initial transition process. This effect is quite pronounced in the first-order approximation, which drops significantly below zero before changing direction. In a higher-order approximation, this effect is reduced, and it better matches the exact response of the system.