Skip to content

Unit issue in Modelica.Mechanics.Translational.Components.ElastoGap #4197

@HansOlsson

Description

@HansOlsson

The commit 0315615 changed ElastoGap to be unit-unsafe. In particular the previous s_ref parameter was removed, and the non-linear exponent n=0 was replaced with the general exponent n=1 (roughly it replaced (s_rel-s_rel0)*abs((s_rel-s_rel0)/s_ref)^n by (s_rel-s_rel0)^n).

The solution seems to be to restore s_ref (e.g., parameter SI.Position s_ref=1 annotation(enable=n>1 or n<1);) and replace c*abs(s_rel - s_rel0)^n by c*abs((s_rel - s_rel0)/s_ref)^n*s_ref. The extra factor s_ref ensures that c keeps its previous unit (and especially doesn't have a unit depending on the real parameter n).

My assumption is that if someone is investigating non-linear elasto gaps the additional freedom of setting s_ref is actually helpful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions