Thanks everyone, that's very helpful. Jo
On Feb 16, 4:40 pm, smichr <[email protected]> wrote: > Sorry...a more tidy path through the equations can look like this (but > you only know what "cherries to pick") by looking at the equations > yourself: > > h[1] >>> var('a0 lam conc x y z') > (a0, lam, conc, x, y, z) > h[2] >>> neq=[w.subs(dict([(r,nsimplify(r, rational=True)) for r > in w.atoms(Real > )])).as_numer_denom()[0] for w in [z-(a0*(1 - x/2)*x),lam+2*y- > z-0.005*x/2*x, z-1 > *y-0.743436700916726*y, x+y-conc]] > h[2] >>> ans=solve(neq[:3],[z,y,a0]) > h[2] >>> xx=solve(neq[3].subs(ans),x) > h[2] >>> for k in ans: > ... ans[k]=[ans[k].subs(x,xxi) for xxi in xx] > ... > h[2] >>> ans[x]=xx > h[2] >>> for k in ans: > ... print k, [ai.subs(lam,.1).subs(conc, .1).n(3) for ai in > ans[k]] > ... > x [-103., 0.487] > a0 [-0.0332, -1.83] > y [103., -0.387] > z [180., -0.675] > > The two values of x generate the two values for all the other > quantities. It's interesting that the denominator removal was not > necessary when done this time. > > /c -- You received this message because you are subscribed to the Google Groups "sympy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sympy?hl=en.
