Search code examples
modelicaderivative

Modelica smoothOrder of cubic polynomial


After reading the resources linked below, I have a question about Modelica annotation smoothOrder.

For a cubic polynomial the derivatives are:

  1. derivative: quadratic function
  2. derivative: linear function
  3. derivative: constant value
  4. derivative and higher: zero

What is the number to put into the annotation smoothOrder in this case? Is it 3, or 4, or is it 99? There are no discontinuities.


Solution

  • If it is a pure polynomial (not something like a piece-wise polynomial), the smoothOrder is actually infinite. The reason is - as you state in the question - that after some higher-order derivative all further derivatives will be zero. Therefore it does not get discontinuous.

    As a result, the smoothOrder can be set to any high value. To finde a good value, lets consider the usage of the annotation: smoothOrder is used to determine how often a variable/equation can be differentiated. Differentiation of equations can be necessary due to the index reduction. How often a model needs to be differentiated is determined by the model's index (for which there are slightly different definitions). Generally the index describes, how often an equation needs to be differentiated to result in solvable equations. The index is usually not higher than three, for electrical applications it is usually not higher than one. Therefore, often 99 is often chosen as the index will not get higher than this...