DynamicSystems - Maple Programming Help

Home : Support : Online Help : Science and Engineering : Dynamic Systems : System Object : DynamicSystems/ToContinuous

DynamicSystems

 ToContinuous
 convert a discrete-time system to continuous-time system

 Calling Sequence ToContinuous(sys, opts)

Parameters

 sys - System; system object opts - (optional) equation(s) of the form option = value; specify options for the ToContinuous command

Options

 • method = forward, backward, bilinear, prewarp, matched, zoh, or foh
 Specifies the conversion method.
 • frequency = realcons
 Specifies the warping or critical frequency in rad/s. This is used only if method = prewarp, otherwise it is ignored.

Description

 • The ToContinuous command converts a discrete-time system, sys, to a continuous-time system.
 • The method option specifies the discrete-time to continuous-time conversion method. The following methods are supported: forward rectangle rule (forward), backward rectangle rule (backward), bilinear rule (bilinear), bilinear with prewarping (prewarp), matched poles and zeros (matched), zero-order hold (zoh), and first-order hold or non-causal triangle-hold (foh).
 • The bilinear rule is also known as the Tustin or Trapezoid rule.
 • Not all inverse-discretization methods can be applied to all system types. The following table describes the usage. An x indicates that the method can be used by the system type. A D indicates that the method is the default for the system type.

 System Type forward backward bilinear prewarp matched zoh foh State-Space x x D x x Transfer-Function x x D x x x Coefficients x x D x x x Zero-Pole-Gain D

Transformations

Frequency Domain Transformations

The frequency-domain transformations convert rational functions in z to rational functions in s, where z and s are the discrete and continuous complex frequency variables, respectively. The following functions describe the mappings from the z plane to the s plane for each of the defined transformations where T is the sampling period of the discrete-time system.

 • forward  : z -> 1 + s*T
 • backward : z -> 1/(1-s*T)
 • bilinear : z -> (2+s*T)/(2-s*T)
 • prewarp  : z -> (|$\mathrm{\omega }$| + s*tan(|$\mathrm{\omega }$|*T/2))/(|$\mathrm{\omega }$| - s*tan(|$\mathrm{\omega }$|*T/2)) where $\mathrm{\omega }$ is the critical frequency in rad/s.
 • matched  : poles and zeros in the z-plane map to the s-plane as  z = exp(s*T).

The Laplace transform is used in the following hold equivalents:

 • zoh : H(s) = s*laplace(invztrans(H(z)/(1-1/z)))
 • foh : H(s) = s^2*laplace(invztrans(T*z*H(z)/(z-1)^2))

Time Domain Transformations

The time-domain transformations are done on the discrete-time state-space matrices Ad, Bd, Cd, Dd, and T is the sampling period of the discrete-time system. The matrices Ac, Bc, Cc, Dc represent the continuous-time matrices. I is the identity matrix.

 • forward

Bc = Bd/T

Cc = Cd

Dc = Dd

 • backward

Dc = Dd - Cd.Bc*T

 • bilinear

Bc = Bd/sqrt(T) - sqrt(T)/2*Ac.Bd

Cc = Cd/sqrt(T) + sqrt(T)/2*Cd.Ac

Dc = Dd - sqrt(T)/2*Cd.Bc

 • zoh

Bc = (exp(Ac*T) - I)^(-1).Ac.Bd

Cc = Cd

Dc = Dd

 • foh

Bc = (exp(Ac*T) - I)^(-2).Ac^2.Bd*T

Cc = Cd

Dc = Dd - Cc.(Ac^(-1).(exp(Ac*T)/T - I) - I)Ac^(-1).Bc

Examples

 > $\mathrm{with}\left(\mathrm{DynamicSystems}\right):$

Convert discrete-time transfer function to continuous-time using different conversion methods.

 > $\mathrm{sys}≔\mathrm{TransferFunction}\left(\left[10,-5\right],\left[1,-0.8\right],\mathrm{discrete},\mathrm{sampletime}=0.5\right):$$\mathrm{PrintSystem}\left(\mathrm{sys}\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{discrete; sampletime = .5}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({z}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({z}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{10.}{}{z}{-}{5.}}{{z}{-}{0.8000000000}}\end{array}\right$ (1)
 > $\mathrm{sys_s1}≔\mathrm{ToContinuous}\left(\mathrm{sys},\mathrm{method}=\mathrm{forward}\right):$$\mathrm{PrintSystem}\left(\mathrm{sys_s1}\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({s}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({s}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{10.}{}\left({s}{+}{1.}\right)}{{s}{+}{0.4000000000}}\end{array}\right$ (2)
 > $\mathrm{sys_s2}≔\mathrm{ToContinuous}\left(\mathrm{sys},\mathrm{method}=\mathrm{backward}\right):$$\mathrm{PrintSystem}\left(\mathrm{sys_s2}\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({s}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({s}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{6.250000000}{}\left({s}{+}{2.}\right)}{{s}{+}{0.5000000000}}\end{array}\right$ (3)
 > $\mathrm{sys_s3}≔\mathrm{ToContinuous}\left(\mathrm{sys},\mathrm{method}=\mathrm{bilinear}\right):$$\mathrm{PrintSystem}\left(\mathrm{sys_s3}\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({s}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({s}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{8.333333333}{}\left({s}{+}{1.333333333}\right)}{{s}{+}{0.4444444444}}\end{array}\right$ (4)
 > $\mathrm{sys_s4}≔\mathrm{ToContinuous}\left(\mathrm{sys},\mathrm{method}=\mathrm{prewarp},\mathrm{frequency}=0.3\right):$$\mathrm{PrintSystem}\left(\mathrm{sys_s4}\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({s}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({s}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{8.333333333}{}\left({s}{+}{1.330832395}\right)}{{s}{+}{0.4436107985}}\end{array}\right$ (5)
 > $\mathrm{sys_s5}≔\mathrm{ToContinuous}\left(\mathrm{sys},\mathrm{method}=\mathrm{zoh}\right):$$\mathrm{PrintSystem}\left(\mathrm{sys_s5}\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({s}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({s}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{10.}{}\left({s}{+}{1.115717756}\right)}{{s}{+}{0.4462871026}}\end{array}\right$ (6)
 > $\mathrm{sys_s6}≔\mathrm{ToContinuous}\left(\mathrm{sys},\mathrm{method}=\mathrm{foh}\right):$$\mathrm{PrintSystem}\left(\mathrm{sys_s6}\right)$
 $\left[\begin{array}{l}{\mathbf{Transfer Function}}\\ {\mathrm{continuous}}\\ {\mathrm{1 output\left(s\right); 1 input\left(s\right)}}\\ {\mathrm{inputvariable}}{=}\left[{\mathrm{u1}}{}\left({s}\right)\right]\\ {\mathrm{outputvariable}}{=}\left[{\mathrm{y1}}{}\left({s}\right)\right]\\ {{\mathrm{tf}}}_{{1}{,}{1}}{=}\frac{{8.264233654}{}\left({s}{+}{1.350055919}\right)}{{s}{+}{0.4462871026}}\end{array}\right$ (7)

Compare the frequency responses of all systems.

 > $\mathrm{p0}≔\mathrm{MagnitudePlot}\left(\mathrm{sys},\mathrm{range}=0.1..10,\mathrm{color}=\mathrm{red},\mathrm{thickness}=2,\mathrm{legend}="discrete"\right):$
 > $\mathrm{p1}≔\mathrm{MagnitudePlot}\left(\mathrm{sys_s1},\mathrm{range}=0.1..10,\mathrm{color}=\mathrm{blue},\mathrm{legend}="forward"\right):$
 > $\mathrm{p2}≔\mathrm{MagnitudePlot}\left(\mathrm{sys_s2},\mathrm{range}=0.1..10,\mathrm{color}=\mathrm{green},\mathrm{legend}="backward"\right):$
 > $\mathrm{p3}≔\mathrm{MagnitudePlot}\left(\mathrm{sys_s3},\mathrm{range}=0.1..10,\mathrm{color}=\mathrm{black},\mathrm{legend}="bilinear"\right):$
 > $\mathrm{p4}≔\mathrm{MagnitudePlot}\left(\mathrm{sys_s4},\mathrm{range}=0.1..10,\mathrm{color}=\mathrm{grey},\mathrm{legend}="prewarp"\right):$
 > $\mathrm{p5}≔\mathrm{MagnitudePlot}\left(\mathrm{sys_s5},\mathrm{range}=0.1..10,\mathrm{color}=\mathrm{cyan},\mathrm{legend}="zoh"\right):$
 > $\mathrm{p6}≔\mathrm{MagnitudePlot}\left(\mathrm{sys_s6},\mathrm{range}=0.1..10,\mathrm{color}=\mathrm{magenta},\mathrm{legend}="foh"\right):$
 > $\mathrm{plots}\left[\mathrm{display}\right]\left(\mathrm{p0},\mathrm{p1},\mathrm{p2},\mathrm{p3},\mathrm{p4},\mathrm{p5},\mathrm{p6}\right)$

Compatibility

 • The DynamicSystems[ToContinuous] command was introduced in Maple 18.