Integration wrt to required variable
nik09
My problem should have been solved quite simply but I have tried many times and I don't seem to get anywhere. I am a rookie with Igor.
I have a function BY of a variable Zm (stored as separate waves of the same length). I would like to integrate BY wrt to Zm and plot a result as a function of Zm. But when I used "integrate" command from a menu it did not give an option to chose integration variable but instead used something called "_calculated_".
Also tried defining X througn "Integrate BY/X = Zm/D = BY_INT" but it said X data does not match Y data in length or type.
I would really appreciate if someone would point me in the right direction.
Nik.
At the command line ...
print numpnts(BY); print numpnts(Zm)
(the two values MUST match)
print numtype(BY); print numtype(Zm)
(the two values should also match)
AND/OR ...
edit BY, Zm .... (and then look in the table to see they are the same number of points)
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
January 20, 2010 at 08:53 am - Permalink
Thanks for the reply jjweimer.
I have made the check and they seem to be exactly the same, here's the result:
---
print numpnts(BY); print numpnts(Zm)
50001
50001
•print numtype(BY(1)); print numtype(Zm(1))
0
0
---
January 21, 2010 at 02:15 am - Permalink
...this is what the manual says:
"......Rectangular integration (/METH=0 or 2) requires an X wave having one more point than
the number of elements in the dimension of the Y wave being integrated. ..."
Or chose a different algorithm in the integrate menu - then it should work.
Cheers
Christian
January 21, 2010 at 04:34 am - Permalink
Thanks for help ChrLie, it works great, I didn't know about this one!
Another way I was shown (just share it, maybe it will be useful for some) is to use X scaling of my BY wave. this way "_calculated_" can be used as an Xwave with a correct result.
January 21, 2010 at 04:54 am - Permalink