Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Passing fixed=true where expected in the examples
Most of the examples are old; we should showcase modern Modelica, and leaving initialization partially undefined is not recommended. Belonging to [master]: - OpenModelica/OMCompiler#1966
- Loading branch information
1 parent
1f28d87
commit a07c7d7
Showing
3 changed files
with
15 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
model dcmotor | ||
Modelica.Electrical.Analog.Basic.Resistor resistor1(R = 10); | ||
//Observe the difference between MSL 2.2 and 3.1 regarding the default values, in 3.1 there are no default values set, only start values | ||
Modelica.Electrical.Analog.Basic.Inductor inductor1(L = 0.2); | ||
Modelica.Electrical.Analog.Basic.Ground ground1; | ||
Modelica.Mechanics.Rotational.Components.Inertia load(J = 1); // Modelica version 3.1 | ||
// Modelica.Mechanics.Rotational.Inertia load(J = 1); // Modelica version 2.2 | ||
Modelica.Electrical.Analog.Basic.EMF emf1; | ||
Modelica.Blocks.Sources.Step step1; | ||
import Modelica.Electrical.Analog.Basic; | ||
Basic.Resistor resistor1(R = 10); | ||
Basic.Inductor inductor1(L = 0.2, i.fixed=true); | ||
Basic.Ground ground1; | ||
Modelica.Mechanics.Rotational.Components.Inertia load(J = 1, phi.fixed=true, w.fixed=true); | ||
Basic.EMF emf1(k=1.0); | ||
Modelica.Blocks.Sources.Step step1; | ||
Modelica.Electrical.Analog.Sources.SignalVoltage signalVoltage1; | ||
equation | ||
//connect(step1.outport, signalVoltage1.inPort); | ||
connect(step1.y, signalVoltage1.v); | ||
connect(signalVoltage1.p, resistor1.p); | ||
connect(resistor1.n, inductor1.p); | ||
connect(inductor1.n, emf1.p); | ||
// connect(emf1.flange_b, load.flange_a); //Modelica version 2.2 | ||
connect(emf1.flange, load.flange_a); // Modelica version 3.1 | ||
connect(emf1.flange, load.flange_a); | ||
connect(signalVoltage1.n, ground1.p); | ||
connect(ground1.p, emf1.n); | ||
annotation(uses(Modelica(version="3.2.2"))); | ||
end dcmotor; |