Skip to content

Commit

Permalink
Simplify computation of f_d
Browse files Browse the repository at this point in the history
  • Loading branch information
tobolar committed Sep 29, 2023
1 parent c207127 commit 22800e5
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions Modelica/Mechanics/Translational/Components/ElastoGap.mo
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ equation
ratio = (s_rel - s_rel0)/s_ref;
f_c = smooth(1, noEvent(if contact then -f_ref*abs(ratio)^n else 0));
f_d2 = if contact then d*v_rel else 0;
f_d = smooth(0, noEvent(if contact then (if f_d2 < f_c then f_c else if
f_d2 > -f_c then -f_c else f_d2) else 0));
f_d = smooth(0, noEvent(if contact then min(max(f_d2, f_c), -f_c) else 0));
f = f_c + f_d;
lossPower = f_d*v_rel;
annotation (
Expand Down

0 comments on commit 22800e5

Please sign in to comment.