Opened 4 years ago

Last modified 4 years ago

#6408 assigned defect

Wrong start values for NLS with homotopy

Reported by: trabuzin@… Owned by: Andreas Heuermann
Priority: high Milestone: NeedsInput
Component: *unknown* Version: 1.18.0-dev
Keywords: Cc: Francesco Casella

Description

Hi,

I have noticed that with some of my power system models the nonlinear solver gets wrong start values for the iteration variables. I think the culprit is the inclusion of homotopy in the model.

I attached a package with two network models in the examples package. In one of them, there is no homotopy and in the other I included homotopy just to demonstrate the issue (even though it is not needed). Homotopy is introduced in line 280 of CompositeLoadWithDummyHomotopy.

The parameter of interest that becomes an iteration variable for the nonlinear solver is w_0. The start value of this parameter is assigned through another parameter omega_0 which is explicitly defined to be 1.

I also attached the two screenshot which show the difference in the start values of w_0. In the case with homotopy, the start value of w_0 is zero, while without homotopy it is correctly set to 1.

I tried this out on OM 1.17-beta3 and the nightly build from yesterday.

Attachments (5)

BugWithHomotopy.mo (21.4 KB ) - added by Tin Rabuzin <trabuzin@…> 4 years ago.
Example of the bug
screenshot.png (15.3 KB ) - added by Tin Rabuzin <trabuzin@…> 4 years ago.
Screenshot of different start values
ModelWithoutHomotopy.mo (311 bytes ) - added by Tin Rabuzin <trabuzin@…> 4 years ago.
A small model without homotopy
ModelWithHomotopy.mo (336 bytes ) - added by Francesco Casella 4 years ago.
A small model with homotopy
ModelWithHomotopy2.mo (370 bytes ) - added by Francesco Casella 4 years ago.

Download all attachments as: .zip

Change History (9)

by Tin Rabuzin <trabuzin@…>, 4 years ago

Attachment: BugWithHomotopy.mo added

Example of the bug

by Tin Rabuzin <trabuzin@…>, 4 years ago

Attachment: screenshot.png added

Screenshot of different start values

by Tin Rabuzin <trabuzin@…>, 4 years ago

Attachment: ModelWithoutHomotopy.mo added

A small model without homotopy

comment:1 by Tin Rabuzin <trabuzin@…>, 4 years ago

I think I narrowed it down even further which you can observe in the attached files ModelWithHomotopy.mo and ModelWithoutHomotopy.mo.

comment:2 by Tin Rabuzin <trabuzin@…>, 4 years ago

Also, the parameter a gets the correct start value in ModelWithHomotopy if the compiler flag is set to --replaceHomotopy=actual.

comment:3 by Francesco Casella, 4 years ago

@AnHeuermann, there are several fishy things happening here.
.
First of all, when I run ModelWithHomotopy, not only a starts from 0 instead of 1, but also, despite seeing this message

Model contains homotopy operator:
Use adaptive homotopy method to solve initialization problem. 
To disable initialization with homotopy operator use "-noHomotopyOnFirstTry".

there are no values of lambda reported, and eventually the solver says

The initialization finished successfully without homotopy method.

which obviously contradicts the first statement.

I though this may have been because there are no nonlinear implicit equations influenced by homotopy, so it may be skipped. This in fact could be a reasonable optimization.

However, consider ModelWithHomotopy2, where the result of homotopy, namely y, influences how the implicit equation for z is solved so I would expect to see a global homotopy transformation. Also in this case I get a zero start value on a, those two contradictory statements, and homotopy is not used at all.

I wonder if these two issues, namely unset start value and not-executed global homotopy transformation, are related.

Could you please have a look?

by Francesco Casella, 4 years ago

Attachment: ModelWithHomotopy.mo added

A small model with homotopy

by Francesco Casella, 4 years ago

Attachment: ModelWithHomotopy2.mo added

comment:4 by Francesco Casella, 4 years ago

Owner: changed from somebody to Andreas Heuermann
Status: newassigned
Note: See TracTickets for help on using tickets.