Extensible MDAO framework with automated dependencies and plug-and-play optimization.
Project description
SmartMDAO 🚀
SmartMDAO is a lightweight, purely Pythonic framework for Multidisciplinary Design Analysis and Optimization (MDO).
Define your physics and engineering models, and let SmartMDAO handle the complex dependency mapping, cyclic feedback loops, and caching. Once your Multidisciplinary Analysis (MDA) is built, seamlessly plug it into your favorite optimization library.
📦 Installation
SmartMDAO is available on PyPI. We recommend using uv for lightning-fast installation, but standard pip works perfectly.
Using uv:
uv add smartmdao
Using pip:
pip install smartmdao
(Note: Visualization features require the graphviz system binary to be installed on your OS).
Installing Graphviz (Optional System Requirement)
While smartmdao works perfectly on its own, generating pipeline diagrams requires the graphviz system binary to be installed on your OS.
macOS (Homebrew):
brew install graphviz
Linux (Ubuntu/Debian):
sudo apt-get install graphviz
Windows (winget):
winget install graphviz
(Alternatively, you can download the Windows installer directly from the official Graphviz website)
🌟 Why SmartMDAO? (The 3 Core Strengths)
-
Effortless MDA via Decorators & Auto-Caching No need to manually define complex graph edges or learn a heavy Domain-Specific Language. If
Step Bneeds variablexandStep Areturnsx, SmartMDAO connects them automatically using standard Python type hints. Wrap your functions in@pipe.stepand add our built-in@cacheddecorators (RAM, HDF5, Pickle) to effortlessly speed up evaluations. -
Plug-and-Play MDO (Bring Your Own Optimizer) We do the MDA, you do the MDO. Because our architecture relies on standard Python types and dictionaries, it is completely optimizer-agnostic. Use our
PipelineEvaluatorbridge to cache cyclic MDA evaluations, and pass your objective functions, constraints, etc directly to SciPy, OpenTURNS, PyOptSparse, or any other algorithm you prefer. -
Also Built for Researchers (Highly Extensible) SmartMDAO is designed to be a sandbox for innovation. Our solvers are built on standard Python
Protocolinterfaces. If you want to research and implement your own custom MDA convergence algorithms, you can easily write a new solver class and inject it into the pipeline without touching the core framework.
⚡ Quick Start: The Agnostic MDO Approach
Here is how easily you can solve the classic Sellar coupled problem (a 2-discipline feedback loop) and optimize it using standard scipy.
import math
from scipy.optimize import minimize
from smartmdao import Pipeline, HybridSolver, PipelineEvaluator
# 1. We handle the heavy lifting: Multidisciplinary Analysis (MDA)
# The HybridSolver automatically detects the cyclic dependency between y1 and y2!
pipe = Pipeline(solver=HybridSolver())
@pipe.step(outputs=["y1"])
def discipline_1(z1: float, z2: float, x1: float, y2: float) -> float:
return (z1 ** 2) + z2 + x1 - (0.2 * y2)
@pipe.step(outputs=["y2"])
def discipline_2(z1: float, z2: float, y1: float) -> float:
return math.sqrt(abs(y1)) + z1 + z2
@pipe.step(outputs=["objective"])
def compute_objective(x1: float, z2: float, y1: float, y2: float) -> float:
return (x1 ** 2) + z2 + (y1 ** 2) + math.exp(-y2)
# 2. You choose the optimizer: Agnostic Multidisciplinary Optimization (MDO)
# Map the optimizer's numeric array to our named design variables
evaluator = PipelineEvaluator(
pipeline=pipe,
design_vars=["z1", "z2", "x1"],
constants={"y2": 1.0} # Initial guess to kick off the cycle
)
# Pass the dynamically generated objective functions to ANY optimizer
result = minimize(
evaluator.get_objective("objective"),
x0=[1.0, 1.0, 1.0],
method='SLSQP',
bounds=[(-10.0, 10.0), (0.0, 10.0), (0.0, 10.0)]
)
print(f"Optimization Success! Objective: {result.fun:.4f}")
🤝 Contributing & License
Contributions are welcome! Please feel free to submit a Pull Request.This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file smartmdao-1.2.2.tar.gz.
File metadata
- Download URL: smartmdao-1.2.2.tar.gz
- Upload date:
- Size: 212.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"20.04","id":"focal","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54eabeebd42aa8fa011d053a5a4979532d6876300b33e30efef5819a4891ddd9
|
|
| MD5 |
a96e10f726c91778fca03862a95d9685
|
|
| BLAKE2b-256 |
2adeeb986b3199a998ab976588ec7623076b3bb1cba0721d2074aa1471873c34
|
File details
Details for the file smartmdao-1.2.2-py3-none-any.whl.
File metadata
- Download URL: smartmdao-1.2.2-py3-none-any.whl
- Upload date:
- Size: 18.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.26 {"installer":{"name":"uv","version":"0.9.26","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"20.04","id":"focal","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
952699d48e8f2e8f562e0023c6763d31e3faacae670cdb72764e7c2507805d81
|
|
| MD5 |
7b34a3cfa7bd5cc7cec0123ee20fe7b1
|
|
| BLAKE2b-256 |
493630c6c245007cea1e38886fa1a572efe2c9d03944ad6d652fafe014e4ebf2
|