Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Symbolic expression not scriptable in Solve

D = polytopes.dodecahedron()
DH = D.Hrepresentation()
X = list(SR.var('x_%i' % i) for i in (0..2))
Ineq=[[el.A()*vector(X) >=el.b()] for el in DH]
show(Ineq[0][0])
sol=[solve(Ineq[i][0],x[0]) for i in range(len(Ineq))]

This is nearly a code send by Slelievre as an answer to a former question. In his case it works nicely. But I need to use indexed variables. And in my case Sagemath complains that 'sage.symbolic.expression.Expression' object is not subscriptable'. Why ?

Symbolic expression not scriptable in Solve

D = polytopes.dodecahedron() DH = D.Hrepresentation() X = list(SR.var('x_%i' % i) for i in (0..2)) Ineq=[[el.A()*vector(X) >=el.b()] for el in DH] show(Ineq[0][0]) sol=[solve(Ineq[i][0],x[0]) sol=[solve(Ineq[i][0],x[1]) for i in range(len(Ineq))]

range(len(Ineq))]

This is nearly a code send by Slelievre as an answer to a former question. In his case it works nicely. But I need to use indexed variables. And in my case Sagemath complains that 'sage.symbolic.expression.Expression' object is not subscriptable'. Why ? the problem doesn't seem to come from Ineq[0][0] but from the variables ?

Symbolic expression not scriptable in Solve

Consider the following code:

D = polytopes.dodecahedron()
 DH = D.Hrepresentation()
 X = list(SR.var('x_%i' % i) for i in (0..2))
    Ineq=[[el.A()*vector(X) Ineq = [[el.A()*vector(X) >=el.b()] for el in DH]
 show(Ineq[0][0])
    sol=[solve(Ineq[i][0],x[1]) sol = [solve(Ineq[i][0], x[1]) for i in range(len(Ineq))]

range(len(Ineq))]

This is nearly a code send by Slelievre as an answer to a former question. question. In his case it works nicely. But I need to use indexed variables. variables. And in my case Sagemath complains that 'sage.symbolic.expression.Expression' 'sage.symbolic.expression.Expression' object is not subscriptable'. Why ? the problem doesn't seem to come come from Ineq[0][0] but from the variables ?variables?

Symbolic expression not scriptable in Solve

Consider This is a follow-up to

The answer by @slelievre to that question works nicely, but I need to use indexed variables.

This variation of the following code:code does not work for me:

D = polytopes.dodecahedron()
DH = D.Hrepresentation()
X = list(SR.var('x_%i' % i) for i in (0..2))
Ineq = [[el.A()*vector(X) >=el.b()] for el in DH]
show(Ineq[0][0])
sol = [solve(Ineq[i][0], x[1]) for i in range(len(Ineq))]

This is nearly a code send by Slelievre as raising an answer to a former question. In his case it works nicely. But I need to use indexed variables. And in my case Sagemath complains that 'sage.symbolic.expression.Expression' error saying

'sage.symbolic.expression.Expression' object is not subscriptable'. Why ? subscriptable

Why? the problem doesn't seem to come come from Ineq[0][0] but from the variables?