# parthib007/ev_modelling_btms architecture

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

- Interactive diagram: https://gitdiagram.com/parthib007/ev_modelling_btms
- Repository: https://github.com/parthib007/ev_modelling_btms

## Overview

##### Project type and purpose
- This is a high-fidelity simulation project in MATLAB/Simulink/Simscape that models a pure electric vehicle (EV) drivetrain coupled with a liquid-based Battery Thermal Management System (BTMS).
- Its two main goals are:
- Simulate vehicle longitudinal dynamics under a standard drive cycle (FTP75) via a PI-based driver and power electronics
- Maintain battery temperature (20–40 °C) using an intelligent multi-path liquid cooling/heating loop

##### File structure
- Top-level files:
- ElectricVehicleThermalManagement.m – main simulation script or model loader
- ElectricVehicleThermalManagementParameters.m – parameter definitions (battery, control gains, thermal properties)
- ElectricVehicleThermalManagementPlot1Power.m – post-processing/plotting of power and efficiency results
- ElectricVehicleThermalManagementScenario.m – scenario setup (drive cycle selection, environmental conditions)
- README.md – project overview, architecture, and usage instructions
- No separate “src” or “lib” folders because the core logic lives in MATLAB scripts and Simulink models (referenced inside the .m files).

##### README for additional insights
Driver → Power Control Unit (PCU) → Motor → Vehicle dynamics
Battery (SOC & heat generation) ↔ Cooling Plate → Coolant Loop → 4-Way Valve → {Radiator, Heater, Chiller} → Loop
- It specifies technologies: MATLAB R2023b, Simulink, Simscape & Simscape Fluids

##### Detail without over-complicating
- Every module in the MATLAB file tree and the Simulink/Simscape blocks it references
- Parameter injection points (from ElectricVehicleThermalManagementParameters.m)
- Scenario-driven entry point (ElectricVehicleThermalManagementScenario.m) and the plotting script

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Project Scripts"
        Scenario("Scenario Setup\n(ElectricVehicleThermalManagementScenario.m)"):::sub
        Parameters("Parameter Definitions\n(ElectricVehicleThermalManagementParameters.m)"):::sub
        MainScript("Main Simulation\n(ElectricVehicleThermalManagement.m)"):::sub
        Plot("Post-Processing & Plotting\n(ElectricVehicleThermalManagementPlot1Power.m)"):::sub
        Readme("Project Documentation\n(README.md)"):::external
    end

    subgraph "Control Layer"
        LD("Longitudinal Driver (PI, FTP75)"):::control
        PCU("Power Control Unit (PWM & Inverter)"):::control
    end

    subgraph "EV Drivetrain"
        Motor("Traction Motor"):::power
        Vehicle("Vehicle Body Dynamics"):::power
    end

    subgraph "Battery Thermal Management"
        Battery("Battery Pack\n(Li-ion, SOC & Heat Gen)"):::sub
        CP("Cooling Plate"):::thermal
        Loop("Coolant Loop\n(Pump & Piping)"):::thermal
        Valve{"4-Way Valve"}:::thermal
        Radiator("Radiator"):::thermal
        Heater("Heater"):::thermal
        Chiller("2-Phase Chiller\n(A/C Integrated)"):::thermal
    end

    subgraph "External Environment"
        Ambient("Ambient Air"):::external
        AC("A/C System Interface"):::external
    end

    %% Connections
    Scenario -->|“configure”| LD
    Scenario -->|“configure”| Valve
    Parameters -->|“load params”| LD
    Parameters -->|“load params”| PCU
    Parameters -->|“load params”| Battery
    MainScript -->|“orchestrates”| LD
    MainScript -->|“orchestrates”| PCU
    LD -->|“control signal”| PCU
    PCU -->|“electrical power”| Motor
    Battery -->|“electrical supply”| PCU
    Motor -->|“mechanical torque”| Vehicle
    Battery -->|“thermal energy”| CP
    CP -->|“fluid heat transfer”| Loop
    Loop -->|“flow”| Valve
    Valve -->|“path”| Radiator
    Valve -->|“path”| Heater
    Valve -->|“path”| Chiller
    Radiator -->|“return flow”| Loop
    Heater -->|“return flow”| Loop
    Chiller -->|“return flow”| Loop
    Ambient -->|“cooling air”| Radiator
    AC -->|“coolant”| Chiller
    Vehicle -->|“results”| Plot
    Motor -->|“results”| Plot
    Battery -->|“results”| Plot

    %% Click Events
    click Scenario "https://github.com/parthib007/ev_modelling_btms/blob/main/ElectricVehicleThermalManagementScenario.m"
    click Parameters "https://github.com/parthib007/ev_modelling_btms/blob/main/ElectricVehicleThermalManagementParameters.m"
    click MainScript "https://github.com/parthib007/ev_modelling_btms/blob/main/ElectricVehicleThermalManagement.m"
    click Plot "https://github.com/parthib007/ev_modelling_btms/blob/main/ElectricVehicleThermalManagementPlot1Power.m"
    click Readme "https://github.com/parthib007/ev_modelling_btms/blob/main/README.md"

    %% Styling
    classDef control fill:#a8e6cf,stroke:#333,stroke-width:1px;
    classDef power fill:#dcedc1,stroke:#333,stroke-width:1px;
    classDef thermal fill:#ff8b94,stroke:#333,stroke-width:1px;
    classDef sub fill:#e0e0e0,stroke:#333,stroke-width:1px;
    classDef external fill:#feda6a,stroke:#333,stroke-width:1px;

    %% Link Colors
    linkStyle 0 stroke:#00aa00,stroke-width:2px;
    linkStyle 1 stroke:#00aa00,stroke-width:2px;
    linkStyle 2 stroke:#00aa00,stroke-width:2px;
    linkStyle 3 stroke:#00aa00,stroke-width:2px;
    linkStyle 4 stroke:#777,stroke-width:2px;
    linkStyle 5 stroke:#777,stroke-width:2px;
    linkStyle 6 stroke:#00aa00,stroke-width:2px;
    linkStyle 7 stroke:#0000ff,stroke-width:2px;
    linkStyle 8 stroke:#0000ff,stroke-width:2px;
    linkStyle 9 stroke:#ff0000,stroke-width:2px;
    linkStyle 10 stroke:#ff0000,stroke-width:2px;
    linkStyle 11 stroke:#ff0000,stroke-width:2px;
    linkStyle 12 stroke:#ff0000,stroke-width:2px;
    linkStyle 13 stroke:#ff0000,stroke-width:2px;
    linkStyle 14 stroke:#ff0000,stroke-width:2px;
    linkStyle 15 stroke:#ff0000,stroke-width:2px;
    linkStyle 16 stroke:#00aa00,stroke-width:2px;
    linkStyle 17 stroke:#0000ff,stroke-width:2px;
    linkStyle 18 stroke:#0000ff,stroke-width:2px;
    linkStyle 19 stroke:#0000ff,stroke-width:2px;
    linkStyle 20 stroke:#0000ff,stroke-width:2px;
```
