Closed mwetter closed 3 years ago
Based on the coordination call,
parameter Integer order(min=1) = 2 "Order of filter"
annotation(Dialog(tab="Dynamics", group="Filtered opening",enable=use_inputFilter));
should be set to a constant as for special applications, some users set it to 1 to avoid fast states.
Using the model Modelica.Blocks.Continuous.CriticalDamping
leads in some models to larger system of nonlinear equations with Dymola 2022. The tests were done in the Buildings library, branch IBPSASync_issue1498_actuatorFilter
.
On a small (edited) model based on Buildings.Examples.Tutorial.CDL.System1
, it was found that this is likely due to the symbolic manipulations (maybe the tearing?). The model is shown below:
The model CriticalDamping
implements
der(x[1]) = (u - x[1])*w;
for i in 2:n loop
der(x[i]) = (x[i - 1] - x[i])*w;
end for;
y = x[n];
The translation leads to
Sizes after manipulation of the nonlinear systems: {7}
Number of numerical Jacobians: 0
Initialization problem
Sizes of nonlinear systems of equations: {1, 17, 1, 1}
Sizes after manipulation of the nonlinear systems: {0, 6, 0, 0}
Number of numerical Jacobians: 0
If the above filter is changed to
y = 1.001*x[n]; // setting y = 1*x[n]; won't make any change to the translation statistics, the translator seems to eliminate 1
then the translation statistics is
Sizes after manipulation of the nonlinear systems: {5}
Number of numerical Jacobians: 0
Initialization problem
Sizes of nonlinear systems of equations: {1, 17, 1, 1, 1}
Sizes after manipulation of the nonlinear systems: {0, 5, 0, 0, 0}
Number of numerical Jacobians: 0
This statistics is equal to this model if the existing filter implementation is used. Therefore, it seems like to keep the statistics, a coordinate transformation is needed to "trick" the symbolic processing into keeping the old translation statistics.
@mwetter I could not replicate this behaviour in Dymola 2020. Or I did something wrong.
In any case, these changed statistics are for the initialisation problem only. I wouldn't worry too much about those?
The filter that is used for actuators triggers many warnings with OCT. These are of the form
Also, MSL has an implementation of
Modelica.Blocks.Continuous.CriticalDamping
that could be used instead of the more complex filterModelica.Blocks.Continuous.Filter
, which is currently configured withThis issue is to update the models to use the simpler implementation of the filter and remove the warnings.
This revision also removes the parameter
and sets the order to two as I don't think anyone ever uses another value. If another value should be used for a special application, then this can be done outside of the actuator model.