How can I linearise an enabled subsystem in Simulink?

4 visualizaciones (últimos 30 días)
Daniel
Daniel el 25 de Nov. de 2022
Respondida: SANKALP DEV el 1 de Sept. de 2023
Hi, I'm at the moment trying to linearize a time variant model in Simulink. The model has 3 enabled subsystems in it to describe a periodic process. Some of my state variables appear in all of these enabled subsystems, while others are only calculated in one of them.
Now I try to linearise the three model configurations using the linearize command. Basically I try to get the three state-space models in a way like this:
time1 = 200;
time2 = 300;
time3 = 400;
op = findop(mdl,[time1, time2, time3]);
linsys = linearize(mdl,op)
However, when I execute this the execution stops and throws the error:
Invalid Simulink object handle.
I guess this is caused by the order in that the submodels are linearised. One of the enabled subsystems, which isn't active at the time, is attempted to be linearised before an active one.
When I change the first time, so that the first enabled subsystem in line is active at the snapshot, the linerization command is completing, but now the state space model is missing all state variables, beginning with the first one present in one of these enabled subsystems. It's like MATLAB still ends the linearization when enteriang one of the subsystems.
So can anybody help me here? What am I doing wrong? Should I exclude the state variables not present in a snapshot from the linearisation? And why is the command
findopmdl,[time1, time2, time3]);
finding the state variables not active in a snapshot anyway? Shouldn't the snapshots each have different state vaiables?

Respuestas (1)

SANKALP DEV
SANKALP DEV el 1 de Sept. de 2023
Hello Daniel,
I understand that you are trying to linearize a time-variant model in Simulink which consists of three enabled subsystems that describe a periodic process, and you would like to implement three state-space models corresponding to different time snapshots.
Your assumption about the error, “Invalid Simulink object handle”, is probably right. While linearizing a model with multiple enable subsystems, the order of linearization does affect the results. It is important to ensure that the active subsystems are linearized first to capture the dynamics correctly. So, I would recommend you modify the order of enabled subsystems in your model to match the time points you want to linearize, hence ensuring that the active subsystems are linearized first.
Secondly, the ‘findop’ command in Simulink finds an operating point for the model at specified time points. It considers all state variables present in the model, regardless of whether they are active or not in a particular subsystem. This is why you may see state variables not active in a snapshot being included.
To exclude inactive state variables, I suggest you modify the ‘findop’ command by following the below code: -
op = findop(mdl, [time1, time2, time3], 'ActiveStateVariables', {'stateVar1', 'stateVar2'});
Where ‘stateVar1’ and ‘stateVar2’ are the names of the active state variables in the respective subsystems at each time point.
If you continue to encounter errors or need further assistance, please provide additional details about your model and the specific commands you are using.
I hope this helps.

Categorías

Más información sobre Subsystems en Help Center y File Exchange.

Productos


Versión

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by