Linearize and Transfer Function
9 views (last 30 days)
Show older comments
Hi! I want to Linearize a Matlab Function in Simulink and then get its transfer function to control the process.
How can I do that? This is the Simulink model: (The Matlab Function has 13 inputs and 7 outputs)
Thanks in advance!
0 Comments
Answers (1)
Paul
on 3 Apr 2023
Does linearize do what you need? It can be used to linearize a model or a specific block in a model. Not sure how well it works on models that contain Matlab Function blocks or on that type of block itself. Might depend on what's actually going on inside the Matlab Function block.
2 Comments
Paul
on 3 Apr 2023
Edited: Paul
on 3 Apr 2023
From the looks of the model, it seems like the block is actually computing the right-hand side of a vector difference equation of the form
x(k+1) = f(x(k),w(k))
and the vector input to the Matlab Function is
u = [w(k);x(k)]
with vector w being the first six inputs of u
If that's the case, then the output of linearize just for that block would be an ss object, call it sys, with sys.A = sys.B = sys.C = 0, and sys.D is the Jacobian of f evaluated at the linearization point. In this case the linearized model would be
x(k+1) = sys.D(:,1:6)*u(k) + sys.D(:,7:13)*x(k).
Therefore, in Matlab an LTI system of that model could be created as
Psys = ss(sys.D(:,7:13),sys.D(:,1:6),eye(7),0,Ts);
Psys assumes that the outputs of the model are x(k). However, the signals going in to Graficas are x(k+1). If x(k+1) is really the desired output, then I think we'd have
Psys = ss(sys.D(:,7:13),sys.D(:,1:6),sys.D(:,7:13),sys.D(:,1:6),Ts);
See Also
Categories
Find more on Classical Control Design in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!