diff --git a/Modelica/Blocks/Sources.mo b/Modelica/Blocks/Sources.mo index 143c2ee387..058c0992a8 100644 --- a/Modelica/Blocks/Sources.mo +++ b/Modelica/Blocks/Sources.mo @@ -941,13 +941,14 @@ The Real output y is a trapezoid signal: equation y = if time < startTime then wMin else if time < (startTime + max(duration,eps)) then - 10^(log10(wMin) + (log10(wMax) - log10(wMin))*min(1, (time-startTime)/max(duration,eps))) + wMin * (wMax/wMin)^min(1, (time-startTime)/max(duration,eps)) else wMax; annotation (defaultComponentName="logSweep", Documentation(info="

The output y performs a logarithmic frequency sweep. The logarithm of frequency w performs a linear ramp from log10(wMin) to log10(wMax). +It uses wMin*(wMax/wMin)^x instead of the equivalent 10^(log10(wMin)+log10(wMax)-log10(wMin)*x) to help with unit-checking. The output is the decimal power of this logarithmic ramp.

For time < startTime the output is equal to wMin.