Errors occur when drawing hypergeometric functions in ROOT

I try to draw hypergeometric functions by the following codes:

TF2 *f1a = new TF2(“f1a”, “ROOT::Math::Conf_hypergU([1],y,z)”,1,10,1,10);
f1a->SetParameters(x,1);

unfortunately the following errors occur:

Error in TFormula::Compile: Bad numerical expression : "ROOT::Math::Conf_hype
rgU([1],y,z)"
Error in TF2::TF2: function: f1a/ROOT::Math::Conf_hypergU([1],y,z) has 0 param
eters instead of 2

I’d appreciate any comments or tutorials anyone may suggest.

Hello,

You need to give the correct function name and also you need to load the MathMore library providing the function.
Then, supposing you want to draw the hypergeometric function U(a,b,z) as function of b and z for fixed value of a = 1, you do:

gSystem->Load("libMathMore");
TF2 *f1a = new TF2("f1a", "ROOT::Math::conf_hypergU([0],x,y)",1,10,1,10); 
f1a->SetParameter(0, 1);
f1a->Draw();

Best Regards

Lorenzo

Thank you, Lorenzo. I follow you and pass the code.
A more question. How to get the ROOT codes of Spherical Harmonic function? Because i cannot get some relative information from the Section of “Mathematical Functions” of Users Guide 5.14. Thank you again.
Wenluo.

Hello,

I have not understood exactly which function code do you need.
The spherical harmonic function as defined in
mathworld.wolfram.com/SphericalHarmonic.html

can be expressed in terms of the Legendre polynomial, available in ROOT as

ROOT::Math::legendre(l,  x) 

see also
project-mathlibs.web.cern.ch/pro … af953ea682

Best Regards

Lorenzo