用物理仿真 + AI Agent,把热力站做成 AI 原生平台。
Physics-grounded AI control for district heating substations.
Modelica 提供可信的物理世界,FMI/FMU 打通 Python 控制层,MPC / RL Agent 在仿真里学策略——像 BOPTEST 之于建筑,HeatStationGym 之于热力站。
Modelica gives a trustworthy physical world, FMI/FMU bridges Python control, MPC / RL Agents learn policies in simulation — BOPTEST for buildings, HeatStationGym for substations.
把物理世界变成 AI 能用的世界
Turn the physical world into something AI can use
像 Tesla 的视觉系统把摄像头画面变成点云、可行驶区域、3D 障碍物——同一时刻三种视角:左边是现实里的换热站,中间是 AI 看到的物理抽象(带方程的世界模型),右边是 AI 做出的预测与控制决策。这就是世界模型干的事。
Like Tesla's vision stack turns camera frames into point clouds, drivable surfaces, 3D obstacles — three lenses on the same instant: left = the physical station, middle = the AI's abstraction with equations, right = the AI's prediction and control. That's what a world model is.
热力站的三个真实痛点
Three real pains in substation operations
调控靠经验
Tuning lives in the head of a senior operator
每个站的策略依赖老师傅;节能空间大但难复用,新站从零开始。
Each station depends on tribal knowledge; savings exist but don't scale to new stations.
数字化止于看板
Dashboards, not decisions
SCADA 收了大量数据,但没人用得起来;AI 落不进控制环。
SCADA collects everything, but data rarely closes the control loop.
建模门槛高
Physical modeling is expensive
Modelica/CFD 是专业工具,每个站建一遍要几周到几个月。
Modelica/CFD is expert tooling; modeling a station can take weeks to months.
五层架构
Five-layer architecture
v0 模型:一个最简换热站
v0 model: a minimal heat substation
一次侧热水经控制阀进入板式换热器,把热量传给二次侧;二次侧循环泵把热水送到末端用户。控制变量是一次侧阀门开度 u_valve,扰动是室外温度 T_oa 与用户负荷 Q_load。
Primary hot water enters a plate HX through a control valve and transfers heat to the secondary loop; a circulation pump delivers heat to building loads. Control = primary valve opening u_valve; disturbances = outdoor temp T_oa and load Q_load.
在 web/public/station-photo.jpg 放入真实换热站照片
Drop a real station photo at web/public/station-photo.jpg
(建议 4:3,至少 1200px 宽)
(4:3, at least 1200px wide)
现实里有阀门、泵、管网、换热器、保温层;模型里只保留控制和能量平衡决定的部分。AI 不需要看见钢铁,但需要一个可信的能量账本。
Reality has valves, pumps, piping, exchangers, insulation. The model keeps only what control and energy balance need. AI doesn't need to see the steel — it needs a trustworthy energy ledger.
查看 Modelica 源码核心方程View core Modelica equations
m_dot_pri = u_valve * m_dot_pri_max; C_min = min(m_dot_pri * cp, m_dot_sec * cp); Q_hx = eps_hx * C_min * (T_pri_in - T_sec_ret); T_sec_ret = T_sec_sup - Q_load / (m_dot_sec * cp); C_sec * der(T_sec_sup) = Q_hx - Q_load;
v1 路线:用 AixLib 组件级重建
v1 roadmap: rebuild with AixLib at component level
v0 是集总参数模型,够 demo 但不够工程。v1 把每个组件——阀门、泵、传感器、换热器——换成 AixLib 的工业级实现,保留同样的 FMI 接口,控制器代码零改动。
v0 is a lumped model — enough for demo, not engineering. v1 swaps every component (valve, pump, sensors, HX) for AixLib's industrial implementations, keeping the same FMI surface; controller code is unchanged.
v0 Demo:MPC vs PI,24 小时
v0 Demo: MPC vs PI, 24 hours
把上面的模型导出为 FMU,从 Python 控制;MPC 与带 feedforward 的工业 PI 对比。
Export the model above as an FMU and control it from Python; MPC vs industrial PI with feedforward.

| KPIKPI | PI | MPC |
|---|---|---|
| 跟踪 RMSTracking RMS | 10.30 °C | 0.008 °C |
| 满足率 (±1°C)Setpoint hit rate (±1°C) | 71.3 % | 100 % |
| 未满足负荷Unmet load | +0.034 MWh | −0.003 MWh |
| 阀门总变化Valve total variation | 8.8 | 1.1 |
PI 在头 7 小时出现冷启动极限环(典型 PI 现场调参痛点),MPC 开机即稳。这不是把 PI 调烂——是 MPC 真实的工程价值:不需要逐站手调。
PI shows a cold-start limit cycle in the first 7 hours (a real on-site tuning pain). MPC stays steady from start — that's MPC's actual value: no per-station tuning required.
v1.5:从单站走向源-网-站
v1.5: from single station to source-network-station
真正的供热价值在网级:冷水波传播、N-1 工况、安全约束触发的策略协同。下面是一个源 + 一次网 + 两站的耦合模型——上面所有的反事实、故障、Agent 工具,都可以无缝挂上来。
The real value in district heating lives at the network level: cold-water plug propagation, N-1 contingencies, safety-driven coordinated control. Below: a coupled source + primary network + 2-station model. All the what-if / fault / agent tooling above generalizes to this.
源温变化要走过 τ_A / τ_B 才能到达对应站
Source temp changes propagate to A/B with delays τ_A / τ_B
任一站开度变化通过一次网影响另一站可用流量与压力
Any station's valve change shifts flow / pressure available to the other
p_A / p_B 低于 0.3 MPa 触发协同回退(A 优先保供,B 退让)
If p_A or p_B drops below 0.3 MPa, coordinated back-off (A prioritized, B yields)
网络级 sandbox(源 + 两站 + 一次网)
Network sandbox (source + two stations + primary network)
把模型当 sandbox:反事实、故障、预报
Use the model as a sandbox: what-if, fault, forecast
物理仿真和世界模型的区别在这里:它不只是跑出结果,还能回答 '如果……会怎样' '哪个设备坏了' '未来 24 小时怎么走'。下面是三个互动模式,全部在浏览器里实时算。
This is where physical simulation becomes a world model: it answers 'what-if', 'which fault matches these symptoms', 'how will the next 24h play out'. All three modes run live in your browser.
让 AI Agent 用这个模型
Let an AI agent use the model
同样的物理模型,挂上 Claude Sonnet 4.6,给它 3 个工具(反事实仿真、故障注入、未来预报)。问一个自然语言问题,Agent 自己决定调哪个工具、怎么解读结果。这就是 '世界模型' 真正的差异。
Same physics model, behind Claude Sonnet 4.6 with 3 tools (counterfactual sim, fault injection, forecast). Ask in natural language; the agent picks tools and interprets results. This is what makes it a world model, not just a simulator.
问问这个世界模型
Ask the world model
gpt-5.1 · 5 toolsv2 · Modeling Agent:从点表自动生成模型
v2 · Modeling Agent: SCADA point list → Modelica model
一个站房从图纸/点表到可仿真的 Modelica 模型,传统做法需要 1-2 周工程师手工建模。这里换一个思路:LLM 不直接写 Modelica(容易幻觉),而是把点表抽取成一个有类型约束的拓扑(YAML),由确定性 JS 做 DOF / 量纲 / 接线预检查,再由模板生成 .mo 文件。下面试试看——粘贴一个点表,几秒钟出模型。
Traditionally, going from a point list / P&ID to a runnable Modelica model takes engineers 1–2 weeks. New approach: the LLM never writes Modelica directly (hallucinates), it fills a typed topology (YAML). Deterministic JS runs DOF / unit / connectivity checks, then a template renders the .mo file. Paste a point list below — model in seconds.
为什么这个 v0 已经是真护城河(不是 demo 装饰)
Why this v0 is already a real moat (not just a demo)
① LLM 输出受 Zod schema 约束 → tag 必须出现在原始点表里,不能幻觉新名字;② JS 做的预检查(DOF / 量纲 / 连接)覆盖了 LLM 最容易出错的物理一致性环节;③ 同一 schema 接入 AixLib 或更精细模板就能产生组件级模型;④ 校准是下一步——接 SCADA 历史数据做参数辨识,把 eps_hx、C_sec 这些默认值变成站特异值。① LLM output is Zod-constrained → every tag must exist verbatim in the original list, no invented names; ② JS pre-checks (DOF / units / connectivity) cover the physics-consistency failure modes LLMs are worst at; ③ Same schema can drive AixLib component-level templates; ④ Calibration is next — fit eps_hx and C_sec from SCADA history to make defaults station-specific.路线图
Roadmap
- v0HeatStationGym 雏形 · FMU + MPC + 对比 KPIHeatStationGym v0 · FMU + MPC + comparison KPIs已完成done
- v1接入真实 SCADA · 参数辨识 · 残差对比Real SCADA · parameter identification · residual analysis
- v2Modeling Agent · 点表→YAML→Modelica 自动生成Modeling Agent · point-list → YAML → Modelica auto-gen
- v3RL baseline · 多回路 · 一次网拓扑RL baseline · multi-loop · primary network topology
- v4多站示范部署 · 商业闭环Multi-station pilot deployment · commercial close
联系我们
Contact
微信