Re: [sympy] variable with binary values?

2013-11-25 Thread Nikolaus Sonnenschein
Hi Kevin, Out of curiosity, did you get anywhere with 'interfacing' sympy equations with optimization solvers? I am currently working on a generic solver interface that uses sympy equations and variables for problem formulation. I wondered if I am reinventing the wheel. Best, Niko On

Re: [sympy] variable with binary values?

2012-01-10 Thread Kevin Hunter
Thank you for your pointers. I'll take them under advisement as I move forward with my project. -- You received this message because you are subscribed to the Google Groups sympy group. To view this discussion on the web visit https://groups.google.com/d/msg/sympy/-/8UeD91pTYGAJ. To post to

Re: [sympy] variable with binary values?

2012-01-08 Thread Aaron Meurer
I see. Here's something that might be useful to you then: in the git master, we there is an option to simplify() that let's you use a custom measure function. simplify() tries various types of simplifications, and returns the expression that gives the smallest value according to the measure

[sympy] variable with binary values?

2012-01-06 Thread Kevin Hunter
Hullo Sympy Group, In my code, I'd like to be able to specify symbols with a binary type, something akin to: * b = symbols('b', binary=True)* This would let *b* assume only values from the set *{0, 1}*. I see the * Boolean* class from which the *Symbol* class derives, but I believe that's

Re: [sympy] variable with binary values?

2012-01-06 Thread Aaron Meurer
So you want to assume that b is a number modulo 2. To do this, you can use the new Mod() object that was recently added. Note that this was added after the latest release, so you'll have to use the git version if you want to use it. You define b = Symbol('b', integer=True), and use Mod(b, 2)

Re: [sympy] variable with binary values?

2012-01-06 Thread Kevin Hunter
For this project, my end goal is to interface a series of Sympy equations that I've built to an optimization solver. In the context of optimization, binary variables usually represent a decision, and in the context of solving, they represent a branch point. Branch points make it expensive to