D A
D A

Reputation: 3438

Sympy Multi-Dimensional Set

Does there exist a concept of a multi-dimensional set?

For example, all real numbers between 0, and 10 can be defined with the set:

ExampleInterval = sympy.Interval(-10, 10)

What I want a set that describes all the coordinates (x, y, z...) where x is in one interval, y is in another, z in another, ... etc ?

I don't understand how sympy sets, are linked to variables.

Upvotes: 2

Views: 167

Answers (1)

user2357112
user2357112

Reputation: 280301

From the Sympy Set documentation, this would be a ProductSet. You could construct one with the ProductSet constructor, or by using the * operator on Intervals:

from sympy import Interval, ProductSet

box = ProductSet(Interval(x1, x2), Interval(y1, y2), Interval(z1, z2))
# or
box = Interval(x1, x2) * Interval(y1, y2) * Interval(z1, z2)

Upvotes: 4

Related Questions