Skip to content

Commit

Permalink
Disable initialization if exact=true
Browse files Browse the repository at this point in the history
  • Loading branch information
tobolar committed Feb 14, 2020
1 parent 90f23d3 commit 8366769
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
13 changes: 7 additions & 6 deletions Modelica/Mechanics/Rotational/Sources/Position.mo
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ model Position
annotation (Dialog(enable=not exact));
SI.Angle phi(stateSelect=if exact then StateSelect.default else StateSelect.prefer)
"Rotation angle of flange with respect to support";
SI.AngularVelocity w(start=0,stateSelect=if exact then StateSelect.default
else StateSelect.prefer)
"If exact=false, Angular velocity of flange with respect to support else dummy";
SI.AngularVelocity w(start=0,
stateSelect=if exact then StateSelect.default else StateSelect.prefer)
"If exact=false, Angular velocity of flange with respect to support else dummy"
annotation(Dialog(enable=not exact, showStartAttribute = true));
SI.AngularAcceleration a(start=0)
"If exact=false, Angular acceleration of flange with respect to support else dummy";
"If exact=false, Angular acceleration of flange with respect to support else dummy"
annotation(Dialog(enable=not exact, showStartAttribute = true));
Modelica.Blocks.Interfaces.RealInput phi_ref(
final quantity="Angle",
final unit="rad",
Expand All @@ -23,8 +25,7 @@ model Position
annotation (Placement(transformation(extent={{-140,-20},{-100,20}})));

protected
parameter SI.AngularFrequency w_crit=2*Modelica.Constants.pi
*f_crit "Critical frequency";
parameter SI.AngularFrequency w_crit=2*Modelica.Constants.pi*f_crit "Critical frequency";
constant Real af=1.3617 "s coefficient of Bessel filter";
constant Real bf=0.6180 "s*s coefficient of Bessel filter";
initial equation
Expand Down
13 changes: 7 additions & 6 deletions Modelica/Mechanics/Translational/Sources/Position.mo
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ model Position
parameter SI.Frequency f_crit=50
"If exact=false, critical frequency of filter to filter input signal"
annotation (Dialog(enable=not exact));
SI.Velocity v(start=0, stateSelect=if exact then StateSelect.default
else StateSelect.prefer)
"If exact=false, absolute velocity of flange else dummy";
SI.Velocity v(start=0,
stateSelect=if exact then StateSelect.default else StateSelect.prefer)
"If exact=false, absolute velocity of flange else dummy"
annotation(Dialog(enable=not exact, showStartAttribute = true));
SI.Acceleration a(start=0)
"If exact=false, absolute acceleration of flange else dummy";
"If exact=false, absolute acceleration of flange else dummy"
annotation(Dialog(enable=not exact, showStartAttribute = true));
Modelica.Blocks.Interfaces.RealInput s_ref(unit="m")
"Reference position of flange as input signal" annotation (Placement(
transformation(extent={{-140,-20},{-100,20}})));
protected
parameter SI.AngularFrequency w_crit=2*Modelica.Constants.pi
*f_crit "Critical frequency";
parameter SI.AngularFrequency w_crit=2*Modelica.Constants.pi*f_crit "Critical frequency";
constant Real af=1.3617 "s coefficient of Bessel filter";
constant Real bf=0.6180 "s*s coefficient of Bessel filter";

Expand Down

0 comments on commit 8366769

Please sign in to comment.