Skip to content

Is this situation a redundant initial condition? #3796

@huihui11123

Description

@huihui11123
model Test
  Real x;
initial equation 
  pre(x) = time - 10;
equation 
  when initial() then
    x = time + 5;
  elsewhen time>1 then
    x = 1;
  end when;
end Test;

This model can run in Dymola, but if the elsewhen branch is removed, Dymola will report redundant initial condition errors.

model Test
  Real x;
initial equation 
  pre(x) = time - 10;
equation 
  when initial() then
    x = time + 5;
  end when;
end Test;

In my opinion, the initial equations of these two models are the same; both are pre(x) = time - 10 and x = time + 5.
I don't know why the results in Dymola are different. Also, does this situation count as redundant initial conditions?
I have seen many such cases in the third-party library Buildings.

Metadata

Metadata

Assignees

No one assigned

    Labels

    tool-issueIssue in tool(s) - not the specification itself

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions