Re: own package doesnt work correctly?

*To*: mathgroup at smc.vnet.net*Subject*: [mg63154] Re: own package doesnt work correctly?*From*: albert <awnl at arcor.de>*Date*: Fri, 16 Dec 2005 07:22:06 -0500 (EST)*References*: <dnrgoc$n4o$1@smc.vnet.net>*Sender*: owner-wri-mathgroup at wolfram.com

Hi, > I started to - try to - use packages written on my own, using the > Notebook editor, marking the cells as initialization cells, and saving > the NB, producing a .m package at the same time. Using this package did > not seem to produce problems, until I wanted to use the following rule > for partial integration of a product of functions, to integrate the > delta[...] terms: > > partintrulx = > Integrate[Î´[Derivative[n_, 0][g_][x, t_]]* > Derivative[m_, 0][f_][x, t_], {x, a_, b_}] /; > n > 0 :> > (D[f[x, t], {x, m}]*Î´[D[g[x, t], {x, n - 1}]] /. > x -> b) - (D[f[x, t], {x, m}]* > Î´[D[g[x, t], {x, n - 1}]] /. x -> a) - > Integrate[D[f[x, t], {x, m + 1}]* > Î´[D[g[x, t], {x, n - 1}]], {x, a, b}] > > Using this definition from the package does not seem to work, if I copy > & paste and evaluate it in the Notebook where I want to use it, I can > use it without problems. Have I missed something about the definition > space of package-defined rules? what exactly means 'does not seem to work'? It is impossible to give you a complete explanation of what goes wrong with your definition without more information. If you use BeginPackage and alike, one candidate for problems are the symbols partintrulx, x and Î´. Are these exported from the Package? Otherwise the rule will not be matched or known as intended. Another suggestion that will make your rule more valuable and also helps to avoid problems with at least the symbols x and Î´ is the following change for the definition: partintrul[Î´_,x_]=... and use it like: expr /. partintrul[Î´,x] this way you can use the rule for expressions that use other conventions concerning symbol names... hth Albert