variables get deleted after calulation, overflow?

I tried to solve an equation and wanted to reinsert the solutions so I can check weather everything worked correctly. But after the calculations are finished, all variables and their values are gone.
Here is the code

Traceback (click to the left of this block for traceback)
File "<stdin>", line 1, in <module>
File "_sage_input_3.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("ZXEx"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/tmp/tmpDYArBS/___code___.py", line 2, in <module>
exec compile(u'eq1
File "", line 1, in <module>
NameError: name 'eq1' is not defined

I'm working with sage SageVersion 4.7.2 under win7 with Oracle VirtualBox as recommended. Thanks in advance.

Comments

Rather than using ">", to get the formatting for code right it's easiest to select the pasted code and hit the button above the text box which reads "101 010". Alternatively you can indent by four spaces.

When I tried "show(test3)", I got a different error. The latex string for test3 is *very* long, long enough that a closing brace "}" is too far away from the corresponding starting one, so latex (or jsmath) fails. I'm not sure what you expect "show" to do with such long output, anyway. For what it's worth, "show(test2)" works fine for me.

3 answers

So since I can't help on that front, maybe we can approach it in another way. I think you're trying to check to see that the n that solve returns really is a solution, which is a good idea. solve has been known to return solutions which aren't really solutions in the past. [If I'm off-base, please disregard the following.]

I'm not sure I know what your code is doing, though. I mean, if test were something like

R 2/3 == R^2 4/9

i.e. some yet-unsimplified expression but one that's true, then your procedure would give a test3 of

18*R == 12*R^2

which isn't even a number, much less 0; it'll still be an expression. At best it might give 0 == 0. In your particular case, several options work for sanity checks:

Comments

I thought if I expand the whole thing it is easier for full_simplify to collect all terms and do the simplification. And I don't get what you mean with <it doesn't="" really="" work="" as="" an="" independent="" check="">. To what are you refering with 'it'.

What I meant by it doesn't really work as an independent check is that "expand(y).full_simplify()" doesn't give you any extra information over y.full_simplify() here (unless there's a bug in Sage). As for thinking that it might be easier, you might want to try full_simplify without expanding to check..