Closed modelica-trac-importer closed 7 years ago
Comment by hubertus on 10 Jun 2014 17:55 UTC Thanks for the report, this is actually the intention of the variable reference_X. I am not sure whether it shoudl be set int the library though: the problem is that the mere existence of a value for the start attribute influences a number of algorithms (e.g. state selection, afaik at least in some tools), so that there can be unintended consequences from adding it. I'll think a bit about this and might introduce your fix.
For that matter: it would probably be nicer if setting start values would have no other effects than exactly setting a start value. In that case, the fix shoudl of course be applied
Comment by fcasella on 31 Aug 2015 11:24 UTC I got a similar request on Stackoverflow (http://stackoverflow.com/questions/31644258/fluidport-connector-with-start-values-for-composition) which suggests adding reference_X as a default start value for connector variables.
In fact, a better choice would be to add start = reference_X to MassFraction type definition of the medium, which would cover all the cases at once.
I am also unsure that this might trigger negative consequences on existing models. Maybe it would be worth trying on the existing testuites. What do you think?
Comment by hubertus on 12 Dec 2015 22:53 UTC Francesco, your ideas does not work because the mass fraction type is not a vector. It maybe should be and should be used, but that would not be an allowed change for a minor version number update.
Comment by hubertus on 12 Dec 2015 23:03 UTC Fixed in trunk in 67ba73b85115cf06cc6707d83b8dd1c55253335a
Changelog modified by hubertus on 12 Dec 2015 23:03 UTC Fixes missing start value for composition vector in ThermodynamicState
Modified by beutlich on 13 Dec 2015 08:26 UTC
Changelog modified by beutlich on 13 Dec 2015 08:26 UTC Fixed missing start value for composition vector in ThermodynamicState
Comment by fcasella on 14 Dec 2015 13:55 UTC Replying to [comment:3 hubertus]:
Francesco, your ideas does not work because the mass fraction type is not a vector. It maybe should be and should be used, but that would not be an allowed change for a minor version number update.
You're right, I overlooked this.
Reported by filip.jorissen on 10 Jun 2014 16:55 UTC I have a model where 'X[2]' of a moist air was chosen by Dymola as the iteration variable of a nonlinear system of equations. The default guess value is 0, which causes an error:
I solved this by setting the initial guess value for ThermodynamicState.X equal to reference_X. I suggest to implement this by default in MSL and possibly also for p, T and h.
The hotfix for my own package was:
Migrated-From: https://trac.modelica.org/Modelica/ticket/1509