Consider a system of linear equations with an absolute value:
%display typeset
var('x y a b')
f=[1+y-a*abs_symbolic(x)==x, b*x==y]; f
[−a|x|+y+1=x,bx=y]
We attempt to solve the system assuming x>0 and then x<0:
assume(x>0)
solve(f, [x, y])
[[x=1a−b+1,y=ba−b+1]]
# to avoid conflict with the previous assumption (use `assumptions()` to list all current symbolic assumptions)
forget()
assume(x<0)
solve(f, [x, y])
[[x=−1a+b−1,y=−ba+b−1]]
As you point out, there seems to be a bug if we do this straightforwardly:
forget()
solve(f, [x, y])
gives TypeError: cannot coerce arguments: no canonical coercion from <type 'list'> to Symbolic Ring
.
![]() | 2 | No.2 Revision |
Consider a system of linear equations with an absolute value:
%display typeset
var('x y a b')
f=[1+y-a*abs_symbolic(x)==x, b*x==y]; f
[−a|x|+y+1=x,bx=y]
We attempt to solve the system assuming x>0 and then x<0:
assume(x>0)
solve(f, [x, y])
[[x=1a−b+1,y=ba−b+1]]
# use `forget()` to avoid conflict with the previous assumption (use `assumptions()` to list see all current symbolic assumptions)
forget()
assume(x<0)
solve(f, [x, y])
[[x=−1a+b−1,y=−ba+b−1]]
As you point out, there seems to be a bug if we do this straightforwardly:
forget()
solve(f, [x, y])
gives TypeError: cannot coerce arguments: no canonical coercion from <type 'list'> to Symbolic Ring
.
![]() | 3 | No.3 Revision |
Consider a system of linear equations with an absolute value:
%display typeset
var('x y a b')
f=[1+y-a*abs_symbolic(x)==x, b*x==y]; f
[−a|x|+y+1=x,bx=y]
We attempt to solve the system assuming x>0 and then x<0:
assume(x>0)
solve(f, [x, y])
[[x=1a−b+1,y=ba−b+1]]
# use `forget()` to avoid conflict with the previous assumption (use `assumptions()` to see all current symbolic assumptions)
forget()
assume(x<0)
solve(f, [x, y])
[[x=−1a+b−1,y=−ba+b−1]]
As you point out, there seems to be a bug if we do this straightforwardly:
forget()
solve(f, [x, y])
gives TypeError: cannot coerce arguments: no canonical coercion from <type 'list'> to Symbolic Ring
.