Skip to main content

MorphOpt — A Differentiable Optimization Framework for Soft Structure & Morphology Design

Developed by Zenan Song

A differentiable structural optimization framework that eliminates manual sensitivity derivation by fusing the adjoint method with automatic differentiation (AD). The sensitivity corresponds to the virtual work of residual force derivatives on the adjoint displacement field, computed via a single backpropagation through the residual graph. MorphOpt provides a unified interface for geometry, load, and material definition, calls torchfea for GPU-accelerated differentiable nonlinear FEA and adjoint-AD sensitivity, and employs a trust-region optimizer with L-BFGS for design updates. Validated on SIMP topology optimization with B-spline density fields and pneumatic soft robot shape optimization with deformation-dependent follower loads.

Features

  • Custom model definition covering geometry, material, and load parameters
  • Differentiable FEA via torchfea with automatic solving and sensitivity propagation
  • L-BFGS and trust-region methods for parameter updates within a subproblem framework
  • Fully extensible via inheritance — users customize every component in their definition scripts

Quick Start

pip install morphopt
  1. Install dependencies. Python ≥ 3.12, PyTorch (float64) recommended.
  2. Run a minimal example:
# Shape optimization (pneumatic bending actuator)
python examples/bendingactuator.py

# SIMP topology optimization (compliant gripper)
python examples/gripper.py
  1. Launch the GUI (recommended) — define, run and observe an optimization all inside one window:
morphopt-ui            # console command, available after `pip install morphopt`
# python -m morphopt.ui works too (handy when running from a source code directory)

The complete UI workflow (definition part + observer part) is described in docs/UI_usage.md.

Further references:

  • Task definition guide: docs/module_definition_guide.md
  • Module API reference: docs/module_reference.md
  • Theory & papers: docs/theory/

Directory Overview

  • src/morphopt/
    • optcore — Core package (controller, params, solver, objective, updaters)
    • shapeopt/ — B-spline shape optimization
    • simp/ — SIMP topology optimization
    • codesign/ — Shell co-design (shape + material)
    • ui/ — PySide6 graphical UI (definition + observer in one window)
  • examples/ — Example tasks (bending actuator, gripper, etc.)
  • docs/ — Usage guides, API reference, theory papers
  • tests/ — Gradient checks, geometry tests, UI tests
  • ui_runs/ — runs launched from the UI and their results (<label>_T<timestamp>/)

License

Research use preferred. For production or commercial use, please evaluate and ensure numerical and engineering robustness first.

Citation

If you use MorphOpt in your research, please cite:

  • TRO 2023 — Morphology Design
  • TRO 2026 — Jacobian-based Optimization
  • TMECH 2026 — Contact-aware Design

Metadata

Release files for morphopt 3.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for morphopt 3.1.6
File Size Uploaded
morphopt-3.1.6.tar.gz 145.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for morphopt 3.1.6
File Interpreter ABI Platform
morphopt-3.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 329.9 kB

Release files / morphopt-3.1.6.tar.gz

Download URL morphopt-3.1.6.tar.gz
Size 145.2 kB
Tags Source
SHA-256 checksum
How to use checksums
d45f69bde2c3e446ed62229f09ff78ca188da124cf4a848894f7ab5e4f83d437
BLAKE2b-256 checksum
How to use checksums
a04adae245ef6abab89cf0b9e013e82870f2562d21ae14492e9b948274cca5ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / morphopt-3.1.6-py3-none-any.whl

Download URL morphopt-3.1.6-py3-none-any.whl
Size 184.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
08ce24d4fc1a14b3de44de3fb87a5b1e65091af98ba8f8881578861bc4440799
BLAKE2b-256 checksum
How to use checksums
9c1a5f76ed9b38304fc5c7d0087fb62e26fb63d8cd29224e0e9e5e6ab27af953
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.10 {"installer":{"name":"uv","version":"0.12.10","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"CachyOS Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

4.0.0

2 release files

3.2.2

2 release files

3.2.1

2 release files

3.2.0

2 release files

This release

3.1.6 This release

2 release files

3.1.5

2 release files

3.1.4

2 release files

3.1.3

2 release files

3.1.2

2 release files

3.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page