# arslanadeel/energywindfarmestimation architecture

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

- Interactive diagram: https://gitdiagram.com/arslanadeel/energywindfarmestimation
- Repository: https://github.com/arslanadeel/energywindfarmestimation

## Overview

##### Project Type and Purpose
- This is a MATLAB‐based desktop GUI application for Wind Farm Layout and Wind Data Analysis.
- Core logic is organized into MATLAB class folders (@Area, @WindFarm, @WindModel, @WindTurbine) plus auxiliary data loaders and power‐curve datasets.

##### High‐Level Architectural View
- Layered (kind of MVC) structure:
a. Presentation Layer: GUI (WindFarmOptimizer1.m/.fig)
b. Controller/Orchestration: GUI callbacks invoke services in business‐logic modules
c. Business Logic Layer:
- Area module (@Area) – handles geographical data images and area calculations
- WindFarm module (@WindFarm) – computes farm‐level power/annual energy, layout optimization
- WindModel module (@WindModel) – wind‐speed profile modeling, Weibull distribution, filtering
- WindTurbine module (@WindTurbine) – per‐turbine power/energy calculations
d. Data Access Layer:
- WindModelLoadData – loads raw wind‐data (sprog.tsv, SprogoData.mat)
- PowerCurveData folder – .mat files for turbine power curves and ExtractData.m
e. Visualization/Output – plot.m in each module produces graphs; GUI displays them.

##### Main Components and Their Relationships
[User]
↓ interacts with
[GUI: WindFarmOptimizer1.fig/.m]
↓ calls
[Controllers inside GUI]
↓ orchestrate
┌─────────────────────────────────────┐
│ Business Logic Layer (MATLAB @-folders) │
└─────────────────────────────────────┘
- Area module ↔ GeographicalDataImage(.m/.2.m)
- WindModel module ↔ Weibull, filter, velocity‐height routines
- WindTurbine module → getPower, getEnergy
- WindFarm module ← uses WindModel + WindTurbine to compute farm metrics
↓ each module calls
[Data Access Layer]
- WindModelLoadData – loads raw wind data
- PowerCurveData – ExtractData.m + .mat datasets
↓ data flow
[Data Storage: .mat files, .tsv files]
↓ back to modules → visualized via plot() functions → sent back to GUI

##### Architectural Patterns & Design Principles
- Layered separation: UI vs. core computation vs. data access
- Modular design: each physical @-folder is a cohesive class/module
- Single responsibility: Area vs. WindModel vs. WindTurbine vs. WindFarm
- Data-driven design: .mat/.tsv files as external config/data

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Presentation Layer
    subgraph "Presentation Layer"
        direction TB
        GUI_fig["WindFarmOptimizer1.fig"]:::ui
        GUI_m["WindFarmOptimizer1.m"]:::ui
    end

    %% Business Logic Layer
    subgraph "Business Logic Layer"
        direction TB
        Area["@Area Module"]:::area
        WindFarm["@WindFarm Module"]:::farm
        WindModel["@WindModel Module"]:::model
        WindTurbine["@WindTurbine Module"]:::turbine
    end

    %% Data Access Layer
    subgraph "Data Access Layer"
        direction TB
        WMLoad["WindModelLoadData"]:::dataAccess
        PCDataLoader["PowerCurveData Loader"]:::dataAccess
    end

    %% Data Storage
    subgraph "Data Storage"
        direction TB
        TSV["sprog.tsv"]:::storage
        Sprogo["SprogoData.mat"]:::storage
        PCData["PowerCurveData *.mat"]:::storage
    end

    %% Connections
    GUI_fig -->|calls| WindFarm
    GUI_m   -->|calls| WindFarm
    GUI_fig -->|calls| Area
    GUI_m   -->|calls| Area

    WindFarm -->|uses| WindModel
    WindFarm -->|uses| WindTurbine
    Area -->|loads images| Area

    WindModel -->|loads| WMLoad
    WindTurbine -->|loads| PCDataLoader

    WMLoad -->|reads| TSV
    WMLoad -->|reads| Sprogo
    PCDataLoader -->|reads| PCData

    WindFarm -->|plots| GUI_fig
    WindModel -->|plots| GUI_fig
    WindTurbine -->|plots| GUI_fig
    Area -->|plots| GUI_fig

    %% Click Events
    click GUI_fig "https://github.com/arslanadeel/energywindfarmestimation/blob/master/WindFarmOptimizer1.fig"
    click GUI_m "https://github.com/arslanadeel/energywindfarmestimation/blob/master/WindFarmOptimizer1.m"
    click Area "https://github.com/arslanadeel/energywindfarmestimation/tree/master/@Area"
    click WindFarm "https://github.com/arslanadeel/energywindfarmestimation/tree/master/@WindFarm"
    click WindModel "https://github.com/arslanadeel/energywindfarmestimation/tree/master/@WindModel"
    click WindTurbine "https://github.com/arslanadeel/energywindfarmestimation/tree/master/@WindTurbine"
    click WMLoad "https://github.com/arslanadeel/energywindfarmestimation/blob/master/@WindModelLoadData/WindModelLoadData.m"
    click PCDataLoader "https://github.com/arslanadeel/energywindfarmestimation/blob/master/PowerCurveData/ExtractData.m"
    click TSV "https://github.com/arslanadeel/energywindfarmestimation/blob/master/@WindModel/sprog.tsv"
    click Sprogo "https://github.com/arslanadeel/energywindfarmestimation/blob/master/SprogoData.mat"
    click PCData "https://github.com/arslanadeel/energywindfarmestimation/tree/master/PowerCurveData"

    %% Styles
    classDef ui fill:#FFD699,stroke:#E59400,stroke-width:1px;
    classDef area fill:#CCE5FF,stroke:#3399FF,stroke-width:1px;
    classDef farm fill:#CCFFCC,stroke:#33CC33,stroke-width:1px;
    classDef model fill:#CCE5FF,stroke:#3399FF,stroke-width:1px;
    classDef turbine fill:#CCFFCC,stroke:#33CC33,stroke-width:1px;
    classDef dataAccess fill:#FFF2CC,stroke:#E6B800,stroke-width:1px;
    classDef storage fill:#FFDDCC,stroke:#FF6600,stroke-width:1px;
```
