({{, (RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel])[m,s]
represents the model of the transfer-function matrix m with complex variable s.}, {, (RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel])[{num,den},s]
specifies the numerator num and denominator den of a transfer-function model.}, {, (RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel])[{z,p,g},s]
specifies the zeros z, poles p, and gain g of a transfer-function model.}, {, (RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel])[sys]
gives the transfer-function model of the systems model sys.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel]) can represent scalar and multivariate systems in continuous or discrete time.

Time delays can be included in any transfer-function model, by using (RefLink[SystemsModelDelay, paclet:ref/SystemsModelDelay]).

In (RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel])[{num,den},s], num must be a matrix, and den can be specified as a matrix or just the common denominator.

(RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel]) does not cancel any pole or zero of the matrix elements.

In (RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel])[sys], the following systems can be converted:

The following options can be given:

Settings for the (RefLink[Method, paclet:ref/Method]) option include "DeterminantExpansion", "ResolventIdentities", "Inverse", and "Generic". With a setting (RefLink[Method, paclet:ref/Method])->(RefLink[Automatic, paclet:ref/Automatic]), the transfer-function model is computed using determinant expansion.

OpenersPrimaryExamplesSection(Spacer1)Examples  (61)

OpenersExampleSection0(Spacer1)Basic Examples  (4)

A single-input, single-output system:

TransferFunctionModel[{{(1/s)}},s]

A system with two inputs and one output:

TransferFunctionModel[{{(2/(1+(s^2))),(s/(s-1))}},s]

Obtain the transfer-function representation of a state-space model:

TransferFunctionModel[(StateSpaceModelFull[(Subscript[a, 11]), (Subscript[a, 12]), (Subscript[b, 11]), (Subscript[a, 21]), (Subscript[a, 22]), (Subscript[b, 21]), (Subscript[c, 11]), (Subscript[c, 12]), 0, , , ]),s]

A discrete-time transfer function with a sampling period of 1:

TransferFunctionModel[(1/((z-1)(z-0.605))),z,SamplingPeriod->1]

Evaluate a transfer function over a range of frequencies:

tfm=TransferFunctionModel[((s+0.25)/((s^2)+s+1)),s];
tfm[I Range[0.01,5,0.5]]

Plot the magnitudes:

Plot[Abs[tfm[I f]],{f,0,5}]

OpenersExampleSection1(Spacer1)Scope  (22)

A first-order continuous-time system:

TransferFunctionModel[(1/(T s+1)),s]

A second-order system:

TransferFunctionModel[((Subscript[ω, n]^2)/((s^2)+2ζ (Subscript[ω, n]) s+(Subscript[ω, n]^2))),s]

A fifth-order system:

TransferFunctionModel[k (((∑_(i=0)^2)(Subscript[b, i])(s^i))/((∑_(i=0)^5)(Subscript[a, i])(s^i))),s]

A system with three zeros and six poles:

TransferFunctionModel[k (((∏_(i=1)^3)(s+(Subscript[z, i])))/(((∏_(i=1)^2)(s+(Subscript[p, i])))(∏_(i=1)^2)((s^2)+2 (Subscript[ξ, i])(Subscript[ω, i])s+(Subscript[ω, i]^2)))),s]

A first-order discrete-time system:

TransferFunctionModel[(1/(z-1)),z,SamplingPeriod->(10^(-1))]

A second-order discrete-time system with symbolic sampling period:

TransferFunctionModel[(1/((z^2)+a z+b)),z,SamplingPeriod->T]

A two-input, one-output system:

TransferFunctionModel[{{(1/s),(1/(s+1))}},s]

SystemsModelDimensions[%]

A one-input, two-output system:

TransferFunctionModel[{{(1/s)},{(1/(s+1))}},s]

SystemsModelDimensions[%]

A two-input, two-output system:

TransferFunctionModel[{{(1/s),(1/(s+1))},{(1/(s+2)),(1/(s+3))}},s]

SystemsModelDimensions[%]

Specify a transfer function using its numerator and denominator:

TransferFunctionModel[{{{1}},{{s+1}}},s]

A MIMO transfer function specified in terms of its numerators and denominators:

TransferFunctionModel[{{{1,s},{s+2,s+4}},{{s-0.5,s+3},{s-1,s+4}}},s]

A denominator polynomial that is the least common multiple:

TransferFunctionModel[{{{3(s+1),s+6},{s+3,s+2}},(s+1)(s+2)},s]

Specifying the numerators and denominators avoids pole-zero cancellations:

TransferFunctionModel[{{{s+10}},s+10},s]

TransferFunctionModel[((s+10)/(s+10)),s]

Alternatively, use (RefLink[Unevaluated, paclet:ref/Unevaluated]):

TransferFunctionModel[Unevaluated[((s+10)/(s+10))],s]

Specify the transfer function, using its algebraic poles, zeros, and gains:

TransferFunctionModel[{{{{z}}},{{{p}}},{{g}}},s]

A multivariable system:

TransferFunctionModel[{(({{{(Subscript[z, 11])}, {(Subscript[z, 12])}}, {{(Subscript[z, 21])}, {(Subscript[z, 22])}}})),(({{{(Subscript[p, 11])}, {(Subscript[p, 12])}}, {{(Subscript[p, 21])}, {(Subscript[p, 22])}}})),(({{(Subscript[g, 11]), (Subscript[g, 12])}, {(Subscript[g, 21]), (Subscript[g, 22])}}))},s]

A constant gain of 10:

TransferFunctionModel[10]

A discrete-time gain:

TransferFunctionModel[10,SamplingPeriod->1]

A symbolic gain:

TransferFunctionModel[g]

%/.g->5

An improper transfer function:

TransferFunctionModel[{{(s + 2)^3/(s - 1)}}, s]

A continuous-time transfer function with an exponential:

TransferFunctionModel[{{{Exp[-3s](s+1)}},s^2-2s+1}, s]

An equivalent representation using (RefLink[SystemsModelDelay, paclet:ref/SystemsModelDelay]):

TransferFunctionModel[{{{SystemsModelDelay[3](s+1)}},s^2-2s+1}, s]

The transfer-function representation of a state-space model:

ssm=(StateSpaceModelFull[-3, 0, 1, 0, -2, 2, 1, 0, 0, , , ]);
TransferFunctionModel[ssm,s]

The default complex variable for continuous-time systems is \[FormalS]:

TransferFunctionModel[ssm]

For discrete-time systems, it is \[FormalZ]:

TransferFunctionModel[StateSpaceModel[{{{1}},{{1}},{{1}}},SamplingPeriod->T]]

Taylor linearize an (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel]) and obtain its transfer function representation:

TransferFunctionModel[(AffineStateSpaceModelFull[(Subscript[x, 1])+(Subscript[x, 2]^2), -(Subscript[x, 1]) (Subscript[x, 2]), 1, (Subscript[x, 1]), (Subscript[x, 1]), 0, (Subscript[x, 1]), (Subscript[x, 2]), \[Null], \[Null], {u}Automatic, ]),s]

The linearization of an (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel]) with nonzero equilibrium values:

TransferFunctionModel[(AffineStateSpaceModelFull[(Subscript[x, 1])+2 (Subscript[x, 2])+(Subscript[x, 2]^2), 1-(Subscript[x, 1])+(Subscript[x, 2])-(Subscript[x, 1]) (Subscript[x, 2]), 1, (Subscript[x, 1]), -1+(Subscript[x, 1]), 0, {(Subscript[x, 1]),1}, {(Subscript[x, 2]),-1}, \[Null], \[Null], {u}Automatic, ]),s]

Taylor linearize a (RefLink[NonlinearStateSpaceModel, paclet:ref/NonlinearStateSpaceModel]):

TransferFunctionModel[(NonlinearStateSpaceModelFull[-1+u x, -1+x, {x,1}, \[Null], \[Null], {{u,1}}Automatic, ]),s]

OpenersExampleSection2(Spacer1)Generalizations & Extensions  (2)

SISO systems can also be specified as a single-element list:

TransferFunctionModel[{(1/s)},s]

Or just as a rational function:

TransferFunctionModel[(1/s),s]

A single-output system can be given as a list:

TransferFunctionModel[{(1/(2 s+1)),(3/(4 s+1))},s]

OpenersExampleSection3(Spacer1)Options  (4)

OpenersExampleSubsection0(Spacer1)SamplingPeriod  (3)

Specify a continuous-time system:

TransferFunctionModel[(1/((s^2)+a s+b)),s]

TransferFunctionModel[(1/((s^2)+a s+b)),s,SamplingPeriod->None]

A discrete-time system with sampling period 1:

TransferFunctionModel[(z/(z-1)),z,SamplingPeriod->1]

A system with a symbolic sampling period:

TransferFunctionModel[(1/((s^2)+a s+ b)),s,SamplingPeriod->T]

Set the sampling period to a numeric value:

%/.T->2

OpenersExampleSubsection1(Spacer1)SystemsModelLabels  (1)

Label the input and output variables:

TransferFunctionModel[{{(s/((s^2)+2)),(1/s),(1/((s^2)+2))},{(1/s),((s+1)/s),(1/((s^2)+2))}},s,SystemsModelLabels->{{"(Subscript[u, 1])","(Subscript[u, 2])","(Subscript[u, 3])"},{"(Subscript[y, 1])","(Subscript[y, 2])"}}]

OpenersExampleSection4(Spacer1)Applications  (18)

A proportional-integral (PI) controller:

TransferFunctionModel[(Subscript[k, p])+((Subscript[k, i])/( s)),s]

A proportional-derivative (PD) controller:

TransferFunctionModel[(Subscript[k, p])+(Subscript[k, d]) s,s]

A function to construct a proportional-integral-derivative (PID) controller:

pid[kp_,ki_,kd_]:= TransferFunctionModel[kp+(ki/( s))+kd s,s]

A PID with specific gain values:

pid[1,2.5,0.5]

A function to construct a discrete-time PID controller:

dpid[kp_,ki_,kd_,τ_]:= TransferFunctionModel[kp+ki((τ z)/(z-1))+kd ((z-1)/(τ z)),z,SamplingPeriod->τ]

dpid[260,130,5,0.1]

A function for a continuous-time lead compensator:

lead[k_,T_/;T>0,α_/;0<α<1]:=TransferFunctionModel[k((s+(1/T))/( s+(1/(α T)))),s]

A lead compensator for specific values of gain and pole-zero locations:

lead[200,0.02,0.5]

A function for a continuous-time lag compensator:

lag[k_,T_/;T>0,α_/;α>1]:=TransferFunctionModel[k((s+(1/T))/( s+(1/(α T)))),s]

A specific lag compensator:

lag[1000,0.08,2]

A digital lag compensator defined in terms of its zero and pole locations:

dlag[zero_,pole_,τ_]/;zero<pole<1:=TransferFunctionModel[(((1-pole)(z-zero))/( (1-zero)(z-pole))),z,SamplingPeriod->τ];

dlag[0.2,0.5,0.01]

A general formula for analog lowpass Butterworth filters:

butterworth[ω_,n_?OddQ]:=TransferFunctionModel[(ω/(s+ω))(∏_(i=1)^((n-1)/2))((ω^2)/((s^2)+2Cos[((π i)/n)]ω s+(ω^2))),s]
butterworth[ω_,n_]:=TransferFunctionModel[(∏_(i=1)^(n/2))((ω^2)/((s^2)+2Cos[((π (i-1/2))/n)]ω s+(ω^2))),s]

Filters of specific orders:

butterworth[(Subscript[ω, N]),3]

butterworth[(Subscript[ω, N]),4]//N

A third-order Bessel filter:

TransferFunctionModel[(15/( (s^3)+6(s^2)+15 s+15)),s]

The general second-order transfer function:

order2[ζ_,ω_]:=TransferFunctionModel[ ((ω^2)/((s^2)+2ζ ω s+(ω^2))),s];

Variations in damping ratio lead to qualitatively different responses:

Table[{Last[damping],sys=order2[First[damping],6],Plot[OutputResponse[sys,UnitStep[t],t]//Evaluate,{t,0,8},PlotRange->All]},{damping,{{0,"Undamped"},{0.7,"Underdamped"},{1,"Critically damped"},{5,"Overdamped"}}}]//TableForm

A linearized inverted pendulum model:

invpend[M_,m_,l_,g_]:= TransferFunctionModel[{{{-(s^2)},{ l (s^2)-g},{-(s^3)},{l (s^3)-g s}},M l (s^4)-g(M+m)(s^2)},s,SystemsModelLabels->{"u",{"θ","x","θ'","x'"}}]

invpend[5,3.75,1.5,9.8]

A spring-mass-damper system:

smd[k_,m_,b_]:=TransferFunctionModel[ (1/(m (s^2)+ b s +k)),s];

smd[0.1,0.5,0.2]

Transfer function between the input voltage and the shaft angular position of a DC motor:

dcmotor[Kt_,Kf_,J_,B_,L_,R_]:=TransferFunctionModel[ (Kt/((J (s^2)+B s)(L s+R)+Kt Kf s)),s];

dcmotor[0.02,0.02,0.015,0.1,0.5,1.3]

The aileron-to-roll-rate transfer function of an aircraft:

TransferFunctionModel[((-5.9(s-0.05)((s^2)+0.46s+1.1978))/((s+0.067)(s+0.7)((s^2)+0.8054s+4.21031))),s]

A temperature-controlled chemical reactor:

TransferFunctionModel[((Subscript[k, p])/(1+(Subscript[τ, p]) s)),s]

An RLC circuit:

rlc[r_,l_,c_]:=TransferFunctionModel[(r/(r+s l+(1/(s c)))),s];

rlc[100,(10^(-4)),(10^(-6))]

A MIMO transfer function describing an aircraft's longitudinal dynamics:

TransferFunctionModel[{{((-0.0005(s-70)(s+0.5))/(((s^2)+0.0065s+0.006)((s^2)+s+1.4)))},{((-0.02(s+80)((s^2)+0.0065s+0.006))/(((s^2)+0.005s+0.006)((s^2)+s+1.4)))},{((-1.4(s+0.02)(s+0.4))/(((s^2)+0.005s+0.006)((s^2)+s+1.4)))}},s]

A ball mill grinding system with delay due to material transport:

TransferFunctionModel[{{{-0.425/E^(1.52*s), 0.1052*(1 + 47.1*s)}, 
    {2.977, 1.063/E^(2.26*s)}}, {{1 + 11.7*s, 1 + 11.5*s}, {1 + 5.5*s, 1 + 2.5*s}}}, s, 
  SystemsModelLabels -> {{"FreshFeed", "SumpWater"}, {"Product", "Throughput"}}]

OpenersExampleSection5(Spacer1)Properties & Relations  (8)

(RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel]) behaves as a pure function of one argument:

sys=TransferFunctionModel[{{(2/(1+(s^2))),(s/(s-1))}},s]

sys[x]

The value of the transfer-function matrix at a specific frequency:

sys[10. I]

The values at several frequencies:

sys[Range[3,7]I]

Use (RefLink[TransferFunctionFactor, paclet:ref/TransferFunctionFactor]) to obtain the factored form:

TransferFunctionFactor[TransferFunctionModel[(1/s)+(1/(s-1)),s]]

Obtain the expanded form:

TransferFunctionExpand[TransferFunctionModel[(1/s)+(1/(s-1)),s]]

Use (RefLink[TransferFunctionCancel, paclet:ref/TransferFunctionCancel]) to cancel any common poles and zeros:

TransferFunctionModel[{{{1,s},{s+1,s(s+2)}},s(s+1)},s]

TransferFunctionCancel[%]

Collect terms with similar powers:

{tfm=TransferFunctionModel[(((s^2)+a (s^2)+s+2)/((s^4)+b (s^3)+(s^3)+2(s^2)+s+3+c s)),s],Collect[tfm,s]}

Collect terms in any variable:

{tfm=TransferFunctionModel[((s α+s+4α)/((s^3)+α (s^2)+α s+1)),s],Collect [tfm,α]}

Find the element zeros and poles of a transfer-function matrix:

tfm= TransferFunctionModel[{{(s/(1+(s^2))),((s+3)/(s-1)),(1/(s+1))},{((s-3)/(s+2)),((s+1)/(s+2)),((s+4)/(1+ (s^2)))}},s];

TransferFunctionPoles[tfm]

TransferFunctionZeros[tfm]

Obtain a state-space form of a transfer-function model:

StateSpaceModel[ TransferFunctionModel[{{((10(s-2))/(((s^2)+2 s+1.25) ((s^2)+6 s+25)))}},s]]

OpenersExampleSection6(Spacer1)Possible Issues  (3)

In (RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel])[m,var], pole-zero pairs may cancel before being processed:

(((s+2)(s+3))/((s+2)(s+4)))

TransferFunctionModel[(((s+2)(s+3))/((s+2)(s+4))),s]

Use (RefLink[Unevaluated, paclet:ref/Unevaluated]) to prevent cancellations:

TransferFunctionModel[Unevaluated[(((s+2)(s+3))/((s+2)(s+4)))],s]

Or use (RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel])[{num,den},var]:

TransferFunctionModel[{{{(s+2)(s+3)}},(s+2)(s+4)},s]

Or (RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel])[{z,p,g},var]:

TransferFunctionModel[{{{{-3, -2}}}, {-4, -2}, {{1}}}, s]

(RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel])[m,var] might result in a system with higher order:

m=(1/((s+1)))-(1/(((s+1))^2));
TransferFunctionModel[m,s]

Simplify the system:

TransferFunctionModel[%,s]//Simplify

Or simplify m before passing it to (RefLink[TransferFunctionModel, paclet:ref/TransferFunctionModel]):

Together[m]

TransferFunctionModel[%,s]

If the complex variable var is not specified, it is assumed to be \[FormalS] for continuous-time systems:

TransferFunctionModel[(s/(10s+1))]

%[var]

Specify the transfer function using \[FormalS]:

TransferFunctionModel[(\[FormalS]/(10\[FormalS]+1))][var]

For discrete-time systems, use \[FormalZ]:

TransferFunctionModel[(1/(\[FormalZ]+0.4)),SamplingPeriod->τ][var]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[StateSpaceModel, paclet:ref/StateSpaceModel])  ▪  (RefLink[TransferFunctionZeros, paclet:ref/TransferFunctionZeros])  ▪  (RefLink[TransferFunctionPoles, paclet:ref/TransferFunctionPoles])  ▪  (RefLink[ToContinuousTimeModel, paclet:ref/ToContinuousTimeModel])  ▪  (RefLink[ToDiscreteTimeModel, paclet:ref/ToDiscreteTimeModel])  ▪  (RefLink[Function, paclet:ref/Function])  ▪  (RefLink[AffineStateSpaceModel, paclet:ref/AffineStateSpaceModel])  ▪  (RefLink[NonlinearStateSpaceModel, paclet:ref/NonlinearStateSpaceModel])  ▪  (RefLink[CreateSystemModel, paclet:ref/CreateSystemModel])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Fourier Analysis, paclet:guide/FourierAnalysis])}, {▪(RefLinkPlain[Basic Systems Modeling, paclet:guide/Modeling])}, {▪(RefLinkPlain[Control Systems, paclet:guide/ControlSystems])}, {▪(RefLinkPlain[Delay Control Systems, paclet:guide/DelayControlSystems])}, {▪(RefLinkPlain[Descriptor Control Systems, paclet:guide/DescriptorControlSystems])}, {▪(RefLinkPlain[Signal Processing, paclet:guide/SignalProcessing])}, {▪(RefLinkPlain[Systems Modeling, paclet:guide/SystemsModeling])}, {▪(RefLinkPlain[Time Series Processes, paclet:guide/TimeSeriesProcesses])}, {▪(RefLinkPlain[System Model Analytics & Design, paclet:guide/SystemModelAnalyticsDesign])}})}})