# phamminh0103/dge-cred architecture

> Architecture diagram of the GitHub repository phamminh0103/dge-cred, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/phamminh0103/dge-cred
- Repository: https://github.com/phamminh0103/dge-cred

## Overview

DGE-CRED is a spatial small-open-economy dynamic general-equilibrium model for climate-resilient development, implemented in Dynare with MATLAB/Octave. The documented user workflow is to define a baseline and climate-change scenarios, then simulate them and examine results. The tree shows separate simulation, steady-state, calibration, model-definition, and results-workbook components; source excerpts were unavailable, so internal call wiring is not asserted.

Main entry points: [`DGE_CRED_Model/RunSimulations.m`](https://github.com/phamminh0103/dge-cred/blob/master/DGE_CRED_Model/RunSimulations.m) (Simulation runner), [`DGE_CRED_Model/Functions/Simulation_Model.m`](https://github.com/phamminh0103/dge-cred/blob/master/DGE_CRED_Model/Functions/Simulation_Model.m) (Scenario simulation), [`DGE_CRED_Model/DGE_CRED_Model.mod`](https://github.com/phamminh0103/dge-cred/blob/master/DGE_CRED_Model/DGE_CRED_Model.mod) (Dynare model), [`DGE_CRED_Model/ExcelFiles/ResultsScenarios3Sectorsand1Regions.xlsx`](https://github.com/phamminh0103/dge-cred/blob/master/DGE_CRED_Model/ExcelFiles/ResultsScenarios3Sectorsand1Regions.xlsx) (Scenario results)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_scenarios["Scenario setup"]
  node_scenario_inputs["Scenario workbooks"]
  node_runner["Simulation runner<br/>[RunSimulations.m]"]
end

subgraph group_model["Economic model"]
  node_calibration["Calibration<br/>[Calibration.m]"]
  node_steady_state["Steady state"]
  node_simulation["Scenario simulation<br/>[Simulation_Model.m]"]
  node_model_spec["Dynare model<br/>[DGE_CRED_Model.mod]"]
  node_model_parts["Model equations"]
end

subgraph group_outputs["Results"]
  node_scenario_results["Scenario results"]
  node_figures["Result figures"]
end

node_analyst(("Model user"))
node_dynare["Dynare"]

node_analyst -->|"defines scenarios"| node_scenario_inputs
node_analyst -->|"runs simulations"| node_runner
node_runner -->|"runs model"| node_dynare
node_dynare -->|"solves"| node_model_spec
node_model_spec -->|"uses definitions"| node_model_parts
node_runner -->|"calibrates"| node_calibration
node_runner -->|"computes steady state"| node_steady_state
node_runner -->|"simulates scenarios"| node_simulation
node_simulation -->|"writes results"| node_scenario_results
node_scenario_results -->|"supports figures"| node_figures

click node_scenario_inputs "https://github.com/phamminh0103/dge-cred/tree/master/DGE_CRED_Model/ExcelFiles"
click node_runner "https://github.com/phamminh0103/dge-cred/blob/master/DGE_CRED_Model/RunSimulations.m"
click node_calibration "https://github.com/phamminh0103/dge-cred/blob/master/DGE_CRED_Model/Functions/Calibration.m"
click node_steady_state "https://github.com/phamminh0103/dge-cred/blob/master/DGE_CRED_Model/Functions/SteadyState_Model.m"
click node_simulation "https://github.com/phamminh0103/dge-cred/blob/master/DGE_CRED_Model/Functions/Simulation_Model.m"
click node_model_spec "https://github.com/phamminh0103/dge-cred/blob/master/DGE_CRED_Model/DGE_CRED_Model.mod"
click node_model_parts "https://github.com/phamminh0103/dge-cred/tree/master/DGE_CRED_Model/ModFiles"
click node_scenario_results "https://github.com/phamminh0103/dge-cred/blob/master/DGE_CRED_Model/ExcelFiles/ResultsScenarios3Sectorsand1Regions.xlsx"
click node_figures "https://github.com/phamminh0103/dge-cred/tree/master/DGE_CRED_Model/ExcelFiles/Figures"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_scenario_inputs,node_runner,node_analyst toneBlue
class node_calibration,node_steady_state,node_simulation,node_model_spec,node_model_parts toneAmber
class node_scenario_results,node_figures toneMint
class node_dynare toneIndigo
```

## Components

### Scenario setup

- [Scenario workbooks](https://github.com/phamminh0103/dge-cred/tree/master/DGE_CRED_Model/ExcelFiles): `DGE_CRED_Model/ExcelFiles`
- [Simulation runner](https://github.com/phamminh0103/dge-cred/blob/master/DGE_CRED_Model/RunSimulations.m): `DGE_CRED_Model/RunSimulations.m`

### Economic model

- [Calibration](https://github.com/phamminh0103/dge-cred/blob/master/DGE_CRED_Model/Functions/Calibration.m): `DGE_CRED_Model/Functions/Calibration.m`
- [Steady state](https://github.com/phamminh0103/dge-cred/blob/master/DGE_CRED_Model/Functions/SteadyState_Model.m): `DGE_CRED_Model/Functions/SteadyState_Model.m`
- [Scenario simulation](https://github.com/phamminh0103/dge-cred/blob/master/DGE_CRED_Model/Functions/Simulation_Model.m): `DGE_CRED_Model/Functions/Simulation_Model.m`
- [Dynare model](https://github.com/phamminh0103/dge-cred/blob/master/DGE_CRED_Model/DGE_CRED_Model.mod): `DGE_CRED_Model/DGE_CRED_Model.mod`
- [Model equations](https://github.com/phamminh0103/dge-cred/tree/master/DGE_CRED_Model/ModFiles): `DGE_CRED_Model/ModFiles`

### Results

- [Scenario results](https://github.com/phamminh0103/dge-cred/blob/master/DGE_CRED_Model/ExcelFiles/ResultsScenarios3Sectorsand1Regions.xlsx): `DGE_CRED_Model/ExcelFiles/ResultsScenarios3Sectorsand1Regions.xlsx`
- [Result figures](https://github.com/phamminh0103/dge-cred/tree/master/DGE_CRED_Model/ExcelFiles/Figures): `DGE_CRED_Model/ExcelFiles/Figures`

### Other components

- **Model user**
- **Dynare**

## Connections

- Model user → Scenario workbooks: defines scenarios
- Model user → Simulation runner: runs simulations
- Simulation runner → Dynare: runs model
- Dynare → Dynare model: solves
- Dynare model → Model equations: uses definitions
- Simulation runner → Calibration: calibrates
- Simulation runner → Steady state: computes steady state
- Simulation runner → Scenario simulation: simulates scenarios
- Scenario simulation → Scenario results: writes results
- Scenario results → Result figures: supports figures
