Skip to content

Commit

Permalink
Add SI units to parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
christiankral committed Jul 4, 2022
1 parent a4ea7f2 commit 8c6ba79
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Modelica/Mechanics/Rotational/Components/FreeWheel.mo
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ model FreeWheel "Ideal freewheel"
SI.Torque tau "Torque between flanges (= flange_a.tau)";
Boolean free( start=false) "Indicates freewheeling";
Real s(start=0) "Auxilliary variable";
parameter Real tauRes=1e-5 "Residual friction coefficient";
parameter Real wRes=1e-5 "Residual relative speed coefficient";
parameter SI.Torque tauRes=1e-5 "Residual friction coefficient";
parameter SI.AngularVelocity wRes=1e-5 "Residual relative speed coefficient";
protected
constant SI.AngularVelocity unit_w=1;
constant SI.Torque unit_tau=1;
Expand All @@ -15,8 +15,8 @@ equation
tau = flange_a.tau;
tau = -flange_b.tau;
free = w_rel <= 0;
w_rel = s*unit_w*(if free then 1 else tauRes);
tau = s*unit_tau*(if free then wRes else 1);
w_rel = s*unit_w*(if free then 1 else tauRes/unit_tau);
tau = s*unit_tau*(if free then wRes/unit_w else 1);
annotation ( Icon(graphics={
Rectangle( lineColor={64,64,64},
fillColor={192,192,192},
Expand Down

1 comment on commit 8c6ba79

@AHaumer
Copy link
Contributor

@AHaumer AHaumer commented on 8c6ba79 Jul 4, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me - thanks a lot!

Please sign in to comment.