[Maxima] substituting function in diff
david.webb at noc.soton.ac.uk
Thu Jul 16 03:51:04 CDT 2009
> I dunno. I can't really recommend using inpart or other part-hacking
> How could anyone (for example, yourself next week or next year)
> figure out what is the intended effect of substinpart(foo(bar), baz, x, y,
> I'll recommend subst, funmake, op / args, and buildq instead.
The trouble is that I have to keep count. With a term like:
I want to replace each z and wv by a separate fourier expansion with a
different set of indices. Thus in the above equation, the z's need to be
transferred to functions ht(kx,ky,t) and the wv's to the corresponding
function with wavenumbers all with separate sets of indices. Thus the above
where: k3 = sqrt(kx3*kx3+ky3+ky3) and H is fixed. I would also like to
include an integral from -infinity to +infinity over kx1, kx2, ky1, ... .
However that is asking too much for the moment as I read that the resulting
delta functions are not fully supported by maxima. So for the moment I am
treating the integral as implicit.
Given the requirement, I have tried to write a well commented function to
carry out the substitution, keeping track of the indices, for expressions
containing many terms like the one above and some including d/dx's and
d/dy's. I have had a quick look at the functions you suggest. I could use
op, args and funmake with only minor changes as I only use the simplest forms
of inpart and substinpart:
operator : inpart(old_expression, 0),
new_expression : substinpart(new_function, old_expression, 1),
However for such cases I am not sure what is gained.
There may be a more elegant method using buildq - I am not into macros but
I'll read further.
Many thanks for your help,
More information about the Maxima