Defining range for parameters

42 views
Skip to first unread message

Shelby Hui-Jun Chen

unread,
Apr 17, 2018, 1:46:50 PM4/17/18
to sympy
Dear all:


I'm wondering is it possible for me to define the range of my parameters when I defining symbols?

For example, I know I can
>>> x = symbols('x', positive = True)

But does it possible that I can restrict the domain of x into, say x is in the interval (0,1)?


Thank you!

Sincerely,

Shelby Chen

Robert Semenoff

unread,
Apr 19, 2018, 4:49:31 PM4/19/18
to sy...@googlegroups.com
I think the answer is no... it is a constraint solver like pyomo that maybe is what you want....
But  for sympy to allow type attributes like real etc, it must have some kind of constraint solver built in, so this is an interesting question.

--
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+un...@googlegroups.com.
To post to this group, send email to sy...@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/b57868c4-c591-4151-9f50-c51b112cabe8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Aaron Meurer

unread,
Apr 19, 2018, 5:04:06 PM4/19/18
to sy...@googlegroups.com
It's not possible yet. There have been plans to implement this sort of
thing but it hasn't happened yet.

Aaron Meurer
> https://groups.google.com/d/msgid/sympy/CAJABt-GngftrY8V%2B1pf6M%3D_N6imN5Ksi1FXxwQVS20KtdtD8OQ%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages