Search code examples
modelicadymola

Changing the parameter of the controlling system would cause the system stiff?


I got a model working fine with the following controlling system parameters,

Non-stiff system

but if I change one of the parameters, the system would be stiff and no chance to solve it at all. So my question is:

  1. Why changing just one parameter would cause the system stiff?
  2. If I meet the stiff problem again, how could I locate the exact parameter that causes the problem?

Stiff system


Solution

  • DASSL is an implicit solver and should therefore be able to deal with stiff systems pretty well. Still it seems there are many >500 steps it has to do within <2s, as this is your output interval (which causes the message). In your case this could relate to fast dynamics that happen within the model.

    Regarding your questions:

    1. If the model simulates to the end, check the controlled variables and see if the have fast oscillations (Frequency of > 100Hz) occur. This can happen when increasing the proportional gain of the controller, which is making the overall system "less stable".
    2. A general advice on this is pretty difficult, but the linearSystems2 library can help. Creating a "Full Linear Analysis" gives a list of states and how they correlate to poles. The poles with highest frequency are usually responsible for the stiffness and from seeing which states relate to poles of interest, indicates which states to investigate. The way from the state to the parameter is up to the modeler - at least I don't know a general advice on this.

    For 2. applied to Modelica.Blocks.Examples.PID_Controller the result looks like: Full Linear Analysis of Modelica.Blocks.Examples.PID_Controller Seeing that likely the spring causes the fastest states in the system.