Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math.symbolic.independent

Topic: How to easily set up all coefficients to be positive in Solving an
integer equation using Mathematica?

Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Rex

Posts: 23
Registered: 10/13/10
How to easily set up all coefficients to be positive in Solving an
integer equation using Mathematica?

Posted: Jan 15, 2012 9:39 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Given a vector `A=[a_1, a_2, a_3,...,a_n]`, where a_i are integers,
now
solving an equation
`?a_i * x_i=0` with all x_i>=0, and x_i to be integers.

Using Mathematica, we can write some code like this
`Solve[A . Table[x[i], {i, n}] = 0 && Table[x[i] > 0, {i, n}],
Integers]`

But the conditions above `Table[x[i] > 0` is not rightly coded. That
should be
`x[1]>0 && x[2]>0 && x[3]>0 &&...x[n]>0`
Is there any easy way to write such code?




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.