| 1 | package testcase
|
|---|
| 2 |
|
|---|
| 3 | model Test_005_RC
|
|---|
| 4 | Modelica.Electrical.Analog.Sources.ConstantVoltage constantVoltage(V = 1) annotation(
|
|---|
| 5 | Placement(visible = true, transformation(origin = {-50, 10}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
|
|---|
| 6 | Modelica.Electrical.Analog.Basic.Ground ground annotation(
|
|---|
| 7 | Placement(visible = true, transformation(origin = {-50, -30}, extent = {{-10, -10}, {10, 10}}, rotation = 0)));
|
|---|
| 8 | Modelica.Electrical.Analog.Basic.Resistor resistor(R = 1) annotation(
|
|---|
| 9 | Placement(visible = true, transformation(origin = {-10, 30}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
|
|---|
| 10 | Modelica.Electrical.Analog.Basic.Capacitor capacitor(C = 1) annotation(
|
|---|
| 11 | Placement(visible = true, transformation(origin = {-10, 0}, extent = {{-10, -10}, {10, 10}}, rotation = -90)));
|
|---|
| 12 | equation
|
|---|
| 13 | connect(resistor.p, constantVoltage.p) annotation(
|
|---|
| 14 | Line(points = {{-10, 40}, {-50, 40}, {-50, 20}, {-50, 20}, {-50, 20}}, color = {0, 0, 255}));
|
|---|
| 15 | connect(resistor.n, capacitor.p) annotation(
|
|---|
| 16 | Line(points = {{-10, 20}, {-10, 20}, {-10, 10}, {-10, 10}}, color = {0, 0, 255}));
|
|---|
| 17 | connect(capacitor.n, ground.p) annotation(
|
|---|
| 18 | Line(points = {{-10, -10}, {-50, -10}, {-50, -20}, {-50, -20}}, color = {0, 0, 255}));
|
|---|
| 19 | connect(constantVoltage.n, ground.p) annotation(
|
|---|
| 20 | Line(points = {{-50, 0}, {-50, 0}, {-50, -20}, {-50, -20}}, color = {0, 0, 255}));
|
|---|
| 21 | annotation(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 |
|
|---|
| 26 | end testcase;
|
|---|