1

I know how to use linmod in MATLAB to linearize a Simulink model, but this requires modifying the model in order to get the linearization done. For instance, consider the model: enter image description here

In order to linearize it I would need to create a modified model like so: enter image description here

However, I want to operate on the same Simulink file wihtout creating another one. I don't want to have to store a separate Simulink model just for the linearization...

How is it possible to linearize the model in the first figure? Assume the operating u(t)=0.5 and the operating state (there is only 1 state, m_u(t)) is 0.5 as well.

space_voyager
  • 1,984
  • 3
  • 20
  • 31
  • So you want to switch between a linearized model and the normal one? Why not implement a switch then? Also you could linearize your system within you script ([**`balred` or `linmod`**](http://stackoverflow.com/q/20286758/2605073)) and load a custom transfer function to Simulink. Or a masked subsystem? You should be much clearer where the problem is, because I don't see one. – Robert Seifert Sep 22 '15 at 17:15
  • Sorry if it's not clear enough. I am already using linmod. The whole problem is to use `linmod` I must use the model in the second figure - which I must store in a separate file. I would like to store everything in one file. Could you screenshot a switch solution (a switch that I could toggle when calling linmod)? – space_voyager Sep 22 '15 at 17:17

1 Answers1

1

This cannot be done (out of the box) with basic Simulink, i.e. using linmod, dlinmod, or linmod2.

You could write some MATLAB code that would automatically take a model, make a copy of it, delete appropriate blocks, insert inport and outports, and perform a linearization. However, that would be time consuming to get right, and not something I'd seriously suggest.

The only solution is to use the add-on Simulink Control Design product, which has functionality for inserting/specifying points in the model at which you wish to linearize from/to without effecting the way that the model simulates. ("Under the hood" this most likely does something like the MATLAB script described above.)

Phil Goddard
  • 10,571
  • 1
  • 16
  • 28