Skip to content

Commit

Permalink
Set unit instead of having it in description (modelica#4264)
Browse files Browse the repository at this point in the history
* Replace description with unit-setting.
Ideally it should use SI.Area etc, but I thought the idea was that the example should be more self-contained.
Closes modelica#4076

* Also remove "in dB" since the unit is "dB".

* Update Modelica/StateGraph.mo

Co-authored-by: tobolar <tobolar@users.noreply.github.com>

* Update Modelica/StateGraph.mo

Co-authored-by: Thomas Beutlich <modelica@tbeu.de>

---------

Co-authored-by: tobolar <tobolar@users.noreply.github.com>
Co-authored-by: Thomas Beutlich <modelica@tbeu.de>
  • Loading branch information
3 people committed Jan 18, 2024
1 parent 02312e8 commit 24477ff
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Modelica/ComplexBlocks/ComplexMath/Bode.mo
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ block Bode "Calculate quantities to plot Bode diagram"
extent={{-10,10},{10,-10}},
rotation=270,
origin={0,-20})));
Blocks.Interfaces.RealOutput dB_y(unit="dB") "Log10 of absolute value of ratio u / divisor in dB" annotation (Placement(transformation(
Blocks.Interfaces.RealOutput dB_y(unit="dB") "Log10 of absolute value of ratio u / divisor" annotation (Placement(transformation(
extent={{-10,-10},{10,10}},
rotation=270,
origin={0,-110}), iconTransformation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ within Modelica.Electrical.QuasiStatic.SinglePhase.Examples;
model SeriesBode "Series circuit with Bode analysis"
extends Modelica.Icons.Example;
output Real abs_y = bode.abs_y "Magnitude of voltage ratio";
output SI.AmplitudeLevelDifference dB_y = bode.dB_y "Log10 of magnitude of voltage ratio in dB";
output SI.AmplitudeLevelDifference dB_y = bode.dB_y "Log10 of magnitude of voltage ratio";
output SI.Angle arg_y = bode.arg_y "Angle of voltage ratio";
Modelica.Blocks.Sources.LogFrequencySweep frequencySweep(
duration=1,
Expand Down
6 changes: 3 additions & 3 deletions Modelica/StateGraph.mo
Original file line number Diff line number Diff line change
Expand Up @@ -1535,9 +1535,9 @@ buttons:
annotation (Placement(transformation(extent={{55,-50},{
65,-40}})));
Real level(start=0,fixed=true) "Tank level in % of max height";
parameter Real A=1 "Ground area of tank in m^2";
parameter Real a=0.2 "Area of drain hole in m^2";
parameter Real hmax=1 "Max height of tank in m";
parameter SI.Area A=1 "Ground area of tank";
parameter SI.Area a=0.2 "Area of drain hole";
parameter SI.Height hmax=1 "Max height of tank";
constant Real g=Modelica.Constants.g_n;
equation
der(level) = (inflow1.Fi - outflow1.Fo)/(hmax*A);
Expand Down

0 comments on commit 24477ff

Please sign in to comment.