modelica / ModelicaSpecification

Specification of the Modelica Language
https://specification.modelica.org
Other
95 stars 41 forks source link

Clarification on positiveMax implementation #3508

Open casella opened 2 weeks ago

casella commented 2 weeks ago

The sophisticated implementation of positiveMax() in Section 15.2 contains the following definition:

 eps := relativeTolerance*min(nominal(mj.c.m_flow)); 

It's not clear what is the meaning of min(nominal(mj.c.m_flow)). From what I remember, the idea was to consider the minimum nominal attribute of all flows involved in the connection set, so I guess this should be min(nominal(mj.c.m_flow) for j in 1:N), or possibly min(nominal(mj.c.m_flow) for j in cat(1, 1:i-1, i+1:N)) if we want to exclude the nominal attribute of the flow of the i-th connector, which is irrelevant when computing inStream().

@HansOlsson can you please confirm?

Keeping @perost in the loop.

HansOlsson commented 2 weeks ago

I'm not sure; I think one possibility was nominal(mj.c.m_flow); I don't see why excluding the nominal for the flow itself would be good.

What I can see is that these formulas aren't very clear (some variables have subscripts - some depend on them and don't have subscripts), and they should be cleaned up.

What I can see are some major considerations: