Opened 7 years ago

Closed 5 years ago

#4739 closed defect (fixed)

Erroneous equation count with arrays

Reported by: ceraolo Owned by: somebody
Priority: high Milestone: 1.14.0
Component: *unknown* Version:
Keywords: Cc:

Description (last modified by ceraolo)

The following model:

model errorSize
Real x[:](start={ 0.2, 0.4, 0.6});
equation
  der(x[1:3])+x[1:3]=fill(1/(time+0.1),3);
end errorSize;

gives rise to the following result when checking:

Check of errorSize completed successfully.
Class errorSize has 3 equation(s) and 1 variable(s).
1 of these are trivial equation(s).

and the model obviously won't run.
AFAIK this is valid modelica

If I repeat checking with -d=newInst I get, instead:

[1] 16:20:30 Translation Error
[Es1: 2:1-2:34]: Failed to deduce dimension 1 of x due to missing binding equation.

Tested with OM v1.13.0-dev-380-g8b177b9 (WIN 64-bit)

Change History (5)

comment:1 Changed 7 years ago by ceraolo

  • Description modified (diff)

comment:2 Changed 7 years ago by perost

The specification doesn't say anything about how to deduce unknown dimensions in non-functions, see this ticket, so this is not strictly valid Modelica. However, we already deduce unknown dimensions from binding equations, since that's the de facto standard. Since Dymola also allows using the start attribute for this I added the same behaviour for the new frontend in 70d5639f. Note that the example model still doesn't simulate with the new frontend due to other unrelated issues though.

comment:3 Changed 6 years ago by casella

  • Milestone changed from 1.13.0 to 1.14.0

Rescheduled to 1.14.0 after 1.13.0 releasee

comment:4 Changed 5 years ago by casella

  • Milestone changed from 1.14.0 to 1.16.0

Releasing 1.14.0 which is stable and has many improvements w.r.t. 1.13.2. This issue is rescheduled to 1.16.0

comment:5 Changed 5 years ago by ceraolo

  • Milestone changed from 1.16.0 to 1.14.0
  • Resolution set to fixed
  • Status changed from new to closed

This model now simulates with the NF

Note: See TracTickets for help on using tickets.