Ask Your Question
2

Getting symbolic variable without resetting python variable.

asked 2016-04-01 23:11:17 +0200

rlg23 gravatar image

When calling

 var('x')

the variable x gets set to the symbolic expression x just as if we had called

x = var('x')

In particular, any value stored in x is deleted. Is there a way to get a symbolic variable without setting the python variable to be that symbolic variable? I'm not super familiar with how sage handles symbolic variables so this might be unreasonable.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2016-04-02 00:52:40 +0200

vdelecroix gravatar image

updated 2016-04-02 00:53:10 +0200

Yes there is

sage: t = 19
sage: my_variable = SR.var('t')
sage: t
19
sage: my_variable
t

The behavior of var is very strange and controversial.

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

Stats

Asked: 2016-04-01 23:11:17 +0200

Seen: 268 times

Last updated: Apr 02 '16