-
Notifications
You must be signed in to change notification settings - Fork 167
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid function Modelica.Math.Matrices.nullSpace calculating max({}) #3849
Comments
Sort of, max for an empty range is defined as the least value of the type (in this case Real so However, that is only for a reduction expression and this is max for an array. We should clarify that it handles the empty case in the same manner. |
The multiplication only gives 0 if a Modelica tool treats |
I agree that we should move towards IEEE 754 definitions. However, I would propose that we view
|
It sounds like a mistake to couple the definitions of |
That is the current case.
The second part does not follow, and that's why I argue for using the maximum representable number as in C (DBL_MAX) as it has several advantages:
Obviously it would be clearer if this and other constants were given clear descriptions and names matching that. |
They way it is said looks more like a non-normative observation of what
Allowing
With
My take on this is that it means we need to limit |
It is hard (appears artificial) to restrict Modelica Here is how Python treats this since version 3.4:
"The default argument specifies an object to return if the provided iterable is empty. If the iterable is empty and default is not provided, a ValueError is raised." Modelica
or without Modelica language extension:
|
I find the Python way extremely ugly. Instead of making |
To cut a long discussion short: #3850 would fix the issue. |
There are two parts of this:
If Modelica Real variables aren't restricted to finite values then we can have:
That doesn't make sense and would likely limit the optimization possibilities in actual models. |
This is a good argument, and until we make a deliberate choice to allow the infinities, I think it needs to be more clearly specified that they are not allowed. Some sort implicit ban via the definition of |
The function
ModelicaTest.Math.Matrices3
containsModelica.Math.Matrices.nullSpace
calculates:i.e. max(0, 0) * max({}) * Modelica.Constants.eps.
Can this pass any simulation with success?
The text was updated successfully, but these errors were encountered: