Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Modelica_LinearSystems2/Internal/frequencyRangeZeros.mo
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ algorithm
k2 := z_re/tan_max2;
w_max1 := sqrt(k2^2 + z_abs2) - k2;
/*
phi1 :=Modelica.Units.Conversions.to_deg(Modelica.Math.atan((w_max1 + z[i].im)/z_re));
phi2 :=Modelica.Units.Conversions.to_deg(Modelica.Math.atan((w_max1 - z[i].im)/z_re));
phi1 :=Modelica.Units.Conversions.to_deg(Math.atan((w_max1 + z[i].im)/z_re));
phi2 :=Modelica.Units.Conversions.to_deg(Math.atan((w_max1 - z[i].im)/z_re));
Modelica.Utilities.Streams.print("phi1, phi2, 180-sum = " + String(phi1) + ", " + String(phi2)+", " +String(180-phi1-phi2));
*/
else
Expand All @@ -81,8 +81,8 @@ algorithm

if first then
useFullRange := false;
w_min :=Modelica.Units.Conversions.from_Hz(0.1);
w_max :=Modelica.Units.Conversions.from_Hz(1);
w_min := Modelica.Units.Conversions.from_Hz(0.1);
w_max := Modelica.Units.Conversions.from_Hz(1);
end if;

annotation (Documentation(info="<html>
Expand Down
8 changes: 4 additions & 4 deletions Modelica_LinearSystems2/Internal/frequencyRangeZeros2.mo
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ algorithm
k2 := z_re/tan_max2;
w_max1 := sqrt(k2^2 + z_abs2) - k2;
/*
phi1 :=Modelica.Units.Conversions.to_deg(Modelica.Math.atan((w_max1 + z[i].im)/z_re));
phi2 :=Modelica.Units.Conversions.to_deg(Modelica.Math.atan((w_max1 - z[i].im)/z_re));
phi1 :=Modelica.Units.Conversions.to_deg(Math.atan((w_max1 + z[i].im)/z_re));
phi2 :=Modelica.Units.Conversions.to_deg(Math.atan((w_max1 - z[i].im)/z_re));
Modelica.Utilities.Streams.print("phi1, phi2, 180-sum = " + String(phi1) + ", " + String(phi2)+", " +String(180-phi1-phi2));
*/
else
Expand All @@ -82,8 +82,8 @@ algorithm

if first then
useFullRange := false;
w_min :=Modelica.Units.Conversions.from_Hz(0.1);
w_max :=Modelica.Units.Conversions.from_Hz(1);
w_min := Modelica.Units.Conversions.from_Hz(0.1);
w_max := Modelica.Units.Conversions.from_Hz(1);
end if;

annotation (Documentation(info="<html>
Expand Down
28 changes: 12 additions & 16 deletions Modelica_LinearSystems2/Utilities/Plot/parameterizedCurves.mo
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@ function parameterizedCurves
"Plot parametrized curve with one or more branches"
extends Modelica.Icons.Function;

import Modelica_LinearSystems2;
import Modelica_LinearSystems2.Utilities.Plot.Internal;
import Modelica_LinearSystems2.Utilities.Plot;

input Modelica_LinearSystems2.Utilities.Plot.Records.ParametrizedCurves diagram
input Plot.Records.ParametrizedCurves diagram
"Parametrized curve data points" annotation(Dialog);
input Modelica_LinearSystems2.Utilities.Plot.Records.Device device=
Modelica_LinearSystems2.Utilities.Plot.Records.Device()
input Plot.Records.Device device = Modelica_LinearSystems2.Utilities.Plot.Records.Device()
"Properties of device where figure is shown" annotation(Dialog);

protected
Expand All @@ -23,10 +21,8 @@ protected
Integer nProperties=size(diagram.curveProperties,1);
Integer nBranches=size(diagram.X,1);
Integer colors[nBranches,3] "Line colors";
Modelica_LinearSystems2.Utilities.Plot.Types.LinePattern patterns[nBranches]
"Line patterns";
Modelica_LinearSystems2.Utilities.Plot.Types.PointSymbol symbols[nBranches]
"Line symbols";
Plot.Types.LinePattern patterns[nBranches] "Line patterns";
Plot.Types.PointSymbol symbols[nBranches] "Line symbols";
Real thicknesses[nBranches] "Line thicknesses";
algorithm
// Create diagram
Expand Down Expand Up @@ -69,12 +65,12 @@ algorithm
else
for i in 1:nBranches loop
k := i;
j :=mod(k, nProperties) + 1
j := mod(k, nProperties) + 1
"if k is replaced by i, Dymola gives an error about assignment of Real to Integer";
colors[i,:] :=diagram.curveProperties[j].lineColor;
patterns[i] :=diagram.curveProperties[j].linePattern;
symbols[i] :=diagram.curveProperties[j].lineSymbol;
thicknesses[i] :=diagram.curveProperties[j].lineThickness;
colors[i,:] := diagram.curveProperties[j].lineColor;
patterns[i] := diagram.curveProperties[j].linePattern;
symbols[i] := diagram.curveProperties[j].lineSymbol;
thicknesses[i] := diagram.curveProperties[j].lineThickness;
end for;
DymolaCommands.Plot.plotParametricCurves(
x=diagram.X,
Expand All @@ -87,8 +83,8 @@ algorithm
id=id,
labelWithS=diagram.labelWithS,
colors=colors,
patterns=Internal.convertToDymolaPattern(patterns),
markers=Internal.convertToDymolaMarker(symbols),
patterns=Plot.Internal.convertToDymolaPattern(patterns),
markers=Plot.Internal.convertToDymolaMarker(symbols),
thicknesses=thicknesses);
end if;

Expand Down
Loading