Hi,

On Thu, Apr 08, 2010 at 03:00:41AM -0700, Dan wrote:
> Dear list,
> 
> Is there a way to rearrange equations using sympy? A really simple
> example, if I had,
> 
> y = x*2 + a
> 
> could I isolate x, to give,
> 
> x = (y - a)/2
> 

currently there is no dedicated function for this purpose. However, you
can use the following simple code snippet to obtain requested behavior:

In [1]: var('a')
Out[1]: a

In [2]: eq = Eq(y, x*2 + a)

In [3]: Eq(x, solve(eq, x)[0])
Out[3]: 
    y   a
x = ─ - ─
    2   2

> Best regards,
> 
> Dan
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "sympy" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/sympy?hl=en.
> 

-- 
Mateusz

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to