Ask Your Question

drzee's profile - activity

2023-01-30 07:00:11 +0200 received badge  Famous Question (source)
2020-12-14 23:40:43 +0200 received badge  Popular Question (source)
2020-12-14 23:40:43 +0200 received badge  Notable Question (source)
2017-03-29 01:45:41 +0200 received badge  Student (source)
2017-03-25 19:07:07 +0200 received badge  Scholar (source)
2017-03-15 17:49:41 +0200 asked a question How to simplify `solve` result ($r_i$ variables)?

I want to solve a system of linear equations (more variables than equations):

var('a, b, c')
eqn = [a+b+c==4, a+b-c==5]
s = solve(eqn, a, b, c); s

The result is shown like this:

$\left[\left[a = -r_{39} + \frac{9}{2}, b = r_{39}, c = \left(-\frac{1}{2}\right)\right]\right]$

But I would like to have a simplified representation, i.e., where $r_{39}$ in the first equation is replaced by $b$. Alternatively, is there a way to reset the counter of the $r_i$ variables? Each time I evaluate the code above, the counter is incremented.