-
Notifications
You must be signed in to change notification settings - Fork 1
Description
Task
Implement the computation of sensitivities for the Filippov solver.
Additional Information
There exists code that attempts to do so in branch filippov-sensitivities/66de88f99bce1486d4dcbf25ed083adaea33992e that needs convexification parameters alpha from a previous run of solving the system, but the sensitivities that it calculates are incorrect.
Currently, sensitivities in IFDIFF can be computed in several ways. One is simple external differentiation where two solutions are computed with e.g. two intitial values and then calculating a difference. The other approach is to compute sensitivities for the continuous solutions between switches and calculate an update term for the switches.
For the sign-example, the above mentioned code for filippov-sensitivities already computes wrong solutions for the interval (0.5, 1) where the solutions should actually be constant. Instead, the solution shows a constant slope of 6 which is exactly one of the two submodels of the sign-example's RHS. The update term introduces a factor of -3 so that ultimately the sensitivity is specified to be -3 in the interval (0.5, 1) instead of the true sensitivity equal to 0.
A challenge I see with the interval-wise approach is to make sure that in a Filippov-regime the original and disturbed solutions are actually Filippov-solutions. They should stay on the Filippov-manifold (or leave it where it is not attracting), but IFDIFF's sensitivity generation uses a simple continuous solver and a disturbed solution in general will not start on the Filippov-manifold.