#4119 closed defect (worksforme)
singulare model pass backend
Reported by: | Vitalij Ruge | Owned by: | somebody |
---|---|---|---|
Priority: | high | Milestone: | Future |
Component: | Backend | Version: | |
Keywords: | Cc: |
Description
We gerenate for the follwoing example, wrong C and Cpp code.
But we should failed in the Backend or Frondend check, because we have a duplicate equation(singular model).
model foo function f input Real[2] x; output Real[2] y; output Real[2] z; algorithm y[1] := 2*x[1]^2 + 1; y[2] := 3*x[2]^3 + 2; z[1] := -y[1]/2+1/2+7; z[2] := -y[2]/3+2/3-7; end f; Real[2] y(each start = -1); Real[2] w(each start = -1); Real z1, z2, z3; equation (, w) = f({y[1] + z3, y[2]}); (, w) = f({y[1] + z3, y[2]}); // duplicate eq der(y[1]) = -z1*y[2] +1; der(y[2]) = -z2*y[1] + z1*y[2] +3; z3 = time; end foo;
Change History (2)
follow-up: 2 comment:1 by , 7 years ago
Component: | *unknown* → Backend |
---|---|
Resolution: | → worksforme |
Status: | new → closed |
comment:2 by , 7 years ago
Note:
See TracTickets
for help on using tickets.
I tried this with OpenModelica-v1.13.0-dev-63-g453e1c7-64bit. The model generates an error in the backend:
I'm not sure why the model is reported to have 18 equations and 20 variables, as I see 7 equations in 7 variables. Maybe there's something wrong in how OMC deals with complex functions with empty output arguments.
I don't think we should look for duplicate equations, that in general could be quite expensive. Structural analysis should find this out.