JKRT / OMFrontend.jl

Experimental implementation of NF. That is a Modelica frontend in 100% Julia
Other
2 stars 3 forks source link

Reworking array handling, I seem to have lost old code.. #33

Closed JKRT closed 3 years ago

JKRT commented 3 years ago

Fixed flattening of for equations.

Added Casc 6 as a test

model Casc6
  parameter Integer N = 4 "Order of the system";
  final parameter Real tau = T/N "Individual time constant";
  parameter Real T = 1 "System delay";
  Real x[N] (each start = 0, each fixed = true);
equation
  tau*der(x[1]) = 1 - x[1];
  for i in 2:N loop
    tau*der(x[i]) = x[i-1] - x[i];
  end for;
end Casc6;