Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here is some progress, but not very much:

sage: var('a b c d e n k')
(a, b, c, d, e, n, k)
sage: eqs = (
....: a + b == n*(c + d),
....: b == k*e,
....: a >= 80,
....: b >= 1000,
....: c >= 20,
....: d >= 40,
....: a + b <= 2000,
....: c + d <= 90
....: )
....:
sage: result = solve(eqs, (a,b,c,d,e,n,k)) # takes a while; be patient
sage: for r in result:
....:    print "--"
....:    for t in r:
....:        print "    ", t

# ... huge amount of output ...

I tried constraining n and k to take on integer values via:

sage: assume(n, "integer")
sage: assume(k, "integer")

... before calling solve, but it does not help.

click to hide/show revision 2
corrected for typo in original post

Here is some progress, but not very much:

sage: var('a b c d e n k')
(a, b, c, d, e, n, k)
sage: eqs = (
....: a + b == n*(c + d),
....: b == k*e,
k*d,
....: a >= 80,
....: b >= 1000,
....: c >= 20,
....: d >= 40,
....: a + b <= 2000,
....: c + d <= 90
....: )
....:
sage: result = solve(eqs, (a,b,c,d,e,n,k)) (a,b,c,d,n,k)) # takes a while; be patient
sage: for r in result:
....:    print "--"
....:    for t in r:
....:        print "    ", t

# ... huge amount of output ...

I tried constraining n and k to take on integer values via:

sage: assume(n, "integer")
sage: assume(k, "integer")

... before calling solve, but it does not help.