# matpower/wy-wind-model architecture

> Architecture diagram of the GitHub repository matpower/wy-wind-model, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/matpower/wy-wind-model
- Repository: https://github.com/matpower/wy-wind-model

## Overview

WY-Wind-Model is a MATLAB/Octave wind-model library for producing forecasts, scenario transition probabilities, wind-speed realizations, and wind-power outputs for MOST. Its documented workflow constructs a model from stored parameters, selects sites, then requests forecasts or realizations and optionally converts speeds to power. The README also documents historical wind inputs and date/index utilities. Source excerpts were not provided, so relationships below are limited to those explicitly described in the README; implementation-level calls are not inferred.

Main entry points: [`lib/wy_wind_model.m`](https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_model.m) (Wind model), [`lib/wy_wind_forecasts.m`](https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_forecasts.m) (Wind forecasts), [`lib/wy_wind_trans_probs.m`](https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_trans_probs.m) (Transition probabilities), [`lib/wy_wind_realizations.m`](https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_realizations.m) (Wind realizations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_modeling["Model setup"]
  node_model["Wind model<br/>[wy_wind_model.m]"]
  node_power_curve_data["Power curve data"]
  node_date_to_index["Date to period index"]
  node_index_to_date["Period index to date"]
end

subgraph group_generation["Wind generation"]
  node_forecasts["Wind forecasts"]
  node_transitions["Transition probabilities"]
  node_realizations["Wind realizations"]
  node_speed_power["Speed to power"]
  node_simulation_example["Simulation example"]
end

subgraph group_inputs["Wind data"]
  node_model_params[("NPCC model parameters")]
  node_power_curve["Power curve table"]
  node_historical_data[("Historical wind data<br/>[wind_data_npcc.mat]")]
  node_capacity_data[("Site capacities<br/>[wind_cap_npcc.mat]")]
end

node_user(("MATLAB/Octave user"))

node_user -->|"constructs"| node_model
node_model -->|"loads parameters"| node_model_params
node_user -->|"requests forecast"| node_forecasts
node_user -->|"requests probabilities"| node_transitions
node_user -->|"requests realization"| node_realizations
node_user -->|"converts speeds"| node_speed_power
node_user -->|"selects curve"| node_power_curve_data
node_user -->|"loads data"| node_historical_data
node_user -->|"finds period"| node_date_to_index
node_user -->|"converts period"| node_index_to_date
node_user -->|"runs example"| node_simulation_example
node_user -->|"uses capacities"| node_capacity_data
node_model -->|"provides method"| node_forecasts
node_model -->|"provides method"| node_transitions
node_model -->|"provides method"| node_realizations
node_model -->|"provides method"| node_speed_power

click node_model "https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_model.m"
click node_model_params "https://github.com/matpower/wy-wind-model/blob/main/lib/wind_model_npcc.mat"
click node_power_curve "https://github.com/matpower/wy-wind-model/blob/main/lib/wind_power_curve_EIC.txt"
click node_forecasts "https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_forecasts.m"
click node_transitions "https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_trans_probs.m"
click node_realizations "https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_realizations.m"
click node_speed_power "https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_speed2power.m"
click node_power_curve_data "https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_power_curve_data.m"
click node_historical_data "https://github.com/matpower/wy-wind-model/blob/main/lib/wind_data_npcc.mat"
click node_capacity_data "https://github.com/matpower/wy-wind-model/blob/main/lib/wind_cap_npcc.mat"
click node_date_to_index "https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_date2pidx.m"
click node_index_to_date "https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_pidx2date.m"
click node_simulation_example "https://github.com/matpower/wy-wind-model/blob/main/lib/ex_wy_wind_simulation.m"

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_model,node_power_curve_data,node_date_to_index,node_index_to_date,node_user toneBlue
class node_forecasts,node_transitions,node_realizations,node_speed_power,node_simulation_example toneAmber
class node_model_params,node_power_curve,node_historical_data,node_capacity_data toneMint
```

## Components

### Model setup

- [Wind model](https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_model.m): `lib/wy_wind_model.m`
- [Power curve data](https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_power_curve_data.m): `lib/wy_wind_power_curve_data.m`
- [Date to period index](https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_date2pidx.m): `lib/wy_wind_date2pidx.m`
- [Period index to date](https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_pidx2date.m): `lib/wy_wind_pidx2date.m`

### Wind generation

- [Wind forecasts](https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_forecasts.m): `lib/wy_wind_forecasts.m`
- [Transition probabilities](https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_trans_probs.m): `lib/wy_wind_trans_probs.m`
- [Wind realizations](https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_realizations.m): `lib/wy_wind_realizations.m`
- [Speed to power](https://github.com/matpower/wy-wind-model/blob/main/lib/wy_wind_speed2power.m): `lib/wy_wind_speed2power.m`
- [Simulation example](https://github.com/matpower/wy-wind-model/blob/main/lib/ex_wy_wind_simulation.m): `lib/ex_wy_wind_simulation.m`

### Wind data

- [NPCC model parameters](https://github.com/matpower/wy-wind-model/blob/main/lib/wind_model_npcc.mat): `lib/wind_model_npcc.mat`
- [Power curve table](https://github.com/matpower/wy-wind-model/blob/main/lib/wind_power_curve_EIC.txt): `lib/wind_power_curve_EIC.txt`
- [Historical wind data](https://github.com/matpower/wy-wind-model/blob/main/lib/wind_data_npcc.mat): `lib/wind_data_npcc.mat`
- [Site capacities](https://github.com/matpower/wy-wind-model/blob/main/lib/wind_cap_npcc.mat): `lib/wind_cap_npcc.mat`

### Other components

- **MATLAB/Octave user**

## Connections

- MATLAB/Octave user → Wind model: constructs (evidence: `README.md`)
- Wind model → NPCC model parameters: loads parameters (evidence: `README.md`)
- MATLAB/Octave user → Wind forecasts: requests forecast (evidence: `README.md`)
- MATLAB/Octave user → Transition probabilities: requests probabilities (evidence: `README.md`)
- MATLAB/Octave user → Wind realizations: requests realization (evidence: `README.md`)
- MATLAB/Octave user → Speed to power: converts speeds (evidence: `README.md`)
- MATLAB/Octave user → Power curve data: selects curve (evidence: `README.md`)
- MATLAB/Octave user → Historical wind data: loads data (evidence: `README.md`)
- MATLAB/Octave user → Date to period index: finds period (evidence: `README.md`)
- MATLAB/Octave user → Period index to date: converts period (evidence: `README.md`)
- MATLAB/Octave user → Simulation example: runs example (evidence: `README.md`)
- MATLAB/Octave user → Site capacities: uses capacities (evidence: `README.md`)
- Wind model → Wind forecasts: provides method (evidence: `README.md`)
- Wind model → Transition probabilities: provides method (evidence: `README.md`)
- Wind model → Wind realizations: provides method (evidence: `README.md`)
- Wind model → Speed to power: provides method (evidence: `README.md`)
