I work a lot with transfer functions (Laplace transform) and I often need to convert them into different forms:

  • rational transfer functions
  • pole/zero representation
  • pole/zero/gain representation
  • partial franction (for easy inverse Laplace transform)

Usually I create my transfer functions via Solve and my result is:

sols = Solve[{(vi - vx)/R - s*Cin*vx - s*C*(vx - vo) == 0, s*C*(vx - vo) - gm*vx - gm/a0*vo == 0}, {vo, vx}]
H = (vo /. sols[[1]])/vi
-((a0 (gm - C s))/(gm + a0 C s + C gm R s + a0 C gm R s + Cin gm R s + a0 C Cin R s^2))

First of all, I wonder how to properly bring this into the first form (collecting the coefficients on the nominator/denominator). Is there a better way than doing

H = Collect[Numerator[H], s]/Collect[Denominator[H], s]
(-a0 gm + a0 C s)/(gm + (a0 C + C gm R + a0 C gm R + Cin gm R) s + a0 C Cin R s^2)

Furthermore, how can I get a representation with the first coefficients being 1 (rather than "a0 gm" and "gm" in the above example?)

Particularly I am struggling with the partial fraction form. If I just use Apart, nothing happens:

Apart[H, s]
(-a0 gm + a0 C s)/(gm + a0 C s + C gm R s + a0 C gm R s + Cin gm R s + a0 C Cin R s^2)

Finally, for the two remaining forms, is there a better way than to manually obtaining the roots via Roots[Denominator[H] == 0, s] and multiplying the "one minus the solutions" together?

If possible, I would like to stick with ordinary symbolic equations, rather than using TransferFunction*...


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.