Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rotary bed notebooks #3

Merged
merged 40 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
b520033
rotary bed notebooks
jialuw96 Nov 21, 2023
a0f3b03
organize files
jialuw96 Apr 11, 2024
4d08601
cocurrent results
jialuw96 Apr 11, 2024
2335874
upload cocurrent results
jialuw96 Apr 11, 2024
30f630e
counter current results
jialuw96 Apr 12, 2024
a6fd189
add code
jialuw96 Apr 12, 2024
4bba2da
Update README.md
jialuw96 Apr 12, 2024
51e2655
Update README.md
jialuw96 Apr 12, 2024
c0b7281
Update README.md
jialuw96 Apr 12, 2024
3ca3aab
Update README.md
jialuw96 Apr 12, 2024
11a5f34
organize files
jialuw96 Apr 12, 2024
a016005
Update README.md
jialuw96 Apr 18, 2024
698bc88
update comments
jialuw96 Apr 22, 2024
a49eeb6
Update README.md
jialuw96 Apr 22, 2024
31bac7b
comment
jialuw96 Apr 23, 2024
99c2ead
Merge branch 'RPB' of https://github.com/CCSI-Toolset/fixed_bed_adsor…
jialuw96 Apr 23, 2024
f5bd618
finish commenting data process
jialuw96 Apr 23, 2024
8611840
Update README.md
jialuw96 Apr 23, 2024
bbd3e40
finish commenting counterflow jacobian process
jialuw96 Apr 23, 2024
ca11ced
Update README.md
jialuw96 Apr 24, 2024
475a64f
finish commenting MO part code
jialuw96 Apr 24, 2024
80d42a1
Update README.md
jialuw96 Apr 24, 2024
3174de0
Update README.md
jialuw96 Apr 25, 2024
9e19537
comment MBDoE code
jialuw96 Apr 25, 2024
6ea804e
comments
jialuw96 Apr 25, 2024
cd744f0
finish commenting
jialuw96 Apr 25, 2024
08c721d
Update README.md
jialuw96 Apr 25, 2024
11f38ca
Update README.md
jialuw96 Apr 25, 2024
c999279
run black
jialuw96 Apr 25, 2024
15eaaea
Update README.md
jialuw96 May 7, 2024
8160f0d
Update README.md
jialuw96 May 8, 2024
b9653ff
run with finite difference
jialuw96 May 8, 2024
c070445
update file path in data process notebook
jialuw96 May 13, 2024
9b8017b
check missing files
jialuw96 May 13, 2024
c93819e
organize files
jialuw96 May 13, 2024
89d670c
organize files
jialuw96 May 13, 2024
dd26f17
organize file
jialuw96 May 13, 2024
4bac5a0
fix typos and add comments
jialuw96 Jul 24, 2024
5edc3de
Update README.md
jialuw96 Jul 24, 2024
70b173b
add comments to the notebook
jialuw96 Jul 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
123 changes: 122 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,122 @@
# fixed_bed_adsorption
# MBDoE and MO analysis for co-current and counter-current RPB

Authors: Jialu Wang, Ryan Hughes, Debangsu Bhattacharrya, Alexander Dowling

## Installation instructions

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

### Step 1: create a new environment
- create new environment, called for e.g. `rotary`, with `conda`

`conda create --name rotary python==3.8`

`conda activate rotary`

### Step 2: install `IDAES-PSE`
- this step is necessary for running `homotopy` solve for the model

`pip install idaes-pse`

`idaes get-extensions`

### Step 3: install `Pyomo` from specified branches
- install from the following branch for a modified version of `Pyomo`:

`pip install git+https://github.com/jialuw96/pyomo.git@RPB_MBDOE`


### Step 4: install `jupyter notebook`
- this is needed only for the draw_figure.ipynb notebook

`conda install jupyter notebook`

### Software versions we use for the results

`Python`: 3.8

`IDAES-PSE`: 2.2.0

`Pyomo`: 6.7.0 dev 0

## Code content

### Co-current flow model

- `RPB_model_cocurrent.py`: Co-current flow RPB model provided by Ryan, modified for running `k_aug`

- `Cocurrent_flow_MBDoE.ipynb`: Apply `Pyomo.DoE` to the RPB model with `compute_FIM` and `run_grid_search`. `stochastic_program` is also tried but not debugged

### Counter-current flow model (Results are represented in Jialu's thesis chapter 4)

- `RPB_model_countercurrent_kaug.py`: Conter-current flow RPB model provided by Ryan, modified for running `k_aug`

- `Countercurrent_MBDoE.ipynb`: MBDoE analysis applying `Pyomo.DoE` and `k_aug` to the RPB model with `compute_FIM` and `run_grid_search`. `stochastic_program` is also tried but not debugged

- `Counterflow_MO_data_process.ipynb`: Process the sensitivity data for MO analysis

- `Counterflow_Jacobian_process.ipynb`: Reformulate the data structure for MO analysis

- `countercurrent_MO.py`: Measurement optimization analysis to the RPB model

- `counterflow_finite_difference_analysis.ipynb`: MBDoE analysis to the RPB model with finite difference method, not using `Pyomo.DoE`

- `draw_figure.ipynb`: Generates all results figures in the manuscript

## Results content

### Cocurrent flow model

- `Cocurrent_results/MO_results`: folder, contains the MO results at different budgets. For e.g., Sep17_2000_a means budget=2000, optimized with A-optimality

- `Cocurrent_results/MBDoE_results`: folder, contains the process models ran with different variables. For e.g., Nov25_368_388 means ads.T = 368K, des.T=388K

- `Countercurrent_results/MO_MILP_solution`: folder, contains the MO results at different budgets. For e.g., updated_2000 means budget=2000, optimized with A-optimality

- `Countercurrent_results/MBDoE_results/MBDOE_sens`: folder, contained the process models ran with different variables. For e.g., .Tgin_des_391/Tgin_ads_368 means ads.T = 368K, des.T=391K


## Run Models

Model code and how to run them are provided by Ryan Hughes in `Ryan-Hughes-8/fixed_bed_adsorption` repository:

Co-current flow model: https://github.com/Ryan-Hughes-8/fixed_bed_adsorption

Counter-current flow model: https://github.com/Ryan-Hughes-8/fixed_bed_adsorption/tree/counter-current-configuration

## Run measurement optimization results

The rerun instructions are for counter-current flow model, which is the model we use for the paper / thesis results.

### Step 1: Achieve sensitivity information (Jacobian) and error variance matrix

- Run `Counterflow_MO_data_process.ipynb` to generate all the sensitivity data

### Step 2: Process the data for MO analysis

- Run `Counterflow_Jacobian_process.ipynb` to organize the sensitivity data to .csv files that MO code use

### Step 3: Run MO analysis

- In `Countercurrent_MO.py`, find the toggles in line 17 - 27
- Choose mixed-integer option by `mip_option`
- Choose objective by `objective`
- Choose budget set. It is default to be the budget ranges we use for the paper, from 2000 to 10000

## Run MBDoE analysis

### Run MBDoE with `k_aug`

- `Countercurrent_MBDoE.ipynb`: MBDoE analysis applying `Pyomo.DoE` and `k_aug` to the RPB model with `compute_FIM` and `run_grid_search`

### Run MBDoE with finite difference

- `Counterflow-finite-difference-analysis.ipynb`: MBDoE analysis applying finite difference method to the RPB model. It runs the grid search, and generates the thesis results.


## Reproduce figures

- `draw_figures.ipynb`: include the functions and the path of results to reproduce Fig. 4.2, 4.3, 4.4, 4.5 in the Chapter 4 of Jialu's thesis.



Binary file added Rotary packed bed/Cocurrent_MO_QVs/Var_z3
Binary file not shown.
Binary file added Rotary packed bed/Cocurrent_MO_QVs/Var_z3_jan
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added Rotary packed bed/Cocurrent_MO_QVs/name_z3
Binary file not shown.
Binary file added Rotary packed bed/Cocurrent_MO_QVs/name_z3_jan
Binary file not shown.
Binary file not shown.
Loading