I often use Maxima to evaluate equations designed to model physical
systems. In this process, I derive some equation, choose some signficant
scales for the dimensional variables, and nondimensionalize the equation.
At this point it is convenient to drop out lots of very small things
when the known numerical constants indicate that they are purely small
perturbations to a more important effect.
A typical thing I'd like to do is take the equation which is expressed
as a sum of various terms, and check each term to see if it has
something of the form:
stuff*(nonsense + tinything * X + othersmallthing * Y)
where "stuff" might contain derivatives of X or Y but will not contain X
or Y by themselves.
I'd like to write a matching function which would match this type of
thing but I can't figure out how to make it work. here's an example:
'diff(X,t)*(3*gamma+6*beta + epsilon1 * X )
this should match as
[stuff='diff(X,t), nonsense=3*gamma+6*beta, tinything = epsilon1,
othersmallthing=0]
or something like that. any hints on how to get this sort of thing to
work? Everything I've tried tends to simply return false except in very
simple test cases that have nothing to do with the real world application..