Published January 8, 2025 | Version v4

Code for the paper "Optimal control for a class of linear transport dominated systems via the shifted proper orthogonal decomposition"

  • 1. EDMO icon Technical University of Berlin
  • 2. ROR icon Technische Universität Berlin

Description

Prerequisites

Before running the scripts, please ensure you have installed the necessary packages. You would need to unzip the sPOD.zip file since it contains the required library files for the code to run properly.

To create a Conda virtual environment, you need to install the Conda package manager and use the provided environment files.

 

Setting up the Environment

After installing Conda:

For Mac users:

conda env create -f env_with_accel_Mac.yml

conda activate env_with_accel

For other OS:

conda env create -f env_with_accel_others.yml 

conda activate env_with_accel

 

Running the Scripts

This repository includes three script files that need to be executed to reproduce the results. The script files are:

  1. run_FOM.sh
    Usage: ./run_FOM.sh arg

    • The value of arg can be 1, 2, or 3, corresponding to the three examples shown in the paper.
    • This script runs the tests for the Full-Order Model (FOM) for all example problems.
  2. run_PODG.sh
    Usage: ./run_PODG.sh arg1 arg2

    • arg1: Same as for FOM
    • arg2: Can be either modes for mode-based study or tol for tolerance-based study.
    • This script runs the tests for the POD-Galerkin model.
  3. run_sPODG.sh
    Usage: ./run_sPODG.sh arg1 arg2

    • The arguments are the same as those in the POD-Galerkin case.
    • This script runs the tests for the sPOD-Galerkin model.

 

Plotting Results

Once all the runs are complete, the results can be visualized using the following plotting scripts:

  1. state_target_plot.py
    Usage: python3 state_target_plot.py arg

    • This script plots the state and target snapshot profiles for the specified arg, where arg is 1, 2, or 3, corresponding to the example problems.
  2. sPOD_vs_POD_SV_plot.py
    Usage: python3 sPOD_vs_POD_SV_plot.py

    • This script plots the singular value decay of the POD and sPOD methods for a traveling wave system, which is a toy example for illustrating the advantage of sPOD over POD.
  3. J_vs_modes_plot.py
    Usage: python3 J_vs_modes_plot.py arg

    • This script plots the cost functional value against the number of modes needed for the POD-Galerkin and sPOD-Galerkin methods. The argument arg specifies the example number.
  4. J_vs_runtime_plot.py
    Usage: python3 J_vs_runtime_plot.py arg

    • This script plots the cost functional value against the computational time for the given arg, where arg specifies the example problem.
  5. control_adjoint_state_plot.py
    Usage: python3 control_adjoint_state_plot.py arg

    • This script plots the combined snapshots for the optimal controls, adjoints, and optimal states for the specified arg, where arg specifies the example problem.

Researchers are encouraged to try out the examples and extend them to their own research problems.

Files

README.md

Files (1.4 MB)

Name Size
md5:4c38864a11acbf803fc8d187da4102e0
14.0 kB Download
md5:83471ae6678ec2d42aa222533bb427f7
7.7 kB Download
md5:b6aa7b65dfa98948d56acd764744f467
9.1 kB Download
md5:57a743f2afe9afc564e8c088b2d71de0
1.2 kB Download
md5:68f6fe4d1a529625d89170d47e96ae5c
5.5 kB Download
md5:217bb71c50b87bcc2e2cb395f67baa03
193 Bytes Download
md5:7f2ae2e0abc601f8decdd7cbe504663d
8.9 kB Download
md5:3b039c4f1c4eb41ad3cac989a33926b8
1.1 kB Download
md5:dad9e3dd0829b6a0c05b687641d1534a
4.1 kB Download
md5:3f2224d5848a722e3c5f6e7797eaddb0
12.5 kB Download
md5:b40a6328866dad06a963a18877cb4bd6
3.8 kB Download
md5:37c0044a29b922a64584f8bfade7cbd1
5.5 kB Download
md5:a1ab81179e3ad0984ea4c3661d6a4976
6.0 kB Download
md5:1ebbd3e34237af26da5dc08a4e440464
35.1 kB Download
md5:6457d6328611f25f23a0e61b0a90e2c1
3.5 kB Download
md5:4c9edea6104663beb216c91bf5456778
11.7 kB Download
md5:8096ce4338f9d9ecebbda073d48d32af
2.9 kB Preview Download
md5:858e536bb196c0ded095923401017ee7
4.7 kB Download
md5:c19766416aa6af66aac17b3689871438
334 Bytes Download
md5:df8604a776f98bebed804df02c367173
2.6 kB Download
md5:71ef3f5fe14b20670388f8a9373c4cb2
1.8 kB Download
md5:e6f34aadea44eaed3e1575c747a6cd1c
1.2 MB Preview Download
md5:f5c05d7d97483ae22df8ce8c5f5af223
4.0 kB Download
md5:081cd8b3a5e84aa987ba3945f50c483f
14.2 kB Download
md5:75797782972a29e34ee16063301970a7
2.9 kB Download
md5:0eca17199cb46324e8733a7ba43ca031
27.9 kB Download

Additional details

Software

Programming language
Python
Development Status
Active