简体   繁体   中英

Matlab: Linearizing Simulink model and getting linearized transfer function?

I want to determine the linearized transfer function from a non-linear system made in Simulink. I can see that it should be possible to use the linmod function in Matlab but when I try this

[num,den]=linmod('sys')

I'm not getting the numerator and denominator but instead the state space matrix etc. Can anyone help?

Try the function balred instead: documentation

rsys = balred(sys,ORDERS) computes a reduced-order approximation rsys of the LTI model sys . The desired order (number of states) for rsys is specified by ORDERS. You can try multiple orders at once by setting ORDERS to a vector of integers, in which case rsys is a vector of reduced-order models. balred uses implicit balancing techniques to compute the reduced- order approximation rsys .

example:

Q = tf([1 2 3 4 5],[5 4 3 2 1])

Q =

   s^4 + 2 s^3 + 3 s^2 + 4 s + 5
  -------------------------------
  5 s^4 + 4 s^3 + 3 s^2 + 2 s + 1

Q_lin = balred(Q,2)

Q_lin =

  3.276 s^2 - 2.06 s + 2.394
  --------------------------
   s^2 - 0.2757 s + 0.4789

balred(Q,1)

is not working for my example, as there are 2 unstable poles, but it may works for your system.

linmod always returns a state-space representation (see documentation). Use tf to convert your stae-space representation to a transfer function:

Conversion to Transfer Function

tfsys = tf(sys) converts the dynamic system model sys to transfer function form. The output tfsys is a tf model object representing sys expressed as a transfer function.

BTW, if you have Simulink Control Design, a better alternative to linmod is linearize .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM