0
$\begingroup$

I am currently running a command: NMaximize[{expression, constraints}, {x1, ..., xn}] that takes quite a while to converge. Is there a way to run Nmaximize in a verbose way such that every say 10 seconds, it outputs the current best maximum value?

$\endgroup$

1 Answer 1

1
$\begingroup$

Actually, I realised the answer after posting the question. I did this and it worked:

NMaximize[{f[x], constraints}, x, StepMonitor :> (Print["step x = ", {x}, ", f[x]=", f[x]]; Pause[.1])]

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.