Kronecker Decomposition
TransferFunctionModel supports improper transfer functions. When converted to the time domain, an improper transfer function creates a descriptor StateSpaceModel. The proper and polynomial parts of the transfer function can be decoupled in the state-space model with KroneckerModelDecomposition.
{poly, proper} = {Subscript[a, 2]s ^ 2 + Subscript[a, 1]s + Subscript[a, 0], (k(s - Subscript[z, 1])/(Subscript[τ, 1 ]s + 1)(Subscript[τ, 2 ]s + 1))};tfm = TransferFunctionModel[poly + proper, s];ssm = Simplify@Last@KroneckerModelDecomposition[StateSpaceModel[tfm]]The descriptor matrix is block diagonal with an identity matrix for the states of the proper subsystem and a nilpotent matrix for the states of the polynomial subsystem:
Simplify@TransferFunctionModel[SystemsModelExtract[ssm, All, All, 1 ;; 2], s]TransferFunctionModel[SystemsModelExtract[ssm, All, All, 3 ;; 5], s]params = {k -> 1.5, Subscript[τ, 1] -> 1 / 10, Subscript[τ, 2] -> 1 / 4, Subscript[z, 1] -> 1, Subscript[a, 2] -> 1, Subscript[a, 1] -> 1, Subscript[a, 0] -> 2};polyresponse = OutputResponse[TransferFunctionModel[poly, s], Sin[t], t];
properresponse = OutputResponse[TransferFunctionModel[proper, s], Sin[t], t];
totalresponse = OutputResponse[ssm, Sin[t], t];Simplify[polyresponse + properresponse - totalresponse]Plot[Evaluate[{polyresponse, properresponse, totalresponse} /. params], {t, 0, 20}, PlotLegends -> {"poly", "proper", "total"}]