Opened 4 years ago

Last modified 4 years ago

#6408 assigned defect

Wrong start values for NLS with homotopy

Reported by: trabuzin@… Owned by: AnHeuermann
Priority: high Milestone: NeedsInput
Component: *unknown* Version: 1.18.0-dev
Keywords: Cc: 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 casella 4 years ago.
A small model with homotopy
ModelWithHomotopy2.mo (370 bytes) - added by casella 4 years ago.

Download all attachments as: .zip

Change History (9)

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

Example of the bug

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

Screenshot of different start values

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

A small model without homotopy

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

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

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

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

comment:3 Changed 4 years ago by casella

@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?

Changed 4 years ago by casella

A small model with homotopy

Changed 4 years ago by casella

comment:4 Changed 4 years ago by casella

  • Owner changed from somebody to AnHeuermann
  • Status changed from new to assigned
Note: See TracTickets for help on using tickets.