Ticket #6057: testcase.mo

File testcase.mo, 1.7 KB (added by federico.terraneo@…, 4 years ago)

test case

Line 
1package testcase
2
3model Test_005_RC
4Modelica.Electrical.Analog.Sources.ConstantVoltage constantVoltage(V = 1) annotation(
5 Placement(visible = true, transformation(origin = {-50, 10}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
6Modelica.Electrical.Analog.Basic.Ground ground annotation(
7 Placement(visible = true, transformation(origin = {-50, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
8Modelica.Electrical.Analog.Basic.Resistor resistor(R = 1) annotation(
9 Placement(visible = true, transformation(origin = {-10, 30}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
10Modelica.Electrical.Analog.Basic.Capacitor capacitor(C = 1) annotation(
11 Placement(visible = true, transformation(origin = {-10, 0}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
12equation
13 connect(resistor.p, constantVoltage.p) annotation(
14 Line(points = {{-10, 40}, {-50, 40}, {-50, 20}, {-50, 20}, {-50, 20}}, color = {0, 0, 255}));
15connect(resistor.n, capacitor.p) annotation(
16 Line(points = {{-10, 20}, {-10, 20}, {-10, 10}, {-10, 10}}, color = {0, 0, 255}));
17connect(capacitor.n, ground.p) annotation(
18 Line(points = {{-10, -10}, {-50, -10}, {-50, -20}, {-50, -20}}, color = {0, 0, 255}));
19connect(constantVoltage.n, ground.p) annotation(
20 Line(points = {{-50, 0}, {-50, 0}, {-50, -20}, {-50, -20}}, color = {0, 0, 255}));
21annotation(Diagram,
22 experiment(StartTime = 0, StopTime = 6, Tolerance = 1e-6, Interval = 0.002),
23 __OpenModelica_commandLineOptions = "--matchingAlgorithm=PFPlusExt --indexReductionMethod=dynamicStateSelection -d=initialization,NLSanalyticJacobian,newInst",
24 __OpenModelica_simulationFlags(lv = "LOG_STATS", outputFormat = "mat", s = "impeuler"));end Test_005_RC;
25
26end testcase;