Skip to content

Commit 509eda0

Browse files
committed
Have different sources for different units to help unit-checking.
1 parent f325ed3 commit 509eda0

File tree

1 file changed

+99
-39
lines changed

1 file changed

+99
-39
lines changed

ModelicaTest/Blocks.mo

Lines changed: 99 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ if homotopy is active, the solution accepted by the assert statement (x = 100) i
12151215
f=2,
12161216
amplitude=10,
12171217
offset=10)
1218-
annotation (Placement(transformation(extent={{-80,100},{-60,120}})));
1218+
annotation (Placement(transformation(extent={{-100,100},{-80,120}})));
12191219
Modelica.Blocks.Math.UnitConversions.To_degC to_degC
12201220
annotation (Placement(transformation(extent={{-40,100},{-20,120}})));
12211221
Modelica.Blocks.Math.UnitConversions.From_degC from_degC
@@ -1253,21 +1253,21 @@ if homotopy is active, the solution accepted by the assert statement (x = 100) i
12531253
Modelica.Blocks.Math.UnitConversions.From_minute from_minute
12541254
annotation (Placement(transformation(extent={{-10,-140},{10,-120}})));
12551255
Modelica.Blocks.Math.UnitConversions.To_litre to_litre
1256-
annotation (Placement(transformation(extent={{40,100},{60,120}})));
1256+
annotation (Placement(transformation(extent={{50,100},{70,120}})));
12571257
Modelica.Blocks.Math.UnitConversions.From_litre from_litre
1258-
annotation (Placement(transformation(extent={{70,100},{90,120}})));
1258+
annotation (Placement(transformation(extent={{80,100},{100,120}})));
12591259
Modelica.Blocks.Math.UnitConversions.To_kWh to_kWh
1260-
annotation (Placement(transformation(extent={{40,70},{60,90}})));
1260+
annotation (Placement(transformation(extent={{50,60},{70,80}})));
12611261
Modelica.Blocks.Math.UnitConversions.From_kWh from_kWh
1262-
annotation (Placement(transformation(extent={{72,70},{92,90}})));
1262+
annotation (Placement(transformation(extent={{80,60},{100,80}})));
12631263
Modelica.Blocks.Math.UnitConversions.To_bar to_bar
1264-
annotation (Placement(transformation(extent={{40,40},{60,60}})));
1264+
annotation (Placement(transformation(extent={{50,20},{70,40}})));
12651265
Modelica.Blocks.Math.UnitConversions.From_bar from_bar
1266-
annotation (Placement(transformation(extent={{72,40},{92,60}})));
1266+
annotation (Placement(transformation(extent={{80,20},{100,40}})));
12671267
Modelica.Blocks.Math.UnitConversions.To_gps to_gps
1268-
annotation (Placement(transformation(extent={{40,10},{60,30}})));
1268+
annotation (Placement(transformation(extent={{50,-20},{70,0}})));
12691269
Modelica.Blocks.Math.UnitConversions.From_gps from_gps
1270-
annotation (Placement(transformation(extent={{72,10},{92,30}})));
1270+
annotation (Placement(transformation(extent={{80,-20},{100,0}})));
12711271
output Real ydegC=from_degC.y;
12721272
output Real ydegF=from_degF.y;
12731273
output Real ydegRk=from_degRk.y;
@@ -1281,17 +1281,69 @@ if homotopy is active, the solution accepted by the assert statement (x = 100) i
12811281
output Real ykWh=from_kWh.y;
12821282
output Real ybar=from_bar.y;
12831283
output Real ygps=from_gps.y;
1284+
Modelica.Blocks.Sources.Cosine cosine1(
1285+
f=2,
1286+
amplitude=10,
1287+
offset=10)
1288+
annotation (Placement(transformation(extent={{-80,70},{-60,90}})));
1289+
Modelica.Blocks.Sources.Cosine cosine2(
1290+
f=2,
1291+
amplitude=10,
1292+
offset=10)
1293+
annotation (Placement(transformation(extent={{-100,40},{-80,60}})));
1294+
Modelica.Blocks.Sources.Cosine cosine3(
1295+
f=2,
1296+
amplitude=10,
1297+
offset=10)
1298+
annotation (Placement(transformation(extent={{-80,10},{-60,30}})));
1299+
Modelica.Blocks.Sources.Cosine cosine4(
1300+
f=2,
1301+
amplitude=10,
1302+
offset=10)
1303+
annotation (Placement(transformation(extent={{-100,-20},{-80,0}})));
1304+
Modelica.Blocks.Sources.Cosine cosine5(
1305+
f=2,
1306+
amplitude=10,
1307+
offset=10)
1308+
annotation (Placement(transformation(extent={{-80,-50},{-60,-30}})));
1309+
Modelica.Blocks.Sources.Cosine cosine6(
1310+
f=2,
1311+
amplitude=10,
1312+
offset=10)
1313+
annotation (Placement(transformation(extent={{-100,-80},{-80,-60}})));
1314+
Modelica.Blocks.Sources.Cosine cosine7(
1315+
f=2,
1316+
amplitude=10,
1317+
offset=10)
1318+
annotation (Placement(transformation(extent={{-80,-110},{-60,-90}})));
1319+
Modelica.Blocks.Sources.Cosine cosine8(
1320+
f=2,
1321+
amplitude=10,
1322+
offset=10)
1323+
annotation (Placement(transformation(extent={{-100,-140},{-80,-120}})));
1324+
Modelica.Blocks.Sources.Cosine cosine9(
1325+
f=2,
1326+
amplitude=10,
1327+
offset=10)
1328+
annotation (Placement(transformation(extent={{20,100},{40,120}})));
1329+
Modelica.Blocks.Sources.Cosine cosine10(
1330+
f=2,
1331+
amplitude=10,
1332+
offset=10)
1333+
annotation (Placement(transformation(extent={{20,60},{40,80}})));
1334+
Modelica.Blocks.Sources.Cosine cosine11(
1335+
f=2,
1336+
amplitude=10,
1337+
offset=10)
1338+
annotation (Placement(transformation(extent={{20,20},{40,40}})));
1339+
Modelica.Blocks.Sources.Cosine cosine12(
1340+
f=2,
1341+
amplitude=10,
1342+
offset=10)
1343+
annotation (Placement(transformation(extent={{20,-20},{40,0}})));
12841344
equation
12851345
connect(cosine.y, to_degC.u) annotation (Line(
1286-
points={{-59,110},{-42,110}}, color={0,0,127}));
1287-
connect(cosine.y, to_degF.u) annotation (Line(
1288-
points={{-59,110},{-50,110},{-50,80},{-42,80}}, color={0,0,127}));
1289-
connect(cosine.y, to_degRk.u) annotation (Line(
1290-
points={{-59,110},{-50,110},{-50,50},{-42,50}}, color={0,0,127}));
1291-
connect(cosine.y, to_deg.u) annotation (Line(
1292-
points={{-59,110},{-50,110},{-50,20},{-46,20},{-46,20},{-42,20}}, color={0,0,127}));
1293-
connect(cosine.y, to_rpm.u) annotation (Line(
1294-
points={{-59,110},{-50,110},{-50,-10},{-42,-10}}, color={0,0,127}));
1346+
points={{-79,110},{-42,110}}, color={0,0,127}));
12951347
connect(to_degC.y, from_degC.u) annotation (Line(
12961348
points={{-19,110},{-16,110},{-16,110},{-12,110}}, color={0,0,127}));
12971349
connect(to_degF.y, from_degF.u) annotation (Line(
@@ -1310,32 +1362,40 @@ if homotopy is active, the solution accepted by the assert statement (x = 100) i
13101362
points={{-19,-100},{-12,-100}}, color={0,0,127}));
13111363
connect(to_minute.y, from_minute.u) annotation (Line(
13121364
points={{-19,-130},{-12,-130}}, color={0,0,127}));
1313-
connect(cosine.y, to_kmh.u) annotation (Line(
1314-
points={{-59,110},{-50,110},{-50,-40},{-42,-40}}, color={0,0,127}));
1315-
connect(cosine.y, to_day.u) annotation (Line(
1316-
points={{-59,110},{-50,110},{-50,-70},{-42,-70}}, color={0,0,127}));
1317-
connect(cosine.y, to_hour.u) annotation (Line(
1318-
points={{-59,110},{-50,110},{-50,-100},{-42,-100}}, color={0,0,127}));
1319-
connect(cosine.y, to_minute.u) annotation (Line(
1320-
points={{-59,110},{-50,110},{-50,-130},{-42,-130}}, color={0,0,127}));
1321-
connect(cosine.y, to_litre.u) annotation (Line(
1322-
points={{-59,110},{-50,110},{-50,128},{28,128},{28,110},{38,110}}, color={0,0,127}));
1323-
connect(cosine.y, to_kWh.u) annotation (Line(
1324-
points={{-59,110},{-50,110},{-50,128},{28,128},{28,80},{38,80}}, color={0,0,127}));
13251365
connect(to_litre.y, from_litre.u) annotation (Line(
1326-
points={{61,110},{68,110}}, color={0,0,127}));
1366+
points={{71,110},{78,110}}, color={0,0,127}));
13271367
connect(to_kWh.y, from_kWh.u) annotation (Line(
1328-
points={{61,80},{70,80}}, color={0,0,127}));
1329-
connect(cosine.y, to_bar.u) annotation (Line(
1330-
points={{-59,110},{-50,110},{-50,128},{28,128},{28,50},{38,50}}, color={0,0,127}));
1331-
connect(cosine.y, to_gps.u) annotation (Line(
1332-
points={{-59,110},{-50,110},{-50,128},{28,128},{28,20},{38,20}}, color={0,0,127}));
1368+
points={{71,70},{78,70}}, color={0,0,127}));
13331369
connect(to_bar.y, from_bar.u) annotation (Line(
1334-
points={{61,50},{70,50}}, color={0,0,127}));
1370+
points={{71,30},{78,30}}, color={0,0,127}));
13351371
connect(to_gps.y, from_gps.u) annotation (Line(
1336-
points={{61,20},{70,20}}, color={0,0,127}));
1372+
points={{71,-10},{78,-10}}, color={0,0,127}));
1373+
connect(cosine1.y, to_degF.u)
1374+
annotation (Line(points={{-59,80},{-42,80}}, color={0,0,127}));
1375+
connect(cosine2.y, to_degRk.u)
1376+
annotation (Line(points={{-79,50},{-42,50}}, color={0,0,127}));
1377+
connect(cosine3.y, to_deg.u)
1378+
annotation (Line(points={{-59,20},{-42,20}}, color={0,0,127}));
1379+
connect(cosine4.y, to_rpm.u)
1380+
annotation (Line(points={{-79,-10},{-42,-10}}, color={0,0,127}));
1381+
connect(cosine5.y, to_kmh.u)
1382+
annotation (Line(points={{-59,-40},{-42,-40}}, color={0,0,127}));
1383+
connect(cosine6.y, to_day.u)
1384+
annotation (Line(points={{-79,-70},{-42,-70}}, color={0,0,127}));
1385+
connect(cosine7.y, to_hour.u)
1386+
annotation (Line(points={{-59,-100},{-42,-100}}, color={0,0,127}));
1387+
connect(cosine8.y, to_minute.u)
1388+
annotation (Line(points={{-79,-130},{-42,-130}}, color={0,0,127}));
1389+
connect(to_litre.u, cosine9.y)
1390+
annotation (Line(points={{48,110},{41,110}}, color={0,0,127}));
1391+
connect(cosine12.y, to_gps.u)
1392+
annotation (Line(points={{41,-10},{48,-10}}, color={0,0,127}));
1393+
connect(cosine11.y, to_bar.u)
1394+
annotation (Line(points={{41,30},{48,30}}, color={0,0,127}));
1395+
connect(cosine10.y, to_kWh.u)
1396+
annotation (Line(points={{41,70},{48,70}}, color={0,0,127}));
13371397
annotation (experiment(StopTime=1.1), Diagram(coordinateSystem(
1338-
preserveAspectRatio=false, extent={{-100,-140},{100,140}}), graphics));
1398+
preserveAspectRatio=false, extent={{-100,-140},{100,140}})));
13391399
end ConversionBlocks;
13401400

13411401
model PadeDelay1

0 commit comments

Comments
 (0)