Hey Jon,

I assume you want to do something like this:

>>> eq = x**2 - y
>>> solve(eq.subs({y:1}))
[-1, 1]

You can achieve this with `solveset` too:

>>> solveset(eq.subs({y:1}))
{-1, 1}

Primarily `solve` and `solveset` differs in the way they return output, the 
former uses `list` while the latter uses `set`.

Below links, you might find helpful for getting along with `solveset`

https://docs.sympy.org/latest/modules/solvers/solveset.html
https://docs.sympy.org/latest/modules/sets.html

Cheers!
Yathartha

On Monday, January 28, 2019 at 2:17:52 PM UTC+5:30, Jon Durand wrote:
>
> Hello,
>
> I'm a fairly novice python user who had lightly brushed up against sympy a 
> few years ago and understood a bit of the original solve.
> Lately I've been trying to write code for solving functions I use and 
> would use a dictionary of symbol, value pairs and would solve things like 
> this:
> solve( eq.subs(dictionary))
>
> I recently noticed the existence of solveset and the notice to use it over 
> solve, so I am trying to convert my code to use solveset but I can't seem 
> to find the information
> on how to substitute values into equations that are going into the solver. 
> I imagine this is easy and I'm missing something simple but I've googled 
> and read through a bunch of sympy doc pages and couldn't find the relevant 
> part for solveset. 
>
> Any help is greatly appreciated, thank you for your time.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/817369d4-1e27-49a1-8b8f-c793461ad438%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to