Skip to content

Commit

Permalink
refs #2157: Move LogFrequencySweep from ComplexBlocks to Blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
beutlich committed Feb 13, 2017
1 parent 9e49f18 commit 0a9a0ad
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 19 deletions.
17 changes: 17 additions & 0 deletions Modelica/Blocks/Sources.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1964,6 +1964,23 @@ a flange according to a given acceleration.
</html>"));
end KinematicPTP2;

block LogFrequencySweep "Logarithmic frequency sweep"
extends Modelica.Blocks.Interfaces.SO;
import Modelica.Constants.eps;
parameter Real wMin(min=eps) "Lower frequency border";
parameter Real wMax(min=(1+eps)*wMin) "Upper frequency border";
parameter Modelica.SIunits.Duration duration(min=0.0, start=1)
"Duration of ramp (= 0.0 gives a Step)";
equation
y = 10^(log10(wMin) + (log10(wMax) - log10(wMin))*min(1, time/max(duration,eps)));
annotation ( Documentation(info="<html>
>The output performs a logarithmic frequency sweep:<br>
e logarithm of w performs a linear ramp from log10(wMin) to log10(wMax), after the duration it is kept constant.<br>
e output is the decimal power of this logarithmic ramp.
p>
html>"));
end LogFrequencySweep;

block TimeTable
"Generate a (possibly discontinuous) signal by linear interpolation in a table"

Expand Down
19 changes: 1 addition & 18 deletions Modelica/ComplexBlocks.mo
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Plotting the imaginary part versus the real part, you will see an Archimedean sp
Real lg_w=log10(logFrequencySweep.y);
Real dB=20*log10(complexToPolar.len);
Modelica.SIunits.Angle phi(displayUnit="deg")=complexToPolar.phi;
Modelica.ComplexBlocks.Sources.LogFrequencySweep logFrequencySweep(
Modelica.Blocks.Sources.LogFrequencySweep logFrequencySweep(
duration=1,
wMin=wMin,
wMax=wMax)
Expand Down Expand Up @@ -2250,23 +2250,6 @@ The output y is a complex phasor with constant magnitude, spinning with constant

</html>"));
end ComplexRotatingPhasor;

block LogFrequencySweep "Logarithmic frequency sweep"
extends Modelica.Blocks.Interfaces.SO;
import Modelica.Constants.eps;
parameter Real wMin(min=eps) "Lower frequency border";
parameter Real wMax(min=(1+eps)*wMin) "Upper frequency border";
parameter Modelica.SIunits.Time duration(min=0.0, start=1)
"Duration of ramp (= 0.0 gives a Step)";
equation
y = 10^(log10(wMin) + (log10(wMax) - log10(wMin))*min(1, time/max(duration,eps)));
annotation ( Documentation(info="<html>
<p>The output performs a logarithmic frequency sweep:<br>
The logarithm of w performs a linear ramp from log10(wMin) to log10(wMax), after the duration it is kept constant.<br>
The output is the decimal power of this logarithmic ramp.
</p>
</html>"));
end LogFrequencySweep;
end Sources;
annotation (Documentation(info="<html>
<p>This library hosts blocks using Complex inputs and outputs.</p>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Convert from Modelica 3.2.2

// clear
convertClear();

// Rename references to classes that are moved
convertClass("Modelica.ComplexBlocks.Sources.LogFrequencySweep",
"Modelica.Blocks.Sources.LogFrequencySweep")
3 changes: 2 additions & 1 deletion Modelica/package.mo
Original file line number Diff line number Diff line change
Expand Up @@ -8130,7 +8130,8 @@ conversion(
from(version="2.1", script="modelica://Modelica/Resources/Scripts/Dymola/ConvertModelica_from_2.2.2_to_3.0.mos"),
from(version="2.2", script="modelica://Modelica/Resources/Scripts/Dymola/ConvertModelica_from_2.2.2_to_3.0.mos"),
from(version="2.2.1", script="modelica://Modelica/Resources/Scripts/Dymola/ConvertModelica_from_2.2.2_to_3.0.mos"),
from(version="2.2.2", script="modelica://Modelica/Resources/Scripts/Dymola/ConvertModelica_from_2.2.2_to_3.0.mos")),
from(version="2.2.2", script="modelica://Modelica/Resources/Scripts/Dymola/ConvertModelica_from_2.2.2_to_3.0.mos"),
from(version="3.2.2", script="modelica://Modelica/Resources/Scripts/Dymola/ConvertModelica_from_3.2.2.mos")),
Icon(coordinateSystem(extent={{-100.0,-100.0},{100.0,100.0}}), graphics={
Polygon(
origin={-6.9888,20.048},
Expand Down

0 comments on commit 0a9a0ad

Please sign in to comment.