# [Maxima] using 'depends' and 'assume' on arrays

Todd Hay haymeister at gmail.com
Thu Jul 5 09:56:55 CDT 2007

```I'm working on a physical modeling problem concerning N pulsating and
translating spheres in a liquid. In general each sphere has a time-dependent
radius (R) and position (X) and from a programming point of view it would be
very convenient to group the radii and positions of the spheres in arrays so
that I can iterate through the arrays to create new quantities for each
sphere. For example:

N: 2\$
array(R, N)\$
array(X, N)\$
depends([R, X], t)\$

velocityPotential(i):= -R[i]^2*diff(R[i], t)/r[i] -
R[i]^3*diff(X[i],t)/r[i]^2\$

for i: 1 thru N do (
vp[i]:= velocityPotential(i))\$

However, sometimes I need to assume that the radius of a particular sphere
doesn't change with time so that diff(R[i],t) = 0 for some particular value
of i. I've tried to do this by using the 'assume' function:

assume(equal(diff(R[i],t), 0))

but this doesn't seem to work for further applications of 'diff', maxima
still gives nonzero values for diff(R[i],t). I've also tried to use
'depends' this way ( depends(R[j],t)  for j not equal to i) but this
function doesn't work on arrays. Can anyone point me to a solution? I'm very
new to maxima, I'm sorry if this is an obvious question but I've looked
through the manual and mailing list with no success.

Thanks,

--
Todd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20070705/c798f506/attachment.htm
```