Skip to main content
2 of 2
edited tags; edited title

FindMinimum and WhenEvent

Is there any way to incorporate WhenEvent[] into the FindMinimumfunction ?

I'm currently trying to minimize an interpolating function with FindMinimum (since the origional function is to cumbersome to use). So the command that I use is:

$\Delta$ /. Last[FindMinimum[ interpolation[$\Delta$], {$\Delta$,$\Delta_0$}]]

Where $\Delta$ is my interpolation variable and $\Delta_0$ is my first guess for the minimum (based on the list I used to make the interpolation).

Now in general, when this value for $\Delta$ becomes smaller than some tolerance (I call this variable "tol") it should become equal to zero. So I try to add

WhenEvent[$\Delta<\mathrm{tol}$,$\Delta\rightarrow 0$]

Now wherever I place this command in the FindMinimum procedure, it gives different kinds of errors. I don't know if there is any way to overcome these errors and just get the program to do what I want?

Nick
  • 447
  • 3
  • 13