StateSelection

State Selection

    StateSelection

Library

Modelica/Mechanics/Rotational/UsersGuide

Description

Only a few components of the Rotational library use the der(..) operatorand are therefore candidates to have states. Most important, component Inertiadefines the absolute rotation angle and the absolute angular velocity of thiscomponent as candidate for states. In the "Advanced" menu the built-in StateSelectenumeration can be set to define the priority to use these variables as states.Without further action, in most cases a tool will select these variables as states.

For positioning drive trains where the goal is to position a load (e.g. the drivetrain of a robot, or of an elevator), the absolute angles of the components are bounded,and the issue discussed below is not present.

For drive trains where the goal is to control the velocity of a load (e.g. the drivetrain of a vehicle or the crank angle of an engine),the absolute angles of the components are quickly increasingduring operation. This is critical, because then the step size control of timeintegrators might then no longer work appropriately:

Integrators with step size control adjust their time step size automaticallyto meet user defined error bounds ("tolerances").Typically the local error estimate EST_i is compared with a mixed bound for absolute and relative errors.

   EST_i ≤ abstol_i + reltol_i*|x_i|

Here, abstol_i and reltol_i denote the bounds for the absolute and relative error of state variable x_i, respectively. This mixed error bound is used since it is more robust than a pure relative error based error bound if the nominal value x_i is (very) close to 0.In a Modelica simulation model, typically the same relative tolerance reltol is used for allstates and the absolute tolerances are computed using the relative tolerance and thenominal values of the states:

   reltol_i = reltol   abstol_i = reltol*x_i(nominal)*0.01

This error control fails if the state variable x_i grows without bounds (such as for adrive train or the crank angle of a vehicle), since then the allowed erroralso grows without bounds. The effect is that the error control on this variable is practicallyswitched off. The correct way to handle this would be to set reltol_i = 0 on such a statevariable and only use an absolute tolerance for the step size control.

Currently, in Modelica there is no possibility to provide this information.In order to reduce this effect, it is advisable to not use absolute angles, butrelative angles as states. A user can define relative variables as statesexplicitly with componentRelativeStates.Furthermore, all compliant components, such asSpringDamper aredefining the relative angle and the relative angular velocity as preferred states.Therefore, a tool will select in most cases relative angles as states.

The relative angles of compliant components are usually small. For example, thedeformation of a typical elastic component is in the order of 1e-4 rad.Without further action, the error control would not work properly on variablesthat are so small (so often switching the error control off). The remedy is to defineexplicitly a nominal value on the relative angle. This definition is provided in the"Advanced" menu of the compliant components with parameter "phi_nominal".The default value is 1e-4 rad, to be in the order of a compliant deformation of adrive. For some components, likea Clutchthis might be too small and a value of phi_nominal=1 might be more appropriate(a value of phi_nominal = 1e-4 does not hurt, but just makes the error controlunnecessarily stringent).