Skip to content

Commit

Permalink
ui support
Browse files Browse the repository at this point in the history
  • Loading branch information
ali-izhar committed Feb 21, 2025
1 parent f3d0782 commit 21ae025
Show file tree
Hide file tree
Showing 5 changed files with 1,001 additions and 29 deletions.
42 changes: 16 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,14 @@ python find_roots.py --methods newton secant --function quadratic --x0 1.5

```
numerical_optimization/
├── algorithms/ # Implementation of numerical methods
├── algorithms/ # Implementation of numerical methods
├── configs/ # Configuration files for custom runs
├── plot/ # Visualization utilities
├── tests/ # Unit tests
├── ui/ # UI components (future)
├── ui/ # UI components (in-progress)
└── utils/ # Helper functions and utilities
```

## Features

- **Optimization Methods**
- Gradient Descent
- Newton's Method
- BFGS
- Nelder-Mead
- Powell's Method

- **Root Finding Methods**
- Newton's Method
- Secant Method
- Bisection Method
- Regula Falsi

- **Test Functions**
- Rosenbrock
- Himmelblau
- Quadratic
- Rastrigin
- And more...

## Usage Examples

### Optimization

```bash
Expand Down Expand Up @@ -109,6 +85,20 @@ Steepest Descent Method:
Converged: True
```

Optimization UI:

![Optimization UI](assets/optimization_ui.png)

To run the UI, use the following command:

```bash
python ui.py
```

> [!WARNING]
> The UI is currently in-progress and may not work as expected.

### Root Finding

```bash
Expand Down
19 changes: 19 additions & 0 deletions ui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env python3

"""GUI application for numerical optimization visualization."""

import sys
from PyQt6.QtWidgets import QApplication
from ui.main_window import MainWindow


def main():
"""Run the GUI application."""
app = QApplication(sys.argv)
window = MainWindow()
window.show()
sys.exit(app.exec())


if __name__ == "__main__":
main()
6 changes: 3 additions & 3 deletions ui/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ui/__init__.py

# TODO: Add UI for numerical methods visualization
# input: function, initial point, method, max iterations, tolerance
# output: plot of the function, the optimization path, and the convergence
from .main_window import MainWindow

__all__ = ["MainWindow"]
Loading

0 comments on commit 21ae025

Please sign in to comment.