On 01/06/13 13:46, Dillon wrote:
> Hello,
> 
> I am working on using Sage to help solve a KCL analysis for a
> circuit.
> 
> Sage is working great, I've managed to get it to produce the
> expressions I need. For future circuit analysis, it would be very
> helpful to be able to have Sage factor an expression in terms of a
> few variables that I specify. For example, if I say that I want the
> expression in terms of x1...xn, I would like an expression of the
> form:
> 
> x1*(...) + ... + xn*(...)
> 
> where (...) is a nasty (but useful) sub-expression.
> 
> Is this possible?
> 

If your expressions are tame enough, you can do this by calling expand()
and collect() repeatedly on your expression.

If you have mixed terms (say, x1,x2 appear in the same term and you have
a preference for which one to factor) you can hack it together with
repeated factorings and subtractions.

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
Visit this group at http://groups.google.com/group/sage-support?hl=en.


Reply via email to