You could write a python function to calculate all the different sign combinations where the input to the function would be [part1,...,partn] and return a list of sympy expressions [z1,...,zn]. The sign arrays could be generated by enumerating all n-digit binary numbers where a 0 digit would be + and a 1 digit -.
On Mon, Apr 4, 2016 at 8:39 AM, Dos18i2-se Beaverov <dos18i...@gmail.com> wrote: > Hi, I would like to calculate equations like this: > > z = part1 (+/-) part2 (+/-) part3 ... (+/-) partN. > > In case of 3 parts it`s rather easy to code all variants of equations (z1 > = part1 + part2 + part3; z2 = part1 + part2 - part3; z3 = part1 - part2 - > part3; z4 = part1 - part2 + part3). But in case of four or higher numbers > of equation parts it seems borring. > Can I use sympy for this task? Could you please give some simple example > or some key words for search in the google? > Thanks in advance. > > -- > You received this message because you are subscribed to the Google Groups > "sympy" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sympy+unsubscr...@googlegroups.com. > To post to this group, send email to sympy@googlegroups.com. > Visit this group at https://groups.google.com/group/sympy. > To view this discussion on the web visit > https://groups.google.com/d/msgid/sympy/9892df70-b70f-4aa5-b92d-5563efcb4600%40googlegroups.com > <https://groups.google.com/d/msgid/sympy/9892df70-b70f-4aa5-b92d-5563efcb4600%40googlegroups.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To post to this group, send email to sympy@googlegroups.com. Visit this group at https://groups.google.com/group/sympy. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/CALOxT-%3D-FTGH86%3D7JFgzN46TLBWHroL6NCeeRNGBK%2BEq6fuojA%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.