Transfer Functions
Back to Portal
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
restart:withDynamicSystems:
tf≔sa⋅s2+b⋅s+c:
Define a transfer function object
sysTF≔TransferFunctiontf,parameters=a=1,b=1,c=1
module...end module
Generate a Phase Plot
PhasePlotsysTF,parameters=a=3,b=4,c=5
Convert Transfer Function to a Differential Equation
sysDE≔DiffEquationtf
sysDE:-de
ⅆⅆtx1⁡t=−a⁢x2⁡tb,ⅆⅆtx2⁡t=c⁢b⁢x1⁡ta2−b⁢x2⁡ta−b⁢u1⁡ta,y1⁡t=−x2⁡tb
Discretization and Time-Domain Response to an Input Signal
Sampling time and number of samples
Ts≔0.025:Ns≔1000:
Generate the input signal
NoisyInput≔Chirp1,0.02,0.01,hertz=true,discrete=true,samplecount=Ns,sampletime=Ts+Statistics:-SampleNormal0,0.05,Ns%T:
Discretize the transfer function
sysTFD≔ToDiscretesysTF,Ts
Simulate and plot the response
OutputResponse≔SimulatesysTFD, NoisyInput, parameters=a=1,b=1,c=1
plotseqi−1⋅Ts,OutputResponsei,i=1..Ns
Applications
Amplifier Gain
Bandpass Filter Design
Inverted Pendulum
Download Help Document