Linearize and Transfer Function

9 views (last 30 days)
Daniel Pérez Gutiérrez
Daniel Pérez Gutiérrez on 30 Mar 2023
Edited: Paul on 3 Apr 2023
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!

Answers (1)

Paul
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
Daniel Pérez Gutiérrez
Daniel Pérez Gutiérrez on 3 Apr 2023
Yes It does, and I'm getting this matrix D of 7 rows and 13 columns:, that I believe it is because of the inputs and outputs of the Matlab Function Block.
With that, how can I get its transfer function?
The Matlab Function has the differential equations of a non-linear model of a yeast bioreactor.
Paul
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);

Sign in to comment.

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!