MaplePortal/TransferFunctions - Maple Help

 Transfer Functions

 Introduction

The DynamicSystems package contains many tools for manipulating transfer functions, and visualizing their response in both the time and frequency domain.

Here, we demonstrate how to define a transfer function, generate a phase plot, and convert a transfer function to the time domain. Much more is possible.

 Define a Transfer Function

 > $\mathrm{restart}:\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathrm{with}\left(\mathrm{DynamicSystems}\right):$
 > $\mathrm{tf}≔\frac{s}{a\cdot {s}^{2}+b\cdot s+c}:$

Define a transfer function object

 > $\mathrm{sysTF}≔\mathrm{TransferFunction}\left(\mathrm{tf},\mathrm{parameters}=\left[a=1,b=1,c=1\right]\right)$
 ${\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (1)

 Generate a Phase Plot

 > $\mathrm{PhasePlot}\left(\mathrm{sysTF},\mathrm{parameters}=\left[a=3,b=4,c=5\right]\right)$

 Convert Transfer Function to a Differential Equation

 > $\mathrm{sysDE}≔\mathrm{DiffEquation}\left(\mathrm{tf}\right)$
 ${\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (2)
 > $\mathrm{sysDE}:-\mathrm{de}$
 $\left[\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{x1}}{}\left({t}\right){=}{-}\frac{{a}{}{\mathrm{x2}}{}\left({t}\right)}{{b}}{,}\frac{{ⅆ}}{{ⅆ}{t}}\phantom{\rule[-0.0ex]{0.4em}{0.0ex}}{\mathrm{x2}}{}\left({t}\right){=}\frac{{c}{}{b}{}{\mathrm{x1}}{}\left({t}\right)}{{{a}}^{{2}}}{-}\frac{{b}{}{\mathrm{x2}}{}\left({t}\right)}{{a}}{-}\frac{{b}{}{\mathrm{u1}}{}\left({t}\right)}{{a}}{,}{\mathrm{y1}}{}\left({t}\right){=}{-}\frac{{\mathrm{x2}}{}\left({t}\right)}{{b}}\right]$ (3)



 Discretization and Time-Domain Response to an Input Signal

Sampling time and number of samples

 > $\mathrm{Ts}≔0.025:\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathrm{Ns}≔1000:\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}$

Generate the input signal

 > $\mathrm{NoisyInput}≔\mathrm{Chirp}\left(1,0.02,0.01,\mathrm{hertz}=\mathrm{true},\mathrm{discrete}=\mathrm{true},\mathrm{samplecount}=\mathrm{Ns},\mathrm{sampletime}=\mathrm{Ts}\right)+\mathrm{Statistics}:-\mathrm{Sample}{\left(\mathrm{Normal}\left(0,0.05\right),\mathrm{Ns}\right)}^{\mathrm{%T}}:$

Discretize the transfer function

 > $\mathrm{sysTFD}≔\mathrm{ToDiscrete}\left(\mathrm{sysTF},\mathrm{Ts}\right)$
 ${\mathbf{module}}\left({}\right)\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{...}\phantom{\rule[-0.0ex]{0.5em}{0.0ex}}{\mathbf{end module}}$ (4)

Simulate and plot the response

 >
 ${{\mathrm{_rtable}}}_{{18446746075371761166}}$ (5)
 > $\mathrm{plot}\left(\left[\mathrm{seq}\left(\left[\left(i-1\right)\cdot \mathrm{Ts},\mathrm{OutputResponse}\left[i\right]\right],i=1..\mathrm{Ns}\right)\right]\right)$

 Applications