I just learned of another way you can define your user-defined function; using the gamma function, which is already built in, instead of the factorial. Actually the gammaln function is built-in, but you can get gamma(x) by using exp(gammaln(x)).Origin's built-in function list includes a function called gammaln(x). This function represents the natural log of gamma(x). The reason why Origin provides only the natural log of gamma has to do with computational limitations. In other words, in computing gamma functions, one can quickly run off into very large numbers. To avoid this, Origin internally computes ln(gamma(x)) rather than gamma(x). (Note that this is the same reason that we don't provide a built-in factorial function in the first place...factorials also blow up very easily.)
So, using the gammaln() function, your user-defined function would be as follows:
y=(P1^x/exp(gammaln(x+1)))*exp(-P1)
The Form can now be set to equation. (Note that you don't need the Y-Script Form anymore.)
Any questions, please let me know. I'd also be happy to hear when you get it working.
Laurie Shea
Technical Support