Opened 8 years ago

Closed 6 years ago

Last modified 5 years ago

#1753 closed defect (worksforme)

Parser error in function call equations

Reported by: jakesson Owned by: Jesper Mattsson
Priority: major Milestone: Never
Component: Modelica/FrontEnd Version: trunk
Keywords: MATrac Cc:

Description

The following model should be legal:

model BlockTest6
  function F
    input Real x[2];
    output Real y1;
    output Real y2;

  algorithm
    y1 := -x[1];
    y2 := -x[2];
  end F;
  Real z[2], w[2];
equation
  w = {2,2};
  (der(z[1]),der(z[2])) = F(w);
end BlockTest6;

But gives a parser error. It seems that derivatives cannot be used in the left of a function call equation.

Change History (11)

comment:1 Changed 8 years ago by Jesper Mattsson

Is that really an error?
The spec calls for component references on the left hand side, and I'd say that der() is an expression, not a component reference.
The syntax appendix is no help - it allows general expressions on the left hand of an function call statement (clearly an error), and doesn't contain function call equations at all.

comment:2 Changed 8 years ago by jakesson

Milestone: 1.8.x1.9.x

comment:3 Changed 7 years ago by jakesson

Owner: set to Jesper Mattsson
Status: newassigned

comment:4 Changed 7 years ago by Jesper Mattsson

Milestone: 1.9.x1.10.x

This needs more discussion, and probably a ticket in the Modelica trac.

comment:5 Changed 7 years ago by Jesper Mattsson

Milestone: 1.10.x1.11.x

comment:6 in reply to:  4 Changed 6 years ago by Tove Bergdahl

Milestone: 1.11.x1.12.x

Replying to jmattsson:

This needs more discussion, and probably a ticket in the Modelica trac.

Let's do this for 1.12.x.

comment:7 Changed 6 years ago by Jesper Mattsson

Keywords: MATrac added

comment:8 Changed 6 years ago by Jesper Mattsson

Milestone: 1.12.xPending

Ticket created in MA Trac: M:#1357.

Awaiting decision by MA.

comment:9 Changed 6 years ago by Jesper Mattsson

Resolution: worksforme
Status: assignedclosed

MA decision: Using der() in the left hand side of a function call equation is not allowed. That is the current behavior.

comment:10 Changed 6 years ago by Jesper Mattsson

Milestone: Pending1.12.x

comment:11 Changed 5 years ago by Jesper Mattsson

Milestone: 1.12.xNever
Note: See TracTickets for help on using tickets.