On Jul 29, 6:01 pm, Johannes <dajo.m...@web.de> wrote:
> Hi list,
> i try to solve a linear equation in ZZ in the variables w_i:
>
> sage: variables = [var("w" + str(i),domain=ZZ)for i in range(s.nvertices())]
> sage: eq
> (w0 + w1 + w2 - 14*w3, w1 + 2*w2 - 8*w3, 2*w2 - 3*w3)
> sage: result
> [w0 == 15/2*r548, w1 == 5*r548, w2 == 3/2*r548, w3 == r548]
>
> up to here it's ok, but now im lookin for the smalest integer r548 > 0
> solving this equatoins. in other words, the smalest r548 such that every
> wi is in ZZ.
> How can i do this?

This sounds sort of like integer programming, which is very tough in
general.  Although in this case r548=2 looks like it would give all
integer wi, just by inspection.  Presumably this wouldn't always be
possible with whatever you are looking at, though.  I suppose one
could just do

r548=1
while all wi not integers:
    r548+=1

or something, though obviously that's a hack.

Another issue is that solve() does not actually take the domain into
account necessarily.  (In fact, I'm not sure what var(domain=blah)
does, but someone else may want to clarify that.)  At any rate, Maxima
(which does our solving) is explicitly designed not to take
assumptions of this kind into account - though, again, I don't know
that domain=ZZ would pass that on to Maxima anyway; presumably this is
a Pynac thing.

Does anyone else have ideas for this?
- kcrisman

-- 
To post to this group, send email to sage-support@googlegroups.com
To unsubscribe from this group, send email to 
sage-support+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to