--- edA-qa mort-ora-y <eda-qa@disemia.com> wrote:
> I want to achieve the following:
>
> Given: (x+y+z)*c
> Simplify Where: a=x+y
> Result: (a+z)*c
>
> Playing with scsimp and ratsimp I'm unable to do this type of
> operation. I don't know which function I should be calling.
I'm not sure either - it looks like you probably want some version of
subst, but I don't know how the details would work. I've yet to get
the hang of the more subtle points of the various subst commands.
(This type of thing has its own chapter in the Macsyma docs, IIRC, and
it probably will at some point in our user docs as well. It's not a
simple issue.)
> Ultimately I want to be able to group a lot of terms together in an
> equation (as they are constants which can be precalculated). That
> is, a larger example:
>
> q:(a+b/c+i)/(a+b)-(d-e-f)*i;
> constreplace(q,a,b,c,d,e,f)
> c1 = ...
> c2 = ...
> q = c1 + c2 * i
>
> Where c1 and c2 will be appropriately defined to make the equation
> equivalent to the original.
Are you looking to get an expression with the real and imaginary parts
of an expression divided out? This can be done (at least for the
example above) by the following:
(%i1) q:(a+b/c+%i)/(a+b)-(d-e-f)*%i;
b
- + a + %I
c
(%o1) ---------- - %I (- f - e + d)
b + a
(%i2) c1: realpart(%o1);
b
- + a
c
(%o2) -----
b + a
(%i3) c2: imagpart(%o1);
1
(%o3) f + e - d + -----
b + a
(%i4) q : c1 + c2 * %i;
b
- + a
1 c
(%o4) %I (f + e - d + -----) + -----
b + a b + a
If what you're doing doesn't involve splitting real and imaginary
numbers out of an expression, then I don't know. Is there substitution
a guru in the house?
CY
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail