Minimizatin using Minuit minimization in 2D
Code: "func_minuit2.py". Programming language: Python
DMelt Version 1. Last modified: 12/11/2015. License: Pro
https://datamelt.org/code/cache/func_minuit2_755.py
To run this script using the DMelt IDE,
copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.
from org.freehep.math.minuit import FCNBase,MnUserParameters,MnMigrad
from java.lang.Math import *
class func(FCNBase): # define user functions
def valueOf(self, par):
return 100*(par[1]-par[0]*par[0])*(par[1]-par[0]*par[0]) + (1- par[0])*(1-par[0])
Par = MnUserParameters()
Par.add("x", 1., 0.1) # initial parameters
Par.add("y", 3., 0.1)
migrad = MnMigrad(func(), Par)
vmin = migrad.minimize()
state=vmin.userState()
print "Min value=:",vmin.fval(), "function calls=",vmin.nfcn()
print state.params()
You see the box below because you did not login.