Create a Domain with Uniform Bounds#
import minterpy as mp
import numpy as np
Approximating a function \(f: \Omega \rightarrow \mathbb{R}\) where \(\Omega\) is a custom hyper-rectangular domain in Minterpy involves constructing an (interpolating) polynomial \(Q\) such that:
where \(Q: [-1, 1]^m \rightarrow \mathbb{R}\) is the polynomial defined on the internal (reference) domain and \(\mathcal{T}\) is the affine separable transformation from \(\Omega\) to \([-1, 1]^m\). Both the user-defined domain and the internal domain are encapsulated in the Domain class.
An instance of Domain can be constructed via different constructors:
Domain: create an instance by specifying bounds for each dimension (see the example)Domain.uniform(): create an instance with uniform bounds (this page)Domain.identity(): create an instance with bounds identical to the internal domain (see the example)
In this guide, you will construct a Domain instance with uniform bounds using the factory method Domain.uniform().
About the factory method uniform()#
The factory method Domain.uniform() constructs a Domain instance with identical bounds [a, b] applied across all dimensions, given a spatial dimension m, a lower bound a, and an upper bound b. The lower bound must be strictly less than the upper bound.
Example: Six-dimensional rectangular domain#
Create a six-dimensional rectangular domain that corresponds to:
Domain instance#
An instance of Domain of a given dimension with a uniform bound can be constructed using the factory method:
spatial_dimension = 6
lower = 1.0
upper = 5.0
dom = mp.Domain.uniform(spatial_dimension, lower, upper)
Spatial dimension#
We can verify that the domain is six dimensional:
print(dom.spatial_dimension)
6
and with the appropriate bounds:
print(dom.bounds)
[[1. 5.]
[1. 5.]
[1. 5.]
[1. 5.]
[1. 5.]
[1. 5.]]
Uniform domain#
A domain is a uniform domain if it has identical bounds across all dimensions (\([a, b]^m\)). This can be verified for the current instance using the following property:
dom.is_uniform
True
Identity domain#
A domain is an identity domain if the user-defined bounds match the internal reference domain (\([-1, 1]^m\)). This can be verified for the current instance using the following property:
dom.is_identity
False