Skip to content

Commit bb761b3

Browse files
authored
Merge pull request #23 from Jimmy-INL/Jimmy-handling-functional-Constraints
Adding a constraints class for the GQR optimizer
2 parents fce00b4 + 4694a09 commit bb761b3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+1991485
-344
lines changed

README.rst

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,59 @@ Use the ``predict`` method to reconstruct a new function sampled at the chosen s
5555
:alt: A plot showing the function to be reconstructed, the learned sensor locations, and the reconstruction.
5656
:figclass: align-center
5757

58+
Reconstruction with constraints
59+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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.
63+
64+
This work has been implemented in the general QR optimizer for sensor selection.
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
67+
no constrained region it should converge to the results from QR optimizer.
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.
71+
72+
Three strategies to deal with constraints are currently developed:
73+
74+
* ``max_n`` - Number of sensors in the constrained region should be less than or equal to the allowable constrained sensors.
75+
76+
* ``exact_n`` - Number of sensors in the constrained region should be exactly equal to the allowable constrained sensors.
77+
78+
* ``predetermined`` - A number of sensor locations are predetermined and the aim is to optimize the rest.
79+
80+
.. code-block:: python
81+
82+
optimizer_exact = ps.optimizers.GQR()
83+
opt_exact_kws={'idx_constrained':sensors_constrained,
84+
'n_sensors':n_sensors,
85+
'n_const_sensors':n_const_sensors,
86+
'all_sensors':all_sensors,
87+
'constraint_option':"exact_n"}
88+
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.
91+
92+
The constrained shapes currently implemented are:
93+
94+
* ``Circle``
95+
96+
* ``Cylinder``
97+
98+
* ``Line``
99+
100+
* ``Parabola``
101+
102+
* ``Ellipse``
103+
104+
* ``Polygon``
105+
106+
* ``UserDefinedConstraints``
107+
108+
- This type of constraint has the ability to take in either a function from the user or a
109+
.py file which contains a functional definition of the constrained region.
110+
58111
Classification
59112
^^^^^^^^^^^^^^
60113
Classification is the problem of predicting which category an example belongs to, given a set of training data (e.g. determining whether digital photos are of dogs or cats).
@@ -247,6 +300,12 @@ References
247300
(2018): 2642-2656.
248301
`[DOI] <https://doi.org/10.1109/JSEN.2018.2887044>`__
249302

303+
- Karnik, Niharika, Mohammad G. Abdo, Carlos E. Estrada-Perez, Jun Soo Yoo,
304+
Joshua J. Cogliati, Richard S. Skifton, Pattrick Calderoni, Steven L. Brunton, and Krithika Manohar.
305+
"Constrained Optimization of Sensor Plcaement for Nuclear Digital Twins" IEEE Sensors Journal 24, no. 9
306+
(2024): 15501 - 15516.
307+
`[DOI] <https://doi.org/10.1109/JSEN.2024.3368875>`__
308+
250309
.. |Build| image:: https://github.com/dynamicslab/pysensors/workflows/Tests/badge.svg
251310
:target: https://github.com/dynamicslab/pysensors/actions?query=workflow%3ATests
252311

examples/README.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,22 @@ ocean at any given point.
3737
Reproduces an example from `Manohar et al. (2018) <https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=8361090>`_
3838
where sensor locations are learned for a monomial basis for the task of reconstruction.
3939

40+
`Spatial constraints example <https://python-sensors.readthedocs.io/en/latest/examples/spatially_constrained_qr.html>`_
41+
----------------------------------------------------------------------------------------------------
42+
Sensor locations are learned for a constrained sensing problem for the task of reconstruction. For further details of constrained sensing refer
43+
`Karnik et al. (2024) <https://ieeexplore.ieee.org/abstract/document/10453459>`_
44+
45+
`Functional constraints example <https://python-sensors.readthedocs.io/en/latest/examples/functional_constraints.html>`_
46+
----------------------------------------------------------------------------------------------------
47+
Sensor locations are learned for various shapes of constrained regions. For further details refer to
48+
`Karnik et al. (2024) <https://www.mdpi.com/1996-1073/17/13/3355>`_
49+
50+
`Spatially Constrained sensing for a nuclear application <https://python-sensors.readthedocs.io/en/latest/examples/nuclear_application.html>`_
51+
----------------------------------------------------------------------------------------------------
52+
See how `PySensors` can be used to pick near optimal locations for sensors that accurateely reconstruct temperature in a nuclear fuel rod prototype
53+
. For further details refer to `Karnik et al. (2024) <https://ieeexplore.ieee.org/abstract/document/10453459>`_
54+
55+
4056

4157
Full table of contents
4258
----------------------

examples/basis_comparison.ipynb

Lines changed: 12 additions & 12 deletions
Large diffs are not rendered by default.

examples/cross_validation.ipynb

Lines changed: 24 additions & 8 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)