Skip to content

Baseline Condition Analysis

Baseline Condition Analysis is a core feature of the tricys analysis toolset. It is used for a comprehensive evaluation of the system's behavior under a single, fixed parameter configuration (the "baseline condition") and automatically generates a standardized Markdown analysis report.

This function is essentially a post-processing module of tricys. For general configurations of the post-processing module, please refer to the Post-Processing Module. For common configurations such as metric definitions, glossaries, and unit maps, please refer to the General Introduction.

1. Configuration File Example

The configuration for this analysis consists of a single simulation followed by a specific post-processing step. Therefore, the configuration file does not include a sensitivity_analysis scanning section.

{
    "paths": {
        "package_path": "../../example_model_single/example_model.mo"
    },
    "simulation": {
        "model_name": "example_model.Cycle",
        "variableFilter": "time|sds.I[1]|div.I[1]|cps.I[1]|tes.I[1]|blanket.I[1]|i_iss.I[1]|wds.I[1]|o_iss.I[1]",
        "stop_time": 2000.0,
        "step_size": 0.5
    },
    "post_processing": [
        {
           "module": "tricys.postprocess.baseline_analysis",
           "function": "baseline_analysis",
           "params": {
                "detailed_var": "sds.I[1]",
                "glossary_path": "../../example_glossary/example_glossary.csv"
            }
        }
    ]
}

2. Key Configuration Items Explained

The core lies in the post_processing section configuration:

  • module: Fixed as tricys.postprocess.baseline_analysis.
  • function: Fixed as baseline_analysis.
  • params:
    • detailed_var (string, optional):
      • Description: Specifies a variable in the model. The report will generate a time evolution curve chart with a "detailed view" for this variable, zooming in on the area around its "self-sufficiency point".
    • glossary_path (string, optional):
      • Description: A path to a "glossary" CSV file.

3. Analysis Report Output

The structure of the report is similar to that described in the General Introduction, but its core content is a snapshot analysis of a single run, including:

  1. Key Performance Indicators: Startup Inventory, Self-Sufficiency Time, and Doubling Time calculated based on detailed_var.
  2. Time-series Plot of Simulation Results: Includes a global view and a detailed view based on detailed_var.
  3. Final Values Bar Chart: A bar chart showing the distribution of tritium inventory across submodules at the end of the simulation.
  4. Data Tables: Includes a table of final values and data slices at key stages (initial, turning point, end).

4. AI-Enhanced Analysis

All analysis modules in tricys are deeply integrated with Large Language Models (LLMs), capable of automatically converting raw charts and data into structured, academic-style reports.

4.1. How to Enable

For baseline condition analysis, the AI feature is activated by adding "ai": true to the params object of the post_processing task.

"post_processing": [
    {
       "module": "tricys.postprocess.baseline_analysis",
       "function": "baseline_analysis",
       "params": {
            "detailed_var": "sds.I[1]",
            "glossary_path": "../../example_glossary/example_glossary.csv",
            "ai": true
        }
    }
]

4.2. Environment Setup

Before using this feature, you must create a file named .env in the project's root directory and fill in your Large Language Model API credentials. This ensures that your keys are kept secure and are not committed to version control.

# .env file in project root
API_KEY="sk-your_api_key_here"
BASE_URL="https://your_api_base_url/v1"
AI_MODEL="your_model_name_here"

4.3. Output Reports

When enabled, in addition to the standard analysis report (analysis_report_...md), tricys will generate two additional reports in the case's report folder:

  • analysis_report_{case_name}_{model_name}.md: Appends an in-depth textual interpretation of the data and charts, generated by the AI, to the end of the core report.
  • academic_report_{case_name}_{model_name}.md: A well-structured, academic-style report written entirely by the AI. This report typically includes sections such as Abstract, Introduction, Methods, Results and Discussion, and Conclusion, and can be used directly for presentations or as a draft for a paper.