# rteloli/b-sinarx architecture

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

- Interactive diagram: https://gitdiagram.com/rteloli/b-sinarx
- Repository: https://github.com/rteloli/b-sinarx

## Overview

B-SINARX is a MATLAB framework for identifying nonlinear autoregressive models with exogenous inputs, optionally combining learned discrepancies with known physics. The documented workflow is to run a numerical or experimental example, prepare delayed input/output data, construct candidate basis functions, and train with sparse or sparse-Bayesian regression; the resulting model supports posterior uncertainty and closed-loop prediction. Experimental data is downloaded separately. The README documents these capabilities and repository roles, but no source excerpts were provided, so the graph omits unverified call-level links.

Main entry points: [`Main SINDy/BSINARX.m`](https://github.com/rteloli/b-sinarx/blob/main/Main%20SINDy/BSINARX.m) (B-SINARX model), [`Main SINDy/Algorithms/Train Algorithms`](https://github.com/rteloli/b-sinarx/tree/main/Main%20SINDy/Algorithms/Train%20Algorithms) (Training algorithms), [`Data/Experimental Data GenData`](https://github.com/rteloli/b-sinarx/tree/main/Data/Experimental%20Data%20GenData) (Experimental data processing), [`Main SINDy/Utils`](https://github.com/rteloli/b-sinarx/tree/main/Main%20SINDy/Utils) (Closed-loop prediction)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_examples["Examples and data"]
  node_numerical_example["Numerical example"]
  node_experimental_example["Experimental example"]
  node_bouc_wen["Bouc–Wen simulator"]
  node_experimental_processing["Experimental data processing"]
  node_zenodo_data[("Experimental measurements")]
end

subgraph group_modeling["Model construction"]
  node_training_data["Delayed data matrices<br/>[getTrainingData3.m]"]
  node_baseline["Baseline physics"]
  node_basis_libraries["Candidate libraries"]
  node_bsinarx["B-SINARX model<br/>[BSINARX.m]"]
end

subgraph group_training["Sparse training"]
  node_sparse_regression["Sparse regression routines"]
  node_training_algorithms["Training algorithms"]
  node_sparse_solvers["Sparse solvers"]
  node_bayesian_sindy["Bayesian SINDy<br/>[bayesianSINDy.m]"]
end

subgraph group_prediction["Prediction and analysis"]
  node_closed_loop["Closed-loop prediction"]
  node_analysis_tools["Plots and post-processing"]
end

node_user(("MATLAB user"))

node_user -->|"runs"| node_numerical_example
node_user -->|"runs"| node_experimental_example
node_user -->|"downloads"| node_zenodo_data
node_zenodo_data -->|"provides measurements"| node_experimental_processing
node_bouc_wen -->|"generates example data"| node_numerical_example
node_experimental_processing -->|"prepares measurements"| node_experimental_example
node_training_data -->|"supplies delayed data"| node_bsinarx
node_basis_libraries -->|"provides candidate terms"| node_bsinarx
node_baseline -->|"provides known physics"| node_bsinarx
node_bsinarx -->|"trains with"| node_training_algorithms
node_training_algorithms -->|"uses regression routines"| node_sparse_regression
node_training_algorithms -->|"selects sparse solvers"| node_sparse_solvers
node_training_algorithms -->|"supports Bayesian training"| node_bayesian_sindy
node_bsinarx -->|"supports prediction"| node_closed_loop
node_closed_loop -->|"supports analysis"| node_analysis_tools

click node_numerical_example "https://github.com/rteloli/b-sinarx/blob/main/example_MainNumericalModel.m"
click node_experimental_example "https://github.com/rteloli/b-sinarx/blob/main/example_MainExperModel.m"
click node_bouc_wen "https://github.com/rteloli/b-sinarx/tree/main/Data/Numerical%20Data%20Generation"
click node_experimental_processing "https://github.com/rteloli/b-sinarx/tree/main/Data/Experimental%20Data%20GenData"
click node_training_data "https://github.com/rteloli/b-sinarx/blob/main/Data/getTrainingData3.m"
click node_baseline "https://github.com/rteloli/b-sinarx/blob/main/Data/BaselineDiscreteModel.m"
click node_basis_libraries "https://github.com/rteloli/b-sinarx/tree/main/Main%20SINDy/Libraries"
click node_bsinarx "https://github.com/rteloli/b-sinarx/blob/main/Main%20SINDy/BSINARX.m"
click node_sparse_regression "https://github.com/rteloli/b-sinarx/tree/main/Main%20SINDy/SINDy%20Calculations"
click node_training_algorithms "https://github.com/rteloli/b-sinarx/tree/main/Main%20SINDy/Algorithms/Train%20Algorithms"
click node_sparse_solvers "https://github.com/rteloli/b-sinarx/tree/main/Main%20SINDy/Algorithms"
click node_bayesian_sindy "https://github.com/rteloli/b-sinarx/blob/main/Main%20SINDy/SINDy%20Calculations/bayesianSINDy.m"
click node_closed_loop "https://github.com/rteloli/b-sinarx/tree/main/Main%20SINDy/Utils"
click node_analysis_tools "https://github.com/rteloli/b-sinarx/tree/main/Utility%20Funcs"

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_numerical_example,node_experimental_example,node_bouc_wen,node_experimental_processing,node_zenodo_data,node_user toneBlue
class node_training_data,node_baseline,node_basis_libraries,node_bsinarx toneAmber
class node_sparse_regression,node_training_algorithms,node_sparse_solvers,node_bayesian_sindy toneMint
class node_closed_loop,node_analysis_tools toneRose
```

## Components

### Examples and data

- [Numerical example](https://github.com/rteloli/b-sinarx/blob/main/example_MainNumericalModel.m): `example_MainNumericalModel.m`
- [Experimental example](https://github.com/rteloli/b-sinarx/blob/main/example_MainExperModel.m): `example_MainExperModel.m`
- [Bouc–Wen simulator](https://github.com/rteloli/b-sinarx/tree/main/Data/Numerical%20Data%20Generation): `Data/Numerical Data Generation`
- [Experimental data processing](https://github.com/rteloli/b-sinarx/tree/main/Data/Experimental%20Data%20GenData): `Data/Experimental Data GenData`
- **Experimental measurements**

### Model construction

- [Delayed data matrices](https://github.com/rteloli/b-sinarx/blob/main/Data/getTrainingData3.m): `Data/getTrainingData3.m`
- [Baseline physics](https://github.com/rteloli/b-sinarx/blob/main/Data/BaselineDiscreteModel.m): `Data/BaselineDiscreteModel.m`
- [Candidate libraries](https://github.com/rteloli/b-sinarx/tree/main/Main%20SINDy/Libraries): `Main SINDy/Libraries`
- [B-SINARX model](https://github.com/rteloli/b-sinarx/blob/main/Main%20SINDy/BSINARX.m): `Main SINDy/BSINARX.m`

### Sparse training

- [Sparse regression routines](https://github.com/rteloli/b-sinarx/tree/main/Main%20SINDy/SINDy%20Calculations): `Main SINDy/SINDy Calculations`
- [Training algorithms](https://github.com/rteloli/b-sinarx/tree/main/Main%20SINDy/Algorithms/Train%20Algorithms): `Main SINDy/Algorithms/Train Algorithms`
- [Sparse solvers](https://github.com/rteloli/b-sinarx/tree/main/Main%20SINDy/Algorithms): `Main SINDy/Algorithms`
- [Bayesian SINDy](https://github.com/rteloli/b-sinarx/blob/main/Main%20SINDy/SINDy%20Calculations/bayesianSINDy.m): `Main SINDy/SINDy Calculations/bayesianSINDy.m`

### Prediction and analysis

- [Closed-loop prediction](https://github.com/rteloli/b-sinarx/tree/main/Main%20SINDy/Utils): `Main SINDy/Utils`
- [Plots and post-processing](https://github.com/rteloli/b-sinarx/tree/main/Utility%20Funcs): `Utility Funcs`

### Other components

- **MATLAB user**

## Connections

- MATLAB user → Numerical example: runs (evidence: `README.md`)
- MATLAB user → Experimental example: runs (evidence: `README.md`)
- MATLAB user → Experimental measurements: downloads (evidence: `README.md`)
- Experimental measurements → Experimental data processing: provides measurements (evidence: `README.md`)
- Bouc–Wen simulator → Numerical example: generates example data (evidence: `README.md`)
- Experimental data processing → Experimental example: prepares measurements (evidence: `README.md`)
- Delayed data matrices → B-SINARX model: supplies delayed data (evidence: `README.md`)
- Candidate libraries → B-SINARX model: provides candidate terms (evidence: `README.md`)
- Baseline physics → B-SINARX model: provides known physics (evidence: `README.md`)
- B-SINARX model → Training algorithms: trains with (evidence: `README.md`)
- Training algorithms → Sparse regression routines: uses regression routines (evidence: `README.md`)
- Training algorithms → Sparse solvers: selects sparse solvers (evidence: `README.md`)
- Training algorithms → Bayesian SINDy: supports Bayesian training (evidence: `README.md`)
- B-SINARX model → Closed-loop prediction: supports prediction (evidence: `README.md`)
- Closed-loop prediction → Plots and post-processing: supports analysis (evidence: `README.md`)
