If using method = :newton with linesearch=LineSearches.Static(), adds an option to supply a function to modify Newton steps eg to restrict step length or to restrict to a region. This makes it possible to include problem-specific constraints (eg from a physical or chemical system) to increase robustness.
Adds an additional argument apply_step! (default value (x, x_old, newton_step)->(x .= x_old .+ newton_step)) to
define the function used to update the x value after the Newton iteration.
For example, apply_step! = (x, x_old, newton_step)->(x .= x_old .+ newton_step; x .= max.(x, 1e-80))
will enforce a constraint x[i] >= 1e-80 to maintain positive concentrations for a chemical kinetics problem.
If using
method = :newton
withlinesearch=LineSearches.Static()
, adds an option to supply a function to modify Newton steps eg to restrict step length or to restrict to a region. This makes it possible to include problem-specific constraints (eg from a physical or chemical system) to increase robustness.Adds an additional argument
apply_step!
(default value(x, x_old, newton_step)->(x .= x_old .+ newton_step)
) to define the function used to update thex
value after the Newton iteration.For example,
apply_step! = (x, x_old, newton_step)->(x .= x_old .+ newton_step; x .= max.(x, 1e-80))
will enforce a constraintx[i] >= 1e-80
to maintain positive concentrations for a chemical kinetics problem.