﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
5619	Homotopy-based initialization does not use updated parameter values when re-simulating	BuettR51	Karim Adbdelhak	"It is not currently possible to obtain results for updated parameters in compiled models that require homotopy-based initialization. Instead, homotopy-based initialization always uses the default parameter values that the model was compiled with.

Please consider the following test case of a modified van der Pol oscillator:

{{{
model TestInitialization ""Simple model to demonstrate homotopy bug""
   parameter Real A = 0.8;
   Real x;
   Real xPrime;
   Real mu;

initial equation
   x = 0.2;
   der(x) = -1;
equation
   der(x) = xPrime;
   mu = homotopy(0.1*x*der(x) + 0.1*der(xPrime), 0.1*der(x));
   der(xPrime) + mu*A*(x*x - 1)*xPrime + x = 0;
end TestInitialization;
}}}

Steps to reproduce the problem:
1. Simulate TestInitialization using {{{–homotopyOnFirstTry}}}. 
2. Set the parameter A to 0.1 by using the Variables Browser, modifying Model_init.xml, using {{{–override}}}, or using {{{–overrideFile}}}. 
3. Re-simulate the compiled model with {{{-homotopyOnFirstTry}}} using any method, then examine the results. The value of A will not be updated and the results will be the exact same as if they were run using A = 0.8. (If using the Variables Browser to re-simulate, the displayed value of A will be 0.1, but plotting it will show that it is actually 0.8 instead). 

Performing the same steps without {{{-homotopyOnFirstTry}}} results in the parameter being updated as expected.

This behavior is present in more complicated models as well. It practically prohibits obtaining useful results from large-scale parameter sweeps where conventional initialization is likely to fail.

Thank you."	defect	closed	blocker	1.16.0	Initialization	v1.13.2	fixed		Adeel Asghar Karim Adbdelhak Lennart Ochel
