Skip to content
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

Nonlinear function blocks in Modelica.Blocks should use homotopy for initialization #1012

Closed
modelica-trac-importer opened this issue Jan 14, 2017 · 6 comments
Assignees
Labels
enhancement New feature or enhancement L: Blocks Issue addresses Modelica.Blocks
Milestone

Comments

@modelica-trac-importer
Copy link

Reported by fcasella on 8 Mar 2013 15:25 UTC
The Modelica.Blocks.Nonlinear.Limiter model contains the following code:

  if initial() and not limitsAtInit then
     y = u;
     assert(u >= uMin - 0.01*abs(uMin) and 
            u <= uMax + 0.01*abs(uMax),
           "Limiter: During initialization the limits have been ignored.\n"+
           "However, the result is that the input u is not within the required limits:\n"+
           "  u = " + String(u) + ", uMin = " + String(uMin) + ", uMax = " + String(uMax));
  else
     y = smooth(0,if u > uMax then uMax else if u < uMin then uMin else u);

this helps the convergence of the nonlinear solver at initialization by not taking into account of the nonlinearities, if they are actually inactive at initialization; otherwise, a slightly messy situation ensues (-> when the simulation starts, the found initial solution is no longer a consistent solution of the dynamic problem).

A cleaner implementation in Modelica >= 3.2 would be:

y = homotopy(
  actual = smooth(0,if u > uMax then uMax else if u < uMin then uMin else u),
  simplified = y);

Similar arguments hold for VariableLimiter and DeadZone.


Migrated-From: https://trac.modelica.org/Modelica/ticket/1012

@modelica-trac-importer modelica-trac-importer added bug Critical/severe issue L: Blocks Issue addresses Modelica.Blocks labels Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Modified by fcasella on 11 Mar 2013 13:42 UTC

@modelica-trac-importer
Copy link
Author

Comment by otter on 28 Mar 2013 11:19 UTC
This is a good idea. However, before introducing it in MSL, one or more concrete test cases are needed where this can be evaluated that it works as expected.

@modelica-trac-importer
Copy link
Author

Modified by otter on 18 Apr 2013 15:15 UTC

@modelica-trac-importer modelica-trac-importer added enhancement New feature or enhancement and removed bug Critical/severe issue labels Jan 14, 2017
@modelica-trac-importer
Copy link
Author

Modified by beutlich on 6 Oct 2015 21:13 UTC

@modelica-trac-importer
Copy link
Author

Comment by otter on 11 Dec 2015 14:07 UTC
Fixed in 995e959 as suggested.

@modelica-trac-importer
Copy link
Author

Changelog modified by otter on 11 Dec 2015 14:07 UTC
Numerics improved for the Nonlinear blocks Limiter, VariableLimiter, DeadZone by using the homotopy operator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement L: Blocks Issue addresses Modelica.Blocks
Projects
None yet
Development

No branches or pull requests

2 participants