Ticket #6420: Example1.mo

File Example1.mo, 1.4 KB (added by Christian Kral, 4 years ago)

Example with two wrong connections

Line 
1model Example1
2 Modelica.Electrical.Analog.Basic.Resistor resistor annotation(
3 Placement(visible = true, transformation(origin = {30, 0}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
4 Modelica.Electrical.Analog.Basic.Ground ground annotation(
5 Placement(visible = true, transformation(origin = {-30, -42}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
6 Modelica.Electrical.Analog.Sources.ConstantVoltage constantVoltage annotation(
7 Placement(visible = true, transformation(origin = {-30, 0}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
8 Modelica.Electrical.Analog.Sensors.CurrentSensor currentSensor annotation(
9 Placement(visible = true, transformation(origin = {0, 20}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
10equation
11 connect(ground.p, constantVoltage.n) annotation(
12 Line(points = {{-30, -32}, {-30, -10}}, color = {0, 0, 255}));
13 connect(constantVoltage.p, currentSensor.p) annotation(
14 Line(points = {{-30, 10}, {-30, 20}, {-10, 20}}, color = {0, 0, 255}));
15 connect(currentSensor.n, resistor.p) annotation(
16 Line(points = {{10, 20}, {30, 20}, {30, 10}}, color = {0, 0, 255}));
17 connect(currentSensor.p, currentSensor.n) annotation(
18 Line(points = {{-10, 20}, {10, 20}}, color = {0, 0, 255}));
19 connect(ground.p, resistor.p) annotation(
20 Line(points = {{-30, -32}, {-30, -20}, {30, -20}, {30, 10}}, color = {0, 0, 255}));
21annotation(
22 uses(Modelica(version = "3.2.3")));
23end Example1;