Invalid Hessian

Hello,

This is the first time I’m working with Root.
I use the Minuit2Minimizer with kMigrad to find the roots of the first derivation of a distance function.
It worked well for the distance function between a Point and a Curve, but for the distance function between a Point and a surface the Minimizer didn’t converge for whatever starting-point I tried.
It says :

Minimization did NOT converge, Hesse is not valid

and on Printing-level 3 :

Info in : MnHesse: 2nd derivative zero for Parameter : name = y
Info in : MnHesse fails and will return diagonal matrix

Could someone please give me a hint where the Problem could be?
I checked my function, experimented with the minimizer and searched the internet, but weren’t able to find it.

Thanks

Hi,

You have probability the derivatives equal zero for the parameter y. Is y really a parameter of your model ?
If it is not, you can try to fix it or remove it from the parameter list

Lorenzo

Hi Lorenzo,

thank you for your answer.
Yes I’m pretty sure that y is a parameter of my model.

Best regards

Hi,

I changed my program. Now I’m using a MultiRootFinder.
But now there is an other Problem.
It says:

Error in ROOT::Math::GSLMultiRootFinder::Solve: Error initializing the solver

This is the Part of my program, where is use the RootFinder:

[code] const char * algo =0;
int printlevel = 3;

#ifndef R__HAS_MATHMORE
   Error("exampleMultiRoot","libMathMore is not available - cannot run this tutorial");
#else

// kHybridS,kHybrid,kDNewton,kBroyden
ROOT::Math::MultiRootFinder r(ROOT::Math::MultiRootFinder::kHybridS);
//defining the function

ROOT::Math::ParamFunctor f1(this, &helloWorldPlugin::UAbl_R); 
ROOT::Math::ParamFunctor f2(this, &helloWorldPlugin::VAbl_R); 
   
TF1 * _UAbl = new TF1("UAbl",f1);
TF1 * _VAbl= new TF1("VAbl", f2);

_UAbl->SetParameters(0,1);
_VAbl->SetParameters(0,1);

// wrap the functions
ROOT::Math::WrappedMultiTF1 g1(_UAbl,2);
ROOT::Math::WrappedMultiTF1 g2(
_VAbl,2);
r.AddFunction(g1);
r.AddFunction(g2);
r.SetPrintLevel(printlevel);

for (float j=0;j<1.1;j=j+0.1)
{
for (float i=0;i<1.1;i=i+0.1)
{
 _punkt = flaeche->getPointPercent(j,i);
 Werte++;

 cout << "--------------------------------------------------------------------" << endl;
 
 
 float Startwertu=0, Startwertv=0;
 const double *us;
 for (Startwertu=0;Startwertu<1.1;Startwertu=Startwertu+0.1)
 {
   for (Startwertv=0;Startwertv<1.1;Startwertv=Startwertv+0.1)
   {
 
     if (Startwertu > 1 && Startwertv > 1)
       {
        cout << "Kein Startwert gefunden, für den der Algorithmus konvergiert" << endl;
        break;
       }
           
     // starting point
     double x0[2]={Startwertu,Startwertv};
   
     r.Solve(x0);
     
     us = r.X();

[/code]

Did I something wrong there?

Thanks

Hi,

Do you have your full running program, so I can try to understand what exactly is the problem ?

Cheers

Lorenzo

Hi Lorenzo,

thank you for your reply.
I’m programming a Plugin for a design sytem.
So I could only give you the full source file and the header of my class.
Would this still help you?

Besides I found out that the Problem seems to be at the handover of the vector “fFunctions” to the method “InitSolver”.
“fFunctions” has size 2, but the parameter “funcVec” of “InitSolver” has size 0.

Best regards

Hi,

I would need to run the code, just looking at it often is not sufficient. I hope then you have found yourself the solution to your problem

Cheers

Lorenzo

Hi Lorenzo,

I was afraid you would say something like that.
No I’m still working on it.
Thank you for your time anyway.

Best Regards