Skip to content

Commit

Permalink
Avoid chattering in Modelica.Fluid.Examples.TraceSubstances.RoomCO2Wi…
Browse files Browse the repository at this point in the history
…thControls
  • Loading branch information
HansOlsson committed Jan 21, 2025
1 parent ff95fea commit caf3eb7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Modelica/Fluid/Utilities.mo
Original file line number Diff line number Diff line change
Expand Up @@ -700,7 +700,7 @@ for a smooth transition from y1 to y2.
eta_tilde := rho*eta;
xi1 := x0 + mu_tilde;
xi2 := x1 - eta_tilde;
if xi1 < x0 or xi2>x1 then
if xi1 < x0 or xi2>x1 or abs(xi1-xi2) < 100*Modelica.Constants.eps then
// The limits don't make sense, just use linear interpolation
y := (y1-y0)*(x-x0)/(x1-x0) + y0;
else
Expand Down

0 comments on commit caf3eb7

Please sign in to comment.