just list the variables for which you want to solve -- in this case, leave off the "x" and you will get
``` >>> soln [{w: 0.5 - 0.5*x, y: 0.5 - 0.5*x, z: 1.00000000000000}] ``` see also https://github.com/sympy/sympy/issues/2720 /c On Friday, April 9, 2021 at 1:32:51 PM UTC-5 brandon...@gmail.com wrote: > Given the snippet below: > > from sympy import symbols, solve > w, x, y, z = symbols("w x y z") > equations = [ > w + x + y - 1, > z - 1, > w/(w+y) - 0.5, > w/(w+y) + y/(w+y) - 1 > ] > soln = solve(equations, (w, x, y, z), dict=True)[0] # accept first > solution > print(soln) > > the soln is: > > { > w: y, > x: 1.0 - 2.0*y, > z: 1.000 > } > > Is there a way I can use solve or some other function in SymPy to > change/influence the set of independent variables? In this case, I would > like to prefer x to be independent (used in the expressions of the soln > values) instead of y. > > This is a simplified of my actual code. In practice, I don't know which > symbols will can be independent before I call solve, but trivial for me to > order the symbols in order of my preference for them to be independent, if > possible. > > Cheers, > Brandon Bocklund > -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/sympy/85f99f89-5121-4314-b27c-13414fb1e484n%40googlegroups.com.