Matlab: Linearizing Simulink model and getting linearized transfer function?

谁都会走 提交于 2019-12-24 03:43:36

问题


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?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/20286758/matlab-linearizing-simulink-model-and-getting-linearized-transfer-function

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!