Ask Your Question

Symbolic equivalence

asked 2015-04-19 11:06:05 -0600

this post is marked as community wiki

This post is a wiki. Anyone with karma >750 is welcome to improve it.

Hi all,

I define ;

sage: x,y,z=var("x y z")
sage: x=y+z
sage: x
y + z
sage: y

I want to achieve the following:

sage: y

any idea how this scenario would be possible ?

edit retag flag offensive close merge delete


I do not think I understand your question, but note you have sage: bool(y == x-z) that evaluates to True I do not understand what you exactly mean by "I want to achieve ...".

B r u n o gravatar imageB r u n o ( 2015-04-19 14:49:44 -0600 )edit

What I tried to mean is that when I query for "y" I want to get the corresponding equivalence. I want to construct the equations in such a way that Sage will be aware of this. Bool works but not exactly what I want.

y33t gravatar imagey33t ( 2015-04-20 03:06:39 -0600 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2015-04-20 04:37:16 -0600

Use an equation to encode the relations between the variables.

You can then solve the equation with respect to the variable of your choice.

An example:

sage: x,y,z = var('x y z')
sage: eq = x==y+z
sage: solve(eq, x)
[x == y + z]
sage: solve(eq, y)
[y == x - z]
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2015-04-19 11:06:05 -0600

Seen: 311 times

Last updated: Jul 15 '15