Substitution question



Ryan,

* Ryan Krauss <ryanlists at gmail.com> [2007-12-20 23:08:22 -0600]:

> I have the following result after some calculations:
> 
> myvar:(Gact*Gth*(Ga*s^2*xbeam+thdhat))/(Gact*Gth+1);
> 

I am not sure if this is any better than what you did, but here is a
possibility: 

(%i1) myvar:(Gact*Gth*(Ga*s^2*xbeam+thdhat))/(Gact*Gth+1)$
(%i2) pickapart(myvar,2);

 .... I am skipping Maxima's (%t2), ...

(%o2) %t2*Gact*Gth/(%t3+1)

Then %t2*Gcl is the expression you want.

HTH,
Milan


> I would like to define a new variable Gcl and substitute it for the
> expression Gact*Gth/(Gact*Gth+1) in the above result.  I don't seem to
> be able to do this easily with any substitution commands.  Is there an
> easy way to do this substitution?  The only way I have found is to do
> the following:
> 
> Gcl2:Gact*Gth/(Gact*Gth+1);
> 
> myvar2:myvar/Gcl2*Gcl;
> 
> which produces the desired result:
> Gcl*(Ga*s^2*xbeam+thdhat)
> 
> but this would be a very bad approach if it were accidentally applied
> to an expression that didn't already contain the term I am trying to
> factor out.
> 
> Any thoughts?
> 
> Thanks,
> 
> Ryan
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima

--