I have a model written with the MultiBody Modelica Library, and I’m trying to symbolically calculate a linear approximation in Mathematica using SystemModelLinearize, however, the procedure freezes at the stage of “Preparing variables”:
I wonder if it’s possible to simplify the model such that the symbolic linearization can proceed.
I assume it could be challenging to identify the exact the problem, but I have a suspect model. Changes in this model led to the freezing of the linerization procedure. Here is a screenshot of the FlexureLowerEnergy model:
The aim of some components is to set a boundary condition. The frame frame_b of fixedTranslation3 must remain parallel to the ground frame, i.e., it can translate in Z and Y but not rotate. At the outside, frame frame_a is connected to the bottom of a pendulum (blue and pink in the figure below) that oscillates, and frame_b is connected to a Body object:
The boundary condition is set by the prismatic constraintprismatic1 and the revolute planar loop constraintrevolute. Thus, the component fixedTranslation3 remains vertical as the pendulum oscillates. The boundary condition holds without the spring, but the spring is necessary to calculate potential energy and other relevant physical quantities.
I suspect the symbolic linearization procedure is not able to cope with the prismatic constraint. Is there a more suitable way to set this boundary condition?
Please note that the method suggested in this post does not work for symbolic linearization because it uses an angular position source which uses a numerical low pass-filter. Even when the linearization is numerical, this low pass filter produces problems in transfer functions at high frequencies.
I attach the System Modeler file with the model and a Mathematica file. I’m using System Modeler 13.2.0 and Mathematica 13.2.
With some experimentation I believe the constraint is not the issue, but simply the size of the model is too large for the current symbolic linearization. To check this I tried to linearize the SuspensionBeamEnergy model but with two changes:
setting world.enableAnimation to false in order to reduce the number of variables
replacing both flexureLower1 and flexureUpper1 with just direct connections between the frames they connect to
with the components above removed, I also replaced the equation for energyPE with
energyPE = 0;
in order to keep the system balanced.
The symbolic linearization made it a little farther beyond but unfortunately still failed.
The process stays in "Preparing Variables" forever.
The model seems relatively simple, is it feasible that it is still too large for the symbolic linearization procedure? Is it possible that there’s a particular component creating the problem instead?
It seems relevant to add that when "InitialValues" is chosen as the operating point, the linearization produces an error and fails:
According to this, there’s an equation without variables to solve for. See the attached model and notebook for details. This error is also produced for numerical linearization:
Numerical linearization with "EquilibriumValues" is successful.
It’s important to point out that the setup is such that the initial values are the same as the equilibrium values. The pendulum remains still at the equilibrium position at all times. The initial conditions are set in component revolute1.
Any help will be appreciated. Thank you very much in advance.