﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3111	Convergence issues on nonlinear equations involving der()	Francesco Casella	Willi Braun	"The nonlinear solver makes an excessively large number of iterations in some test cases where derivatives are involved as iteration variables (see, e.g., {{{ThermoPower.Examples.CISE.CISESim120501}}} or {{{ThermoPower.Test.DistributedParameterComponents.TestWaterFlow1DFEM_A}}}). In some cases involving external medium models, the solver actually fails to converge after a large number of iterations (over 1700).

A workaround for this problem has been implemented, which adds alias algebraic variables equal to the derivatives and uses them as iteration variables. It can be turned on with the debug flag {{{+d=addDerAliases}}}. Unfortunately, it breaks some models in the testsuite, but it is very beneficial in the above-mentioned test cases.

The problem still needs to be thoroughly assessed and solved in general.

One interesting question is: what is the correct scaling factor for der(x)? Obviously, the nominal value of x is not necessarily good, because the magnitude of dx/dt also depends on how fast the variable changes.

One possible option during variable step size integration is to use x_nominal/current_step_length. If the step length is short, it is likely that the variables are changing fast (possibly very fast if initial state values are given far from equilibrium), so it is reasonable to use a larger scaling factor. When the step length gets longer because the system is close to equilibrium, smaller values are employed. The main limitation of this approach is that it consider one time scale for the entire system, while an appropriate time scale should be selected for each single derivative. Also, it is not clear which value to use at initialization.

Another idea could be to employ an adaptive approach: if one can detect that the convergence is hampered by the effect of very small changes of some der() variables, their scaling factor could be reduced by a factor of 10 or something like that."	defect	accepted	high		Backend	trunk			Vitalij Ruge Lennart Ochel stefano.carli@… roberto.bonifetto@…
