Skip to content

Commit 435755c

Browse files
committed
Complex systems implemented
1 parent 38b7172 commit 435755c

70 files changed

Lines changed: 8850 additions & 871 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CONTRIBUTING.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Contributing
2+
3+
Thanks for contributing to DifferentialLab.
4+
5+
## Setup
6+
7+
```bash
8+
pip install -e ".[dev]"
9+
```
10+
11+
Optional documentation toolchain:
12+
13+
```bash
14+
pip install -e ".[docs]"
15+
```
16+
17+
## Before opening a PR
18+
19+
1. Run tests:
20+
21+
```bash
22+
pytest
23+
```
24+
25+
2. Run lint checks:
26+
27+
```bash
28+
ruff check src tests
29+
```
30+
31+
3. If typing checks are used in your workflow:
32+
33+
```bash
34+
mypy src
35+
```
36+
37+
4. Update docs for user-visible changes:
38+
- `README.md`
39+
- `docs/` pages
40+
- API refs if public interfaces changed
41+
42+
## Plugin contributions (`complex_problems`)
43+
44+
If you add a plugin:
45+
46+
- implement package structure (`problem.py`, `ui.py`, `solver.py`, `result_dialog.py`)
47+
- register it in `src/complex_problems/problem_registry.py`
48+
- add solver + registry tests
49+
- update `docs/complex-problems.md` and `docs/api/complex_problems.rst`
50+
51+
## Style
52+
53+
- Keep numerical kernels separated from GUI code.
54+
- Validate UI inputs before solver execution.
55+
- Expose structured result dataclasses with explicit `metadata` and `magnitudes`.

README.md

Lines changed: 84 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -4,137 +4,143 @@
44

55
# DifferentialLab
66

7-
**Numerical ODE, difference equation, and PDE solver with a graphical interface for scientists, engineers, and students.**
7+
Numerical ODE, difference-equation, and PDE solver with a desktop GUI for science and engineering workflows.
88

99
[![Python](https://img.shields.io/badge/Python-3.12+-3776AB?style=for-the-badge&logo=python&logoColor=white)](https://www.python.org/)
1010
[![License](https://img.shields.io/badge/License-MIT-green.svg?style=for-the-badge)](license.md)
1111
[![Version](https://img.shields.io/badge/version-0.4.1-blue.svg?style=for-the-badge)](https://github.com/DOKOS-TAYOS/DifferentialLab)
1212
[![Status](https://img.shields.io/badge/status-Beta-orange.svg?style=for-the-badge)](https://github.com/DOKOS-TAYOS/DifferentialLab)
13-
[![SciPy](https://img.shields.io/badge/SciPy-8CAAE6?style=for-the-badge&logo=scipy&logoColor=white)](https://scipy.org/)
14-
[![NumPy](https://img.shields.io/badge/NumPy-013243?style=for-the-badge&logo=numpy&logoColor=white)](https://numpy.org/)
15-
[![Matplotlib](https://img.shields.io/badge/Matplotlib-11557c?style=for-the-badge&logo=matplotlib&logoColor=white)](https://matplotlib.org/)
1613

17-
[📖 **Documentation**](docs/index.md)[🐛 **Report Bug**](https://github.com/DOKOS-TAYOS/DifferentialLab/issues)[💡 **Request Feature**](https://github.com/DOKOS-TAYOS/DifferentialLab/issues)
14+
[Documentation](docs/index.md) |
15+
[Report Bug](https://github.com/DOKOS-TAYOS/DifferentialLab/issues) |
16+
[Request Feature](https://github.com/DOKOS-TAYOS/DifferentialLab/issues)
1817

1918
</div>
2019

21-
---
22-
23-
## Features
24-
25-
- **ODEs**: Six methods (RK45, RK23, DOP853, Radau, BDF, LSODA) via SciPy
26-
- **Difference equations**: Recurrence relations (geometric growth, logistic map, Fibonacci, etc.)
27-
- **PDEs**: 2D elliptic solver (Poisson, Laplace) plus general operator-based PDEs with configurable derivative terms
28-
- **Vector ODEs**: Coupled systems with animation, 3D phase-space trajectories, and surface visualization
29-
- **Unified f-notation**: Write equations using `f[0]` (function), `f[1]` (first derivative), `f[i,k]` (component i, derivative k for vector ODEs)
30-
- **Predefined equations**: Harmonic oscillator, pendulum, Van der Pol, Lorenz, Lotka-Volterra, Duffing, Schrödinger, and more
31-
- **Complex Problems** *(experimental)*: Special cases with custom UIs (e.g. coupled harmonic oscillators). Still in development; may contain bugs.
32-
- **Function transforms**: Fourier (FFT), Laplace, Taylor series, Hilbert, Z-transform
33-
- **Custom equations**: Write any ODE, difference equation, or PDE in Python syntax
34-
- **Interactive result tabs**: Select derivatives to plot, choose phase-space axes, switch visualization modes without re-solving
35-
- **Professional plots**: Solution curves, phase portraits (2D/3D), surface/contour, vector animation
36-
- **Statistics**: Mean, max/min, period, energy, RMS, residual error metrics
37-
- **Export**: CSV, JSON, PNG/JPG/PDF, MP4 animation
38-
- **Configurable** via `.env` file or in-app Configuration dialog
39-
- **Desktop GUI** built with Tkinter/ttk
20+
## What It Solves
21+
22+
- ODEs with SciPy integrators (`RK45`, `RK23`, `DOP853`, `Radau`, `BDF`, `LSODA`)
23+
- Difference equations (recurrence systems)
24+
- PDEs (elliptic 2D solver and operator-based PDE workflows)
25+
- Vector ODE systems with dedicated visualization modes
26+
- Function transforms (Fourier, Laplace, Taylor, Hilbert, Z-transform)
27+
28+
## Core Features
29+
30+
- Predefined equation catalog loaded from YAML (`config/equations/*.yaml`)
31+
- Custom equation parsing with safe AST validation
32+
- Unified `f[...]` notation (`f[0]`, `f[1]`, `f[i,k]`)
33+
- Interactive result dialogs (derivative selection, phase-space selection, dynamic redraw)
34+
- Export to CSV, JSON, static figures, and MP4 animations
35+
- Configurable UI/plot/solver behavior via `.env` or in-app configuration dialog
36+
37+
## Complex Problems (Plugin Mode)
38+
39+
`Complex Problems` is a plugin-style subsystem for specialized models with custom UI, solver, and result dialogs.
40+
41+
Current modules:
42+
43+
- `coupled_oscillators` (1D coupled oscillators and FPUT variants)
44+
- `membrane_2d` (2D coupled nonlinear membrane)
45+
- `nonlinear_waves` (NLSE and KdV)
46+
- `schrodinger_td` (time-dependent Schrodinger in 1D/2D)
47+
- `antenna_radiation` (far-field patterns and antenna metrics)
48+
- `aerodynamics_2d` (2D incompressible obstacle flow approximations)
49+
- `pipe_flow` (steady and transient 1D pipe-flow models)
4050

4151
## Requirements
4252

43-
- Python 3.12 or higher
44-
- Windows 10/11, macOS 10.14+, or Linux
45-
- 4 GB RAM minimum
53+
- Python `>=3.12`
54+
- Windows 10/11, macOS, or Linux
55+
- Tkinter available in the Python runtime (GUI requirement)
4656

4757
## Quick Start
4858

49-
### Installation (first-time setup)
59+
### First-time setup
5060

51-
**Windows:**
52-
```
61+
Windows:
62+
63+
```bat
5364
install.bat
5465
```
5566

56-
**Linux/macOS:**
67+
Linux/macOS:
68+
5769
```bash
5870
chmod +x install.sh
5971
./install.sh
6072
```
6173

62-
This clones the repository (if needed) and runs setup.
74+
### Existing clone
6375

64-
### Manual setup (existing clone)
76+
Windows:
6577

66-
1. Create virtual environment and install dependencies:
67-
```bash
68-
# Windows
78+
```bat
6979
bin\setup.bat
70-
71-
# Linux/macOS
72-
chmod +x bin/setup.sh
73-
./bin/setup.sh
80+
bin\run.bat
7481
```
7582

76-
2. Run the application:
77-
```bash
78-
# Windows
79-
bin\run.bat
83+
Linux/macOS:
8084

81-
# Linux/macOS
85+
```bash
86+
chmod +x bin/setup.sh bin/run.sh
87+
./bin/setup.sh
8288
./bin/run.sh
8389
```
8490

85-
Or run directly:
91+
Direct run:
92+
8693
```bash
8794
python src/main_program.py
8895
```
8996

90-
## Configuration
91-
92-
Copy `.env.example` to `.env` and customize, or use the in-app **Configuration** dialog.
97+
Installed console entry point:
9398

94-
Available settings:
95-
- UI theme (colors, fonts, padding, tooltips)
96-
- Plot style (line, markers, fonts, phase-space, 3D/contour, animation)
97-
- Solver defaults (method, tolerances)
98-
- Logging and update check
99+
```bash
100+
differential-lab
101+
```
99102

100103
## Documentation
101104

102-
Full documentation is built with [Sphinx](https://www.sphinx-doc.org/) and hosted on Read the Docs.
105+
- [Documentation Home](docs/index.md)
106+
- [Getting Started](docs/getting-started.md)
107+
- [User Guide](docs/user-guide.md)
108+
- [Complex Problems Guide](docs/complex-problems.md)
109+
- [Configuration Reference](docs/configuration.md)
110+
- [Architecture](docs/architecture.md)
111+
- [Developer Guide](docs/developer-guide.md)
112+
- [Testing](docs/testing.md)
113+
- [API Reference](docs/api/index.md)
103114

104-
To build the docs locally:
115+
To build docs locally:
105116

106117
```bash
107118
pip install -e ".[docs]"
108119
cd docs
109-
make html # Linux/macOS
110-
make.bat html # Windows
120+
make html # Linux/macOS
121+
make.bat html # Windows
111122
```
112123

113-
The output will be in `docs/_build/html/`.
124+
Output directory: `docs/_build/html/`.
114125

115-
Documentation contents:
116-
- **Getting Started** — installation, setup, first run
117-
- **User Guide** — walk-through of the complete workflow
118-
- **Configuration Reference** — every `.env` setting explained
119-
- **Architecture** — module structure and design decisions
120-
- **API Reference** — auto-generated from source docstrings
126+
## Development
121127

122-
## Dependencies
128+
Install development dependencies:
123129

124-
| Package | Version | Purpose |
125-
|----------------|-------------|-----------------------------|
126-
| NumPy | >= 2.0 | Numerical computations |
127-
| Matplotlib | >= 3.10 | Plotting and visualization |
128-
| SciPy | >= 1.15 | ODE solving engine |
129-
| python-dotenv | >= 1.0 | Environment configuration |
130-
| PyYAML | >= 6.0 | Equation definitions |
130+
```bash
131+
pip install -e ".[dev]"
132+
```
131133

132-
## License
134+
Run tests:
133135

134-
MIT License. See [license.md](license.md).
136+
```bash
137+
pytest
138+
```
135139

136-
Third-party licenses: see [THIRD_PARTY_LICENSES.md](THIRD_PARTY_LICENSES.md).
140+
Contribution guide: [CONTRIBUTING.md](CONTRIBUTING.md).
137141

138-
## Author
142+
## License
143+
144+
MIT License. See [license.md](license.md).
139145

140-
**Alejandro Mata Ali**
146+
Third-party licenses: [THIRD_PARTY_LICENSES.md](THIRD_PARTY_LICENSES.md).

0 commit comments

Comments
 (0)