diff options
Diffstat (limited to 'modelica-parser-lalrpop/examples/modelica_other/multiple.mo')
-rw-r--r-- | modelica-parser-lalrpop/examples/modelica_other/multiple.mo | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/modelica-parser-lalrpop/examples/modelica_other/multiple.mo b/modelica-parser-lalrpop/examples/modelica_other/multiple.mo new file mode 100644 index 0000000..45d5cb8 --- /dev/null +++ b/modelica-parser-lalrpop/examples/modelica_other/multiple.mo @@ -0,0 +1,17 @@ +type Voltage = Real(unit="V"); +type Current = Real(unit="A"); + +connector Pin + Voltage v; + flow Current i; +end Pin; + +model Resistor + Pin p, n; + // "Positive" and "negative" pins. + parameter Real R(unit="Ohm") "Resistance"; +equation + R*p.i = p.v - n.v; + p.i + n.i = 0; + // Positive currents into component. +end Resistor; |