Loading [MathJax]/jax/output/HTML-CSS/jax.js

First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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=1ab+1,y=bab+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+b1,y=ba+b1]]

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.

click to hide/show revision 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=1ab+1,y=bab+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+b1,y=ba+b1]]

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.

click to hide/show revision 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=1ab+1,y=bab+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+b1,y=ba+b1]]

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.