I found two issues. The first and minor one is that Ib
is undefined. I am sure that this happened only in the course of copying the code to this site. If I set Ib = 1
in my copy of the code, then at least ParametricNDSolveValue
runs without any issues.I found two issues. The first and minor one is that Ib
is undefined. I am sure that this happened only in the course of copying the code to this site. If I set Ib = 1
in my copy of the code, then at least ParametricNDSolveValue
runs without any issues.
When I call FindFit
afterwards, it complains and sends me the same error message as yours. Note that Abs'
appears in the errror message. The point is that FindFit
tries to apply standard gradient-based techniques for finding the parameters with least squares error. But Mathematica does not know what the derivative of Abs
should be (basically it was made so because Abs
is not holomorphic). Replace Abs
by RealAbs
and this issue gets settled---only to produce another one (ParametricNDSolveValue::smpf
). I guess we have to pass suitable Method
settings to NDSolve
in order to account for some discontinuities in the ODE but I have no idea how to do that. Maybe somebody else can tell how to fix that...