You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+16-10Lines changed: 16 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -58,18 +58,18 @@ Use the ``predict`` method to reconstruct a new function sampled at the chosen s
58
58
Reconstruction with constraints
59
59
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
60
60
In most engineering applications, certain areas within the region of interest might allow a limited number of sensors or none at all.
61
-
We develop a data-driven technique that incorporates constraints into an optimization framework for sensor placement, with the primary objective
62
-
of minimizing reconstruction errors under noisy sensor measurements.
61
+
We develop a data-driven technique that incorporates constraints into an optimization framework for sensor placement, with the primary objective
62
+
of minimizing reconstruction errors under noisy sensor measurements.
63
63
64
-
This work has been implemented in the general QR optimizer for sensor selection.
64
+
This work has been implemented in the general QR optimizer for sensor selection.
65
65
This is an extension that requires a more intrusive access to the QR optimizer to facilitate a more adaptive optimization. It is a generalized version of cost constraints
66
-
in the sense that users can allow `n_const_sensors` in the constrained area. If n = 0 this converges to the CCQR results. If there is
66
+
in the sense that users can allow `n_const_sensors` in the constrained area. If n = 0 this converges to the CCQR results. If there is
67
67
no constrained region it should converge to the results from QR optimizer.
68
68
69
-
To implement constrained sensing we initialize the optimizer GQR and provide it additional kwargs such as the constrained region, number of allowable
70
-
sensors in the constrained region and the type of constraint.
69
+
To implement constrained sensing we initialize the optimizer GQR and provide it additional kwargs such as the constrained region, number of allowable
70
+
sensors in the constrained region and the type of constraint.
71
71
72
-
Three strategies to deal with constraints are currently developed:
72
+
Three strategies to deal with constraints are currently developed:
73
73
74
74
* ``max_n`` - Number of sensors in the constrained region should be less than or equal to the allowable constrained sensors.
75
75
@@ -87,9 +87,9 @@ Three strategies to deal with constraints are currently developed:
87
87
'constraint_option':"exact_n"}
88
88
89
89
We have further provided functions to compute the sensors in the constrained regions. For example if the user provides the center and radius of a circular
90
-
constrained region, the constraints in utils compute the constrained sensor indices. Direct constraint plotting capabilities have also been developed.
90
+
constrained region, the constraints in utils compute the constrained sensor indices. Direct constraint plotting capabilities have also been developed.
91
91
92
-
The constrained shapes currently implemented are:
92
+
The constrained shapes currently implemented are:
93
93
94
94
* ``Circle``
95
95
@@ -105,7 +105,7 @@ The constrained shapes currently implemented are:
105
105
106
106
* ``UserDefinedConstraints``
107
107
108
-
- This type of constraint has the ability to take in either a function from the user or a
108
+
- This type of constraint has the ability to take in either a function from the user or a
109
109
.py file which contains a functional definition of the constrained region.
Function for evaluating constrained sensor locations on the grid by returning a negative value (if index is constrained) and a positive value (if index is unconstrained).
6
+
Function for evaluating constrained sensor locations on the grid by returning a
7
+
negative value (if index is constrained) and a positive value
8
+
(if index is unconstrained).
7
9
8
10
Parameters
9
11
----------
10
12
x: float, x coordinate of all grid-points considered for sensor placement
11
13
y : float, y coordinate of all grid-points considered for sensor placement
12
-
13
-
**kwargs : h : float, x-coordinate of the vertex of the parabola we want to be constrained;
14
-
k : float, y-coordinate of the vertex of the parabola we want to be constrained;
14
+
15
+
**kwargs : h : float, x-coordinate of the vertex of the parabola we want to be
16
+
constrained;
17
+
k : float, y-coordinate of the vertex of the parabola we want to be
18
+
constrained;
15
19
a : float, The x-coordinate of the focus of the parabola.
16
20
17
21
Returns
18
22
-------
19
-
g : np.darray, shape [No. of grid points],
20
-
A boolean array for every single grid point based on whether the grid point lies in the constrained region or not
23
+
g : np.darray, shape [No. of grid points],
24
+
A boolean array for every single grid point based on whether the grid point lies
25
+
in the constrained region or not.
21
26
"""
22
27
# make sure the length of x is the same as y
23
28
assertlen(x) ==len(y)
24
-
if ('h'notinkwargs.keys()) or (kwargs['h'] ==None):
25
-
kwargs['h'] =0.025
26
-
if ('k'notinkwargs.keys()) or (kwargs['k'] ==None):
27
-
kwargs['k'] =0
28
-
if ('a'notinkwargs.keys()) or (kwargs['a'] ==None):
29
-
kwargs['a'] =100
29
+
if ("h"notinkwargs.keys()) or (kwargs["h"] isNone):
30
+
kwargs["h"] =0.025
31
+
if ("k"notinkwargs.keys()) or (kwargs["k"] isNone):
32
+
kwargs["k"] =0
33
+
if ("a"notinkwargs.keys()) or (kwargs["a"] isNone):
34
+
kwargs["a"] =100
30
35
# initialize the constraint evaluation function g
31
-
g1=np.zeros(len(x),dtype=float) -1
32
-
g2=np.zeros(len(x),dtype=float) -1
33
-
g=np.zeros(len(x),dtype=float)
34
-
# loop over all given location and check if they violate the constraints
35
-
# make sure the retuned value is negative if it is in the constrained area and positive otherwise
0 commit comments