Opened 5 years ago

Closed 4 years ago

#3878 closed enhancement (fixed)

Improve support for handling singular Jacobians in kinsol

Reported by: Christian Andersson Owned by: Christian Andersson
Priority: major Milestone: 1.17.x
Component: FMU/JMU runtime Version: trunk
Keywords: #4391. Cc:

Description (last modified by efredriksson)

We should improve our regularization strategy for when a singular Jacobian is detected. The improvement consists of being able to choose between performing a regularization and calculating the minimum norm solution.

Interesting model that needs this:
Modelica.Fluid.Examples.Tanks.TanksWithOverflow

Attachments (3)

kinsol_min_norm.patch (11.7 KB) - added by Christian Andersson 5 years ago.
kinsol_min_norm_v2.patch (12.0 KB) - added by Christian Andersson 5 years ago.
kinsol_min_norm_v3.patch (13.2 KB) - added by efredriksson 5 years ago.

Download all attachments as: .zip

Change History (18)

Changed 5 years ago by Christian Andersson

Attachment: kinsol_min_norm.patch added

comment:1 Changed 5 years ago by Christian Andersson

The patch adds the functionality. What is missing is reusing the information from the SVD performed in the lsetup in lsolve.

comment:2 Changed 5 years ago by Christian Andersson

Milestone: 1.15.x

Changed 5 years ago by Christian Andersson

Attachment: kinsol_min_norm_v2.patch added

comment:3 Changed 5 years ago by Christian Andersson

Milestone: 1.15.x1.16.x

Changed 5 years ago by efredriksson

Attachment: kinsol_min_norm_v3.patch added

comment:4 Changed 5 years ago by efredriksson

Description: modified (diff)
Keywords: #3878 added

comment:5 Changed 5 years ago by efredriksson

Keywords: #3878. added; #3878 removed

comment:6 Changed 5 years ago by efredriksson

Keywords: #4391 added; #3878. removed

comment:7 Changed 5 years ago by efredriksson

Keywords: #4391. added; #4391 removed

comment:8 Changed 5 years ago by efredriksson

Added patch v3 that does not have any merge conflicts. Observe that the condition number check is for 10e10 which is not a very good choice. This does however result in that the model Modelica.Fluid.Examples.Tanks.TanksWithOverflow simulates.

What we need is to see if the problem is singular in the current point or if the problem is structurally singular for the current state the problem is in. A suggestion would be to check if the problem is repeatedly singular then this is a hint for using minimum norm rather than regularization.

comment:9 Changed 5 years ago by efredriksson

Another idea would be to use minimum norm as default and after a solution is obtained check that it is consistent (norm(Ax - b) < tol ) and that we are not close to a zero gradient. In case one of these checks fail we will instead do a regularization of the problem and use the solution of it instead.

comment:10 Changed 4 years ago by Tove Bergdahl

Milestone: 1.16.x1.17.x

comment:11 Changed 4 years ago by Christian Andersson

changeset:8032

Updated handling of singular Jacobians in Kinsol with using minimum norm solution instead of repeated regularizations (activated using experimental mode 64). Related to ticket:3878

comment:12 Changed 4 years ago by Christian Andersson

changeset:8040

Testing the approch of using minimum norm together with regularization. Related to ticket:3878

comment:13 Changed 4 years ago by Christian Andersson

changeset:8041

Reverting the option used in the test made in changeset:8040 related to ticket:3878

comment:14 Changed 4 years ago by Christian Andersson

changeset:8065

Activated the minimum norm solution in Kinsol for repeated singular Jacobians and added tests. Related to ticket:3878

comment:15 Changed 4 years ago by Christian Andersson

Resolution: fixed
Status: newclosed

This is considered fixed as of changeset:8065 . For improvements see #4600

Note: See TracTickets for help on using tickets.