# hnainiamohamedamine29/vtol_system_modeling architecture

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

- Interactive diagram: https://gitdiagram.com/hnainiamohamedamine29/vtol_system_modeling
- Repository: https://github.com/hnainiamohamedamine29/vtol_system_modeling

## Overview

This repository is a collection of standalone VTOL control and simulation scripts, rather than one integrated application. The principal workflow in `wind_simulation.py` builds a linear aircraft model, computes LQR and Kalman gains, simulates wind-disturbed flight, then plots state estimates and animates the trajectory. `Simulation.py` provides a separate interactive discrete-time simulation, while `PID_vs_LQR.py` compares PID and LQR on a reduced model. README capabilities are represented where the sampled code supports them; the documented `vtol_simulation.py` entry point is absent from the tree, and `VTOL_system.m` was not sampled.

Main entry points: [`wind_simulation.py`](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/wind_simulation.py) (Flight simulation), [`Simulation.py`](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/Simulation.py) (Interactive simulation), [`PID_vs_LQR.py`](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/PID_vs_LQR.py) (Reduced model simulation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_wind["Wind Simulation"]
  node_wind_model["Aircraft model<br/>[wind_simulation.py]"]
  node_wind_control["LQR control<br/>[wind_simulation.py]"]
  node_wind_estimator["Kalman estimator<br/>[wind_simulation.py]"]
  node_wind_disturbance["Wind disturbance<br/>[wind_simulation.py]"]
  node_wind_run["Flight simulation<br/>[wind_simulation.py]"]
  node_wind_plots["State plots<br/>[wind_simulation.py]"]
  node_wind_animation["3D animation<br/>[wind_simulation.py]"]
end

subgraph group_interactive["Interactive Simulation"]
  node_interactive_run["Interactive simulation<br/>[Simulation.py]"]
  node_interactive_control["Discrete LQR<br/>[Simulation.py]"]
  node_interactive_estimator["Discrete estimator<br/>[Simulation.py]"]
  node_interactive_input["Reference input<br/>[Simulation.py]"]
  node_interactive_display["Live plots<br/>[Simulation.py]"]
end

subgraph group_comparison["Controller Comparison"]
  node_compare_run["Reduced model simulation<br/>[PID_vs_LQR.py]"]
  node_compare_lqr["LQR controller<br/>[PID_vs_LQR.py]"]
  node_compare_pid["PID controller<br/>[PID_vs_LQR.py]"]
  node_compare_plots["Response comparison<br/>[PID_vs_LQR.py]"]
end

node_user(("Simulation user"))

node_wind_run -->|"integrates dynamics"| node_wind_model
node_wind_run -->|"computes control"| node_wind_control
node_wind_run -->|"updates estimate"| node_wind_estimator
node_wind_run -->|"applies wind"| node_wind_disturbance
node_wind_run -->|"plots logged states"| node_wind_plots
node_wind_run -->|"animates trajectory"| node_wind_animation
node_user -->|"sets references"| node_interactive_input
node_interactive_run -->|"reads references"| node_interactive_input
node_interactive_run -->|"computes control"| node_interactive_control
node_interactive_run -->|"updates estimate"| node_interactive_estimator
node_interactive_run -->|"plots responses"| node_interactive_display
node_compare_run -->|"computes LQR"| node_compare_lqr
node_compare_run -->|"computes PID"| node_compare_pid
node_compare_run -->|"plots responses"| node_compare_plots

click node_wind_model "https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/wind_simulation.py"
click node_wind_control "https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/wind_simulation.py"
click node_wind_estimator "https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/wind_simulation.py"
click node_wind_disturbance "https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/wind_simulation.py"
click node_wind_run "https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/wind_simulation.py"
click node_wind_plots "https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/wind_simulation.py"
click node_wind_animation "https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/wind_simulation.py"
click node_interactive_run "https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/Simulation.py"
click node_interactive_control "https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/Simulation.py"
click node_interactive_estimator "https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/Simulation.py"
click node_interactive_input "https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/Simulation.py"
click node_interactive_display "https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/Simulation.py"
click node_compare_run "https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/PID_vs_LQR.py"
click node_compare_lqr "https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/PID_vs_LQR.py"
click node_compare_pid "https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/PID_vs_LQR.py"
click node_compare_plots "https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/PID_vs_LQR.py"

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_wind_model,node_wind_control,node_wind_estimator,node_wind_disturbance,node_wind_run,node_wind_plots,node_wind_animation,node_user toneBlue
class node_interactive_run,node_interactive_control,node_interactive_estimator,node_interactive_input,node_interactive_display toneAmber
class node_compare_run,node_compare_lqr,node_compare_pid,node_compare_plots toneMint
```

## Components

### Wind Simulation

- [Aircraft model](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/wind_simulation.py): `wind_simulation.py`
- [LQR control](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/wind_simulation.py): `wind_simulation.py`
- [Kalman estimator](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/wind_simulation.py): `wind_simulation.py`
- [Wind disturbance](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/wind_simulation.py): `wind_simulation.py`
- [Flight simulation](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/wind_simulation.py): `wind_simulation.py`
- [State plots](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/wind_simulation.py): `wind_simulation.py`
- [3D animation](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/wind_simulation.py): `wind_simulation.py`

### Interactive Simulation

- [Interactive simulation](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/Simulation.py): `Simulation.py`
- [Discrete LQR](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/Simulation.py): `Simulation.py`
- [Discrete estimator](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/Simulation.py): `Simulation.py`
- [Reference input](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/Simulation.py): `Simulation.py`
- [Live plots](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/Simulation.py): `Simulation.py`

### Controller Comparison

- [Reduced model simulation](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/PID_vs_LQR.py): `PID_vs_LQR.py`
- [LQR controller](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/PID_vs_LQR.py): `PID_vs_LQR.py`
- [PID controller](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/PID_vs_LQR.py): `PID_vs_LQR.py`
- [Response comparison](https://github.com/hnainiamohamedamine29/vtol_system_modeling/blob/main/PID_vs_LQR.py): `PID_vs_LQR.py`

### Other components

- **Simulation user**

## Connections

- Flight simulation → Aircraft model: integrates dynamics (evidence: `wind_simulation.py`)
- Flight simulation → LQR control: computes control (evidence: `wind_simulation.py`)
- Flight simulation → Kalman estimator: updates estimate (evidence: `wind_simulation.py`)
- Flight simulation → Wind disturbance: applies wind (evidence: `wind_simulation.py`)
- Flight simulation → State plots: plots logged states (evidence: `wind_simulation.py`)
- Flight simulation → 3D animation: animates trajectory (evidence: `wind_simulation.py`)
- Simulation user → Reference input: sets references (evidence: `Simulation.py`)
- Interactive simulation → Reference input: reads references (evidence: `Simulation.py`)
- Interactive simulation → Discrete LQR: computes control (evidence: `Simulation.py`)
- Interactive simulation → Discrete estimator: updates estimate (evidence: `Simulation.py`)
- Interactive simulation → Live plots: plots responses (evidence: `Simulation.py`)
- Reduced model simulation → LQR controller: computes LQR (evidence: `PID_vs_LQR.py`)
- Reduced model simulation → PID controller: computes PID (evidence: `PID_vs_LQR.py`)
- Reduced model simulation → Response comparison: plots responses (evidence: `PID_vs_LQR.py`)
