How to plot generalized hypergeometric function in ROOT?

In summary, the conversation is about plotting a generalized hypergeometric function in ROOT using the TF1 class. The individual is having difficulty generating the function and finding a way to plot it in ROOT. Some suggested solutions include finding a closed form or making approximations, using TF1::Draw(), or creating a custom PDF in RooFit. The individual wants to use ROOT for fitting the function with experimental data.
  • #1
Sandeep Hundal
9
0
Hello everyone
I am trying to write code in ROOT.I want to plot generalized hypergeometric function pFq with p=0 and q=3 i.e I want to plot 0F3(;4/3,5/3,2;x) as a function of x using TF1 class.I am not getting how to plot this function in ROOT.Kindly help me out.
Thanks in Advance
 
Technology news on Phys.org
  • #3
Can you be more specific on which part you find difficult?
Is it generating the function? (how you define the TF1 and its parameters)
or is it drawing a TF1?
 
  • Like
Likes jedishrfu
  • #4
if it's the second, have a look at TF1::Draw()...
If it is the first, then either find a closed form that your function corresponds to (to be honest I wasn't able to find a clear answer to what that function is equal to) or make approximations (you can never have infinite sums), keeping eg the first 3 terms or 4 terms and so on (depending on what you want to do with it)...
Why would you want to use ROOT for that?
 
  • #5
ChrisVer said:
Can you be more specific on which part you find difficult?
Is it generating the function? (how you define the TF1 and its parameters)
or is it drawing a TF1?
I am not able to generate the hypergeometric function of form 0F3(;4/3,5/3,2;x).The value of function contains limit from n=0 to n=infinity.I am not able to find this function in already defined function in root.
 
  • #6
ChrisVer said:
if it's the second, have a look at TF1::Draw()...
If it is the first, then either find a closed form that your function corresponds to (to be honest I wasn't able to find a clear answer to what that function is equal to) or make approximations (you can never have infinite sums), keeping eg the first 3 terms or 4 terms and so on (depending on what you want to do with it)...
Why would you want to use ROOT for that?
I need to use root because the function I need to plot contains hypergeometric function and I need to do fitting of the parameters with experimental data.Previously ,I have used ROOT only for fitting in my analysis.So ,I was trying if I can find some way to plot this function in ROOT only.
 
  • #7
A custom PDF in RooFit could work. You don't need a sum-free closed form for the function that way, you just need a function that can be evaluated for every argument. If you fit data to it, it will take quite some time.
 

1. What is a generalized hypergeometric function?

A generalized hypergeometric function, denoted as ${}_pF_q$, is a mathematical function that is used to represent various other special functions. It is defined as a power series with a ratio of consecutive terms that has a fixed form. It is a generalization of the hypergeometric series, which is a special case where both the numerator and denominator of the ratio are finite sums.

2. What is ROOT?

ROOT is a software framework used for data analysis, visualization, and storage. It is widely used in high-energy physics and other fields of science. It provides an interactive environment for scientists to work with large amounts of data and perform complex calculations. It also offers a wide range of tools for data plotting and visualization.

3. How do I plot a generalized hypergeometric function in ROOT?

To plot a generalized hypergeometric function in ROOT, you first need to define the function using the appropriate syntax. Then, you can use the "TF1" class in ROOT to create a function object and set the parameters of the function. Finally, you can use the "Draw" function to plot the function on a canvas and customize the plot as needed.

4. Can I customize the plot of a generalized hypergeometric function in ROOT?

Yes, you can customize the plot of a generalized hypergeometric function in ROOT by using various options and functions provided by the framework. For example, you can change the color, line style, and range of the plot using the "SetLineColor", "SetLineStyle", and "SetRange" functions, respectively. You can also add a legend, title, and labels to the plot using the "AddLegend", "SetTitle", and "SetXTitle"/"SetYTitle" functions, respectively.

5. Are there any resources available for learning how to plot generalized hypergeometric functions in ROOT?

Yes, there are many online resources available for learning how to plot generalized hypergeometric functions in ROOT. The official ROOT website provides documentation, tutorials, and examples for using the framework. Additionally, there are various online forums and communities where you can ask for help and guidance from experienced users. You can also find many books and articles that cover the topic in detail.

Similar threads

  • Programming and Computer Science
Replies
22
Views
3K
  • Calculus and Beyond Homework Help
Replies
7
Views
1K
Replies
2
Views
1K
  • Programming and Computer Science
Replies
1
Views
2K
  • Programming and Computer Science
Replies
4
Views
3K
  • Programming and Computer Science
Replies
30
Views
4K
  • Programming and Computer Science
Replies
8
Views
200
  • Engineering and Comp Sci Homework Help
Replies
3
Views
1K
  • Programming and Computer Science
Replies
2
Views
4K
  • Programming and Computer Science
Replies
3
Views
931
Back
Top