问题
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 approximationrsys
of the LTI modelsys
. The desired order (number of states) forrsys
is specified by ORDERS. You can try multiple orders at once by setting ORDERS to a vector of integers, in which casersys
is a vector of reduced-order models. balred uses implicit balancing techniques to compute the reduced- order approximationrsys
.
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 modelsys
to transfer function form. The outputtfsys
is atf
model object representingsys
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