Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

When variable value bounds (min/max) are enforced

When variable value bounds (min/max) are enforced

I was surprised to discover that a parameter variable's bounds (min/max) are not enforced when a user changes its value via the UI dialog box. It isn't even enforced when checking the model. It appears to be enforced only when the model is simulated.

I understand that the bounds need to be checked every time the variable is set during simulation, but I cannot understand why constant parameter values are not checked when a dialog box is being closed or when the model is checked. Perhaps this is another improvement that would happen with the new front end?

That said, there's already a certain amount of parsing that is happening to verify that a numeric literal value entered into the dialog box conforms to a valid integer or real syntax. At that point it is trivial to convert to a number (if it is a constant), and there's very little time required to test against constant min/max values.

There are 0 guests and 0 other users also viewing this topic
You are here: