modelica / ModelicaStandardLibrary

Free (standard conforming) library to model mechanical (1D/3D), electrical (analog, digital, machines), magnetic, thermal, fluid, control systems and hierarchical state machines. Also numerical functions and functions for strings, files and streams are included.
https://doc.modelica.org
BSD 3-Clause "New" or "Revised" License
472 stars 169 forks source link

Remove real relation in non-discrete-time controlled if-statement #4220

Closed qlambert-pro closed 10 months ago

qlambert-pro commented 11 months ago

According to Section 3.8.5 real elementary relations inside if-clauses controlled by a non-discrete-time switching expression are not allowed.

Harisankar-Allimangalath commented 11 months ago

@HansOlsson can you suggest or add anyone else also for reviewing whom you think would be a subject matter expert , Thanks .

HansOlsson commented 11 months ago

@HansOlsson can you suggest or add anyone else also for reviewing whom you think would be a subject matter expert , Thanks .

As far as I understand the library officers for Modelica.Blocks are @AHaumer and @MartinOtter but this isn't needing any special Blocks-competence.

Harisankar-Allimangalath commented 11 months ago

Thanks @HansOlsson for clarifying . Let me add @hubertus65 for reviewing for the sake of merging (as it demands 2 reviewer's approval). Thankyou

henrikt-ma commented 11 months ago

Technically, these aren't forbidden as table is a parameter, and noEvent only matters if the operands are non-discrete-time expressions.

However, that makes it confusing and redundant so it would be good to remove them.

I agree that it is confusing. Would it be desirable to get a warning when noEvent is applied to a parameter expression? What about the more general case of noEvent(…) not being a non-discrete-time expression?

hubertus65 commented 10 months ago

Note from the MAP-LIB meeting: providing a warning about unnecessary and no-effect noEvent() operators is a quality of implementation issue. Warnings would be appreciated by modelers, but are not considered mandatory. 2023-11-14. Ticket is considered ready to merge.