CCSI-Toolset / measurement-optimization

Code for Measure This, Not That: Optimizing the Cost and Model-Based Informa- tion Content of Measurements
2 stars 0 forks source link
applied-statistics convex-optimization data-science design-of-experiments pyomo

Measurement This, Not That: Optimizing the Cost and Model-Based Information Content of Measurements

Authors: Jialu Wang, Zedong Peng, Ryan Hughes, Debangsu Bhattacharyya, David E. Bernal Neira, Alexander W. Dowling

This repository contains code and results for the paper: Measure This, Not That: Optimizing the Cost and Model-based Information Content of Measurements

Questions: Please contact Prof. Alex Dowling (adowling@nd.edu). This repository is primarily to archive the code. It may not be maintained. The version of software packages used to generate results are given in the paper.

Installation instructions

The following instructions assume you have anaconda installed. We suggest creating an environment with the following commands to run code:

Step 1: create a new environment

conda create --name measurement_optimization

conda activate measurement_optimization

Step 2 (optional): install IDAES-PSE

pip install idaes-pse

idaes get-extensions

Step 3: install numpy, scipy, pandas, matplotlib

conda install numpy

conda install scipy

conda install pandas

conda install matplotlib

Step 4: install Pyomo from specified branches

pip install git+https://github.com/ZedongPeng/pyomo.git@add_mindtpy_callback

Step 5: install GurobiPy

Step 6: install CyIpopt

Step 7: install jupyter notebook

(Optional) Cvxpy environment setting

Software versions we use for the results

Python: 3.8

IDAES-PSE: 2.2.0

Pyomo: 6.7.0 dev 0

GurobiPy: 10.0.3

CyIpopt: 1.3.0

Cvxpy: 1.2.1

Code

Example to run code and reproduce figures for case studies

Setup the scripts to reproduce result files and figures from the paper:

Kinetics case study

Kinetics case study with Cvxpy

Rotary bed case study

Source files

Kinetics case study

Rotary bed case study

Result files

Kinetics case study

At each budget, the FIM result and the optimal solution are stored separately in pickle files. Computational details including solver time and numbers of operations are also stored separately in pickle files.

FIM of final results

An example name: LP_fim_1000_a, the results of A-optimality LP problem of a budget of 1000

Data file type: pickle, storing a numpy array of FIM of the shape Np*Np, Np is the number of parameters

To replicate the results, iterate in the given budget range to retrieve the FIM stored in each data file

Optimal solutions

An example name: LP_1000_a, the results of A-optimality LP problem of a budget of 1000

Data file type: pickle, storing a numpy array of the solutions of the shape Nm*Nm, Nm is the number of all measurements

Computational details

The computational details are stored separately.

For A-optimality LP and MILP problems, the pickle files store a numpy array of the solver time of each budget

For D-optimality NLP and MINLP problems, the pickle files store a dictionary, where the keys are the budgets. An example is:

nlp_time={1000: {"t": 0.01, "n": 10}, ..., "5000": {"t": 0.01, "n": 10}}

For each budget, the value is a dictionary where the key t stores the solver time, n stores the number of iterations

Rotary bed case study

At each budget, the FIM result and the optimal solution are stored separately in pickle files. Computational details including solver time and numbers of operations are also stored separately in pickle files.

FIM of optimal solutions

An example name: LP_fim_1000_a, the results of A-optimality LP problem of a budget of 1000

Data file type: pickle, storing a numpy array of FIM of the shape Np*Np, Np is the number of parameters

To replicate the results, iterate in the given budget range to retrieve the FIM stored in each data file

Optimal solutions

An example name: LP_1000_a, the results of A-optimality LP problem of a budget of 1000

Data file type: pickle, storing a numpy array of the solutions of the shape Nm*Nm, Nm is the number of all measurements

Computational details

The computational details are stored separately.

For A-optimality LP and MILP problems, the pickle files store a numpy array of the solver time of each budget

For D-optimality NLP and MINLP problems, the pickle files store a dictionary, where the keys are the budgets. An example is:

nlp_time={1000: {"t": 0.01, "n": 10}, ..., "5000": {"t": 0.01, "n": 10}}

For each budget, the value is a dictionary where the key t stores the solver time, n stores the number of iterations