Contains GPU accelerated state estimators, an MPC implementaton, and a bioreactor model. This code forms the practical part of my masters thesis.
The following steps are a guide to getting the code running. Version numbers shown in brackets, are the version numbers used for development. Other versions might work as well, but have not been tested. Where exact versions are needed, this is explicitly stated.
-
Install conda (v4.8.3)
-
Install the CUDA 10.2 toolkit (Note: the exact version is needed)
-
Clone this repository to your computer
git clone https://github.com/darren-roos/gpu_se
-
From within the
gpu_se
directory, clone the cache repositorygit clone https://github.com/darren-roos/picklejar
Ensure that it is in the
gpu_se
directory:gpu_se | +--picklejar\
The results available in the cache are from runs performed on a machine with an AMD Ryzen 5 2400G, 32 GB of RAM and a GeForce GTX 1070 (8 GB of on board memory). The machine was running Ubuntu 18.04.4 LTS with a Python 3.8.2 environment. Further details about the Python environment can be found in the environment.yml file in the source code repository.
-
From within the
gpu_se
directory, create the conda environment:conda env create -f environment.yml
-
Add the
gpu_se
directory to yourPYTHONPATH
-
Activate the
conda
environmentconda activate gpu_se_cuda102
-
Add gpu_se to the
PYTHONPATH
environment variable. On linux systems the following command should work if you are in thegpu_se
directory:export PYTHONPATH=$PYTHONPATH:$pwd
-
Run any script using:
python path/to/script
The following scripts produce the results found in the thesis document:
-
Open loop bioreactor
results/bioreactor_openloop/batch_production_growth
- Shows the batch, production and growth phases of the bioreactorresults/bioreactor_openloop/ss2ss
- Shows the open loop transition between two steady statesresults/bioreactor_openloop/step_tests
- Shows open loop step tests of the system
-
Closed loop bioreactor only
results/bioreactor_closedloop/no_noise
- Shows a closedloop simulation with no noiseresults/bioreactor_closedloop/with_noise
- Shows a closedloop simulation with noiseresults/bioreactor_closedloop/performance_vs_control_period
- Shows the effect of control period on performanceresults/bioreactor_closedloop/mpc_run_seq
- Benchmarks the MPC code
-
Open loop particle filter
results/pf_openloop/pf_run_seq
- Benchmarks the run time of the openloop particle filterresults/pf_openloop/pf_power
- Benchmarks the power consumption of the openloop particle filter
-
Closed loop particle filter
results/pf_closedloop/bioreactor_performance_pf
- Shows the performance of the particle filter in a closed loop
-
Open loop Gaussian sum filter
results/gsf_openloop/pf_run_seq
- Benchmarks the run time of the openloop Gaussian sum filterresults/gsf_openloop/pf_power
- Benchmarks the power consumption of the openloop Gaussian sum filter
-
Closed loop Gaussian sum filter
results/gsf_closedloop/bioreactor_performance_pf
- Shows the performance of the Gaussian sum filter in a closed loop
Complete documentation for the code can be built.
It requires a working instillation of latexpdf
.
It requires the activation of the conda environment:
conda activate gpu_se_cuda102
Navigate to gpu_se/docs
and run:
make clean latexpdf
The required documentation will be found in docs/build/latex/gpuacceleratedstateestimators.pdf
.