无模型自适应控制(MFAC)工具包。
Project description
MFAC Toolkit
基于紧格式 / 偏格式 / 全格式动态线性化的无模型自适应控制 Python 工具包
A Python toolkit for Model-Free Adaptive Control (MFAC) based on CFDL / PFDL / FFDL dynamic linearization
面向 SISO 离散时间系统 / For SISO discrete-time systems
特性 / Features
- 支持 CFDL、PFDL、FFDL 三种动态线性化格式。
- 高性能 Rust 编译扩展,Python 侧为薄包装,兼顾性能与易用性。
- 控制器接口极简:
controller.update(y, yd)只根据当前输出y与期望输出yd返回下一时刻控制输入u。 - YAML 格式的控制器配置,Pydantic 参数校验。
- 示例中提供非线性离散被控对象与状态空间被控对象,以及可运行的仿真脚本。
DataLogger可选地记录每步元数据与控制数据。
安装 / Installation
方式一:从 PyPI 安装(推荐)
pip install mfac-toolkit
pip 会根据你的操作系统和架构自动选择对应的预编译 wheel。
方式二:从 GitHub Release 下载安装
如果 PyPI 安装较慢或失败,可以从 GitHub Releases 下载与自己平台对应的 .whl:
- Linux x86_64:
mfac_toolkit-*-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl - Windows x86_64:
mfac_toolkit-*-cp312-abi3-win_amd64.whl
然后执行:
pip install ./<下载的 whl 文件>
方式三:直接克隆使用
仓库里已经包含预编译的 Rust 扩展,直接克隆安装即可使用:
git clone https://github.com/Zhaojq2003/mfac_toolkit.git
cd mfac_toolkit
pip install -e .
快速开始 / Quick Start
查看包内示例:
mfac_toolkit.examples.basic_example:最小 CFDL 闭环仿真mfac_toolkit.examples.config:YAML 配置示例mfac_toolkit.examples.plants:示例用离散被控对象
安装后可直接运行:
python -m mfac_toolkit.examples.basic_example
本地源码开发时(已安装可编辑模式):
uv run python -m mfac_toolkit.examples.basic_example
常用命令 / Common Commands
| 任务 | 命令 |
|---|---|
| 同步依赖 | uv sync --extra dev |
| 运行示例 | uv run python -m mfac_toolkit.examples.basic_example |
| 代码检查 | uv run ruff check . |
| 类型检查 | uv run mypy . |
| 开发模式构建 | uv run maturin develop |
| 构建 release wheel | uv run maturin build --release |
项目结构 / Project Structure
.
├── mfac_toolkit/ # Python 包
│ ├── __init__.py
│ ├── config.py
│ ├── controller.py
│ ├── logger.py
│ ├── tuning.py
│ ├── _mfac_core.pyi
│ ├── py.typed
│ └── examples/
│ ├── basic_example.py
│ ├── config.yaml
│ └── plants.py
└── pyproject.toml
跨平台 Wheel 构建 / Cross-Platform Wheels
mfac_toolkit 使用 maturin 编译 Rust 扩展,并通过 cibuildwheel 在 GitHub Actions 中生成以下平台的 wheel:
- Linux:
x86_64(manylinux2014) - Windows:
AMD64
许可证 / License
本项目采用 MIT 许可证 开源。
MIT License
Copyright (c) 2026 北方工业大学 RobotX 实验室 (RobotX Lab, North China University of Technology)
Author: Jiqian Zhao zhaojq2003@163.com
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
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 mfac_toolkit-1.0.1-cp312-abi3-win_amd64.whl.
File metadata
- Download URL: mfac_toolkit-1.0.1-cp312-abi3-win_amd64.whl
- Upload date:
- Size: 278.2 kB
- Tags: CPython 3.12+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
144ca0027b6923cda6e4d24bf2aa5d10cc13a11a7f37dfe15798690439919055
|
|
| MD5 |
a35fb6935ac5bb19972f759aa17ecf60
|
|
| BLAKE2b-256 |
399ef92830c21182038ede0cd5e7b5bd0d28f592fe765f099a0881dd2447d477
|
File details
Details for the file mfac_toolkit-1.0.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: mfac_toolkit-1.0.1-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 418.4 kB
- Tags: CPython 3.12+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a363c891d8515dfcb84d64aabf7ff1311e75b81b6a4095cacfef84004d7ab14a
|
|
| MD5 |
ba179ed0f5e1ba2ef43773dfb60a6413
|
|
| BLAKE2b-256 |
a4b696771df9859fc0ff758b48210a4525e04ed37ffd1597178f8a3c09bdbd63
|