Error in procedure
elle
I try to plot a graph of a form factor and when i try to compile the procedure, I get a Syntax Error "expected right parenthesis." for this equation:
(2*Pi*L*(radius2/q_wave*BesselJ(1,radius2*q_wave)+(radius1/q_wave*BesselJ(1,radius1*q_wave)))^2
I have tried to change a few things but it still doesn't work. Can anyone please help me with this? Thank you in advance.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
July 10, 2014 at 03:07 pm - Permalink
If this is literally the equation entered in your Igor function, then there is one fewer right ")" parenthesis than left. Looks like you need another after "^2".
July 10, 2014 at 03:44 pm - Permalink
Hi Jim,
Attached is the file of the procedure that i wrote.
July 10, 2014 at 04:10 pm - Permalink
Exactly. Or remove the leading parenthesis. But only you can know whether the formula is computing the right thing:
Variable radius1,radius2,L
Make/O/D/N=201 FF_cone
Wave q_wave, FF_cone
FF_cone = 2*Pi*L*(radius2/q_wave*BesselJ(1,radius2*q_wave)+(radius1/q_wave*BesselJ(1,radius1*q_wave)))^2
End
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
July 17, 2014 at 09:52 am - Permalink
Curiously, not in procedures, but when you use a wave dependency (as in "w := k0 * x^2", or whatever), then Igor doesn't seem to warn you that matching parentheses are missing, and you can get weird results.
-Matthew
July 18, 2014 at 01:23 pm - Permalink