According to MLS section 4.9.6
The attributes start and fixed define the initial conditions for a variable.
Consider the following model:
model CyclicStartAttribute
parameter Real p(fixed = false);
Real x(start = p);
initial equation
1 = p^2 + x^2;
equation
x = p + time;
end CyclicStartAttribute;
My interpretation is that CyclicStartAttribute is illegal because x.start and x cyclically depend on each other and have no initial guess available. Is this correct? Should it be made explicit in the MLS?
Now consider the following model:
model ReverseStartAttribute
parameter Real p(fixed = false);
Real x(start = p);
initial equation
1 = p^2 + x^2;
equation
x = time;
end ReverseStartAttribute;
Here x.start depends on x but is not part of an algebraic loop and in this case x.start is not needed because x can be computed directly from its defining equation. Should a compiler ignore x.start or should ReverseStartAttribute also be illegal?
Related Issues
This is similar but not identical to #2668 and #3278.
According to MLS section 4.9.6
Consider the following model:
My interpretation is that
CyclicStartAttributeis illegal becausex.startandxcyclically depend on each other and have no initial guess available. Is this correct? Should it be made explicit in the MLS?Now consider the following model:
Here
x.startdepends onxbut is not part of an algebraic loop and in this casex.startis not needed becausexcan be computed directly from its defining equation. Should a compiler ignorex.startor shouldReverseStartAttributealso be illegal?Related Issues
This is similar but not identical to #2668 and #3278.