Introduction to Calibration using Ostrich

Please note that the content of the MESH User Support space continues to be updated as we transition to new tools.

Support and contact: MESH@ec.gc.ca | GitHub: https://github.com/MESH-Model

Introduction to Calibration using Ostrich

Introduction

OSTRICH (Optimization Software Toolkit for Research Involving Computational Heuristics), developed by Dr. L. Shawn Matott, is a model-independent, multi-algorithm optimization and parameter estimation tool. Designed to automate model calibration and design optimization, OSTRICH works seamlessly with any modeling program that uses text-based input and output files. This guide provides a quick introduction to using OSTRICH with systems like MESH. For more information on the software and its optimization algorithms, visit the OSTRICH website.

Minimum Requirements for Setting Up Model Calibration or Evaluation with OSTRICH
To configure a model calibration or evaluation job using OSTRICH, the following tools are necessary:

  • OSTRICH Executable: The OSTRICH executable is available for various operating systems and can be downloaded from the OSTRICH homepage.

  • Model Executable: The executable of the model to be calibrated or evaluated.

  • Batch Files: Files designed to automate and guide the model calibration process.

  • Objective Function Computation Executable (Optional): Required if the model executable does not include an internal objective function algorithm or if a custom algorithm is needed to calculate the objective function value.

How Does OSTRICH Work?

OSTRICH operates with any modeling program that uses text-based input and output file formats. Its functionality is based on two core components:

  1. Parameter Search Algorithms: Explore parameter values to optimize the model.

  2. Text Search and Replace Algorithm: Updates input files with the generated parameter values whenever they change.

Familiarity with the second component is sufficient for setting up model calibration or evaluation tasks. This guide focuses on explaining how to configure and use OSTRICH's text search and replace functionality.

Where Does OSTRICH Get Required Information?

OSTRICH retrieves all the necessary information for model calibration or evaluation from its input file, ostIn.txt. Below is a summary of the key sections in the ostIn.txt file and their roles:

  1. Optimization Algorithm
    The ProgramType keyword specifies the optimization algorithm (e.g., DDS for Dynamically Dimensioned Search). Algorithm-specific options, like maximum iterations, are included later in the file using relevant keywords. Refer to the OSTRICH manual for detailed options.

  2. Model Executable
    The ModelExecutable keyword defines the model executable or batch file to run the model. If the file is not in the same directory as ostIn.txt, its full path must be provided.

  3. Modifying Input Files
    Between BeginFilePairs and EndFilePairs, specify model input files with parameters to change and their corresponding template files. For example, input1.tpl serves as a template for input1.txt, where parameters are replaced with values generated by OSTRICH.

  4. Parameter Keywords and Ranges
    Enclosed by BeginParams and EndParams, this section defines keywords, ranges, and formats for parameters to be updated. The keywords must match those in the template files.

  5. Initial Parameter Values
    Between BeginInitParams and EndInitParams, initial parameter values can be provided. These values populate the model input files on the first run.

  6. Objective Function
    In the BeginResponseVars section, the file and location for reading the objective function value (e.g., function_out.txt) are specified.

  7. Running OSTRICH
    Once ostIn.txt, the model input files, the model executable, and the OSTRICH executable are in place, double-clicking the OSTRICH executable starts the calibration or evaluation process.

    For practical applications, the process is often managed using batch files (e.g., Ostrich.bat, save_best.bat, or OST-MESH.bat) to streamline runs and save outputs. Double-clicking the batch file will initiate the process.

Below are sample files to demonstrate the configuration and setup for OSTRICH:

  1. Sample ostIn.txt File
    This file contains all the information needed for the OSTRICH program. Lines starting with the pound character (#) are comments and are ignored by the program.

image-20241119-000203.png
  1. Sample input1.tpl File
    This template file corresponds to the input file input1.txt and aligns with the ostIn.txt specifications. It includes placeholders for parameter values to be updated by OSTRICH.

image-20241119-000528.png
  1. Generated input1.txt File
    If OSTRICH uses the provided initial parameter values, the content of the generated input1.txt file from the template will look as follows:

image-20241119-000643.png

 

 

 

Related content