Help with the Procedure
elle
I am extremely new user to IGOR. I am trying to plot a graph exactly as in the attachment (but only for a cylinder). The calculated form factor for the hard cylinder is given in the attachment as well. When I try to write my own procedure, it doesn't work then today, I found this example of code in IGOR Help Browser. If I want to use this code, where should I put the form factor equation (as in attachment) and how can I define all the variables? There's is also a first order Bessel function in the equation.How am i supposed to define it in this code? I really need a help because this is the first time I am using IGOR and I am not familiar with coding. Thank you in advance for the help.
Example of code:
make/N=100 Q_wave
Q_wave=0.001+p/100
//will create 100 points wave with values 0.001 to 1) values
Make/O/D R_FF
//makes some place for form factor
make R_dist
R_dist=50
//or
//make/N=3 R_dist
//R_dist={10,50,100}
//creates R distribution and sets values
IR1T_GenerateGMatrix(R_FF,Q_wave,R_dist,powerFct,"form factor name",param1,param2,param3,param4,param5, "", "")
//Note, above lines belong on one line together!
// replace powerFct with 0, 1,or 2!
// replace "form factor name" with name of form factor you want to use
Display R_FF vs Q_wave
Call the function by executing
FormFactor('value of L times roh', 'value of radius')
(e.g.,FormFactor(2,50)
) in the command line.It is of course also possible to input L and roh separately, but you might try to modify the code as a small challenge yourself. ;)
Variable Scale, radius // scale, radius as input (scale = L*roh)
Make/O/D/N=1000 FF_data // create data with 1000 points
SetScale/P x, 0.001, 0.001, FF_data // x scaling! No need for separate x data
FF_data = 2*Pi*Scale*radius/x*BesselJ(1,radius*x) // Bessel function built into Igor
End
I recommend reading at least the 'Getting Started' chapter, especially the 'Guided Tour', in the manual to get a feel of how Igor works.
June 10, 2014 at 12:20 am - Permalink
June 10, 2014 at 04:23 pm - Permalink
Cheers,
Elle
June 10, 2014 at 05:34 pm - Permalink
June 10, 2014 at 06:19 pm - Permalink