Math Modeling Competition Workflow
XiaoMaColtAI/math-modeling-skill
Three-role workflow for math modeling contests: problem analysis, code and results, then a paper, with independent subagent checks at each stage gate.
Stage protocol for a math-modeling pipeline that turns a problem analysis into a unified mathematical mechanism, formulas, a solution route and a validation plan.
SKILL.md written in Chinese; this summary is our English description.
$ npx skills add WuXinbo-bo/Math-model-skills --skill model-formulation -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install WuXinbo-bo/Math-model-skills model-formulation --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/WuXinbo-bo/Math-model-skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/references/stage_protocols/model-formulation .claude/skills/model-formulation && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "model-formulation" agent skill from https://github.com/WuXinbo-bo/Math-model-skills/tree/main/references/stage_protocols/model-formulation into .claude/skills/model-formulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "model-formulation", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/WuXinbo-bo/Math-model-skills/tree/main/references/stage_protocols/model-formulationType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add WuXinbo-bo/Math-model-skills --skill model-formulation -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install WuXinbo-bo/Math-model-skills model-formulation --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/WuXinbo-bo/Math-model-skills.git skills-src && mkdir -p .agents/skills && cp -r skills-src/references/stage_protocols/model-formulation .agents/skills/model-formulation && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "model-formulation" agent skill from https://github.com/WuXinbo-bo/Math-model-skills/tree/main/references/stage_protocols/model-formulation into .agents/skills/model-formulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "model-formulation", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add WuXinbo-bo/Math-model-skills --skill model-formulation -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install WuXinbo-bo/Math-model-skills model-formulation --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/WuXinbo-bo/Math-model-skills.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/references/stage_protocols/model-formulation .cursor/skills/model-formulation && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "model-formulation" agent skill from https://github.com/WuXinbo-bo/Math-model-skills/tree/main/references/stage_protocols/model-formulation into .cursor/skills/model-formulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "model-formulation", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/WuXinbo-bo/Math-model-skills.git --path references/stage_protocols/model-formulation--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add WuXinbo-bo/Math-model-skills --skill model-formulation -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install WuXinbo-bo/Math-model-skills model-formulation --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/WuXinbo-bo/Math-model-skills.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/references/stage_protocols/model-formulation .gemini/skills/model-formulation && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "model-formulation" agent skill from https://github.com/WuXinbo-bo/Math-model-skills/tree/main/references/stage_protocols/model-formulation into .gemini/skills/model-formulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "model-formulation", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install WuXinbo-bo/Math-model-skills model-formulationInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add WuXinbo-bo/Math-model-skills --skill model-formulation -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/WuXinbo-bo/Math-model-skills.git skills-src && mkdir -p .github/skills && cp -r skills-src/references/stage_protocols/model-formulation .github/skills/model-formulation && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "model-formulation" agent skill from https://github.com/WuXinbo-bo/Math-model-skills/tree/main/references/stage_protocols/model-formulation into .github/skills/model-formulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "model-formulation", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add WuXinbo-bo/Math-model-skills --skill model-formulation -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install WuXinbo-bo/Math-model-skills model-formulation --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/WuXinbo-bo/Math-model-skills.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/references/stage_protocols/model-formulation .opencode/skills/model-formulation && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "model-formulation" agent skill from https://github.com/WuXinbo-bo/Math-model-skills/tree/main/references/stage_protocols/model-formulation into .opencode/skills/model-formulation/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "model-formulation", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
model-formulationStage protocol for a math-modeling pipeline that turns a problem analysis into a unified mathematical mechanism, formulas, a solution route and a validation plan.
This is one stage in a pipeline for mathematical modeling contests, written in Chinese. It takes the earlier problem-analysis file and the user's data, and must produce a modeling report of at least about 1.5 KB. Before modeling, the agent builds one shared mechanism kernel across all sub-questions, then decides per question whether to create, extend, compare, validate or apply a model, rather than presenting a list of per-question algorithms as the paper's backbone.
The report must register model definition, structure, semantics and paper wording, and extended models must record the increment over the inherited one, such as new variables, constraints and objectives. A multi-objective label needs at least two real, conflicting objectives. When data exists, a preprocessing contract spells out raw files, missing value and outlier handling, units, quality metrics before and after, a single processed output folder and leakage boundaries, with prediction tasks split before fitting.
The agent must also review the upstream analysis's recommended methods and its upgrade conclusions for classic problems, adopt them where feasible and justify any rejection in writing. Closing rules say to check inputs, finish the artifact, run the stage gate and then record status, and a model that cannot close is sent back to fill in variables, constraints or data instead of being dressed up in prose.
2 steps, taken from the first numbered list in SKILL.md.
Read from SKILL.md and the folder at commit ee8a616. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown and bash).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Math Model Formulation Stage loads about 2.9k tokens when it runs, and up to ~16k if it reads all its reference files. Until then it costs about 20 tokens; SKILL.md has 428 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from WuXinbo-bo/Math-model-skills at commit ee8a616, republished under its MIT licence (© WuXinbo-bo). 428 words, ~2,933 tokens.
.claude/skills/model-formulation/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.开始建模前必须读取 参考资料/model-quality-contracts.md。先建立跨问题复用的机制内核,再决定每问是新建、扩展、比较、验证还是应用;不得把逐问算法列表当作论文主线。
new_model/model_extension 在 建模报告.md 中同时登记 模型定义、模型结构、模型语义 和 论文表达。多目标名称必须由两个以上实际优化目标及其冲突、聚合或 Pareto 证据支持;多资源、高维变量和多个输出指标均不能替代该证据。model_extension 还必须登记 模型增量,说明继承方程、新增变量、新增/修改约束、目标、求解与验证变化。
物理、几何、覆盖和连续时间问题优先检查“统一状态/坐标 -> 对象演化 -> 相互作用或事件判据 -> 边界精化 -> 指标/外层优化”是否闭合。多资源问题检查区间并集、重叠和边际贡献;混合决策问题区分离散结构层与连续控制层。
有数据时,在 建模报告.md 单列“预处理合同”,定义原始文件、缺失值/异常值/编码/单位或标准化策略、处理前后质量指标、唯一 数据/processed/ 输出,以及数据泄漏边界。预测或学习任务必须先划分再拟合,变换参数只从训练数据估计;不适用时必须说明理由。具体处理方法根据题目数据和模型需求确定,禁止把通用脚本当作固定答案。无数据时保留明确跳过记录。
基于问题情境解构开展数学建模与求解:$ARGUMENTS
COMPETITION / PROBLEM_ID — 从 Additional Parameters 查阅
TOOLS — 默认 python
CUSTOM_REQUIREMENTS — 用户自定义要求
问题分析.md — 问题情境解构报告(务必出现)
用户数据/ — 赛题附件数据
当前环节务必产出 建模报告.md(≥ 1.5KB,完整的建模与求解报告)。
⛔ 结束前必跑产出校验:
[ -f 建模报告.md ] && SZ=$(wc -c < 建模报告.md) || SZ=0
[ "$SZ" -ge 1500 ] && echo "✅ 建模报告.md ($SZ bytes)" \
|| echo "❌ 建模报告.md 缺失或过小 ($SZ bytes) — 必须补全后重新跑验证, 不要结束本步骤"
提取子问题列表、推荐方法、变量定义、数据特征。
⛔ 对照 问题分析.md 的推荐方法: 若选取了不同于推荐的方法,务必在 建模报告.md 中清晰标明阐明理由(为什么推荐方法不适用、替代方法的优势)。不可无声地忽略推荐方法。
⛔⛔⛔ 强制审视问题情境解构的"经典问题升级"结论(防止升级被忽略):
关键要求:先完整审视问题情境解构的升级推荐 → 尽可能在建模中满足 → 如有异议务必给出充分理由。
问题情境解构阶段(Phase 5.6)会交付以下表格,建模阶段务必逐条审视:
覆盖度核验表(标注 ⚠️/❌ 的句子是需额外建模的机制)
反向对照核验(题目某句子指出需升级到某变体)
经典问题升级确认表(清晰标明标注"初步映射 X → 终版模型 Y")
⛔ 实施环节:
echo "=== 审视问题情境解构的升级结论 ==="
echo ""
echo "--- 标为⚠️/❌的覆盖度缺口(需要在建模中审视是否补上)---"
grep -A 1 '⚠️\|❌' 问题分析.md | head -40
echo ""
echo "--- 经典问题升级表(需要审视是否采用最终模型)---"
sed -n '/经典问题升级/,/^##/p' 问题分析.md | head -30
echo ""
echo "--- 反向对照的升级要求 ---"
sed -n '/反向对照/,/^##/p' 问题分析.md | head -30
⛔ 三段式决策过程(各个升级推荐都务必走完):
第一段:审视
逐条查阅问题情境解构的升级推荐(如 "Orienteering → Multi-Trip OP")
理解升级的触发缘由(如 ASSURANCE"可充电"→多架次飞行)
判定升级对终版结果的影响(如不用 Multi-Trip 会导致覆盖数被严重低估)
第二段:尽可能满足(默认行为)
若升级在技术上可实现 → 务必采用问题情境解构推荐的变体
若升级增加复杂度但不超出求解能力 → 务必采用
若升级是题目清晰标明要求的机制(如"可充电")→ 无论如何务必采用
第三段:有异议给理由(特殊情况)
若建模阶段认为某个升级不应采用,务必在 建模报告.md 中给出充分理由:
物理/业务不可行:如"题目说可充电但物理上无法实现(如太阳能电池)"
数据不支撑:如"题目没给充电时间参数" → ⛔ 这不是跳过升级的合法理由!务必做合理假设(如假设充电瞬时/固定X分钟/等于飞行时间的X%),随后继续建模升级版
超出求解能力:如"完整 Multi-Trip Stochastic OP 是 PSPACE-hard,简化为序贯单趟 OP,误差预计 < 15%"
评审标准考虑:如"简化后仍能回答题目的关键问题,且提升求解效率"
⛔⛔⛔ 尤其警告:以下理由不是跳过升级的合法理由(等同于无声忽略):
❌ "题目未给 XXX 参数" → 应做合理假设继续建模,不是跳过
❌ "子问题1可简化,留给子问题2/3扩展" → 子问题1也要考虑完整机制
❌ "通过其他方式实现类似效果"(如"多机接力代替充电")→ 这不等同于题目给定的机制
❌ "避免增加模型复杂度" → 复杂度本身不是跳过的理由
❌ "短续航无人机覆盖有限,就让它覆盖少" → 这恰恰是升级要解决的问题
⛔ 缺参数的无误处理过程:
识别缺失的参数(如充电时间)
做合理假设,假设值基于常识/文献/类似赛题
在假设列表中清晰标明声明"假设 XXX = Y,依据是 Z"
灵敏度分析中扰动该假设参数
用假设值完整建模升级版,而不是跳过全部机制
⛔ 禁止行为:
❌ 无声忽略升级推荐(连"审视"都没做,直接用简单模型)
❌ 不读问题情境解构的 7.2/7.3 节就启动建模
❌ 有异议但不写理由 → 等同于无声忽略
❌ 用"单次XXX作为基线,后续扩展"作为借口跳过升级
❌ 用"题目未给参数"作为借口跳过升级
⛔ 若采用了升级的简化版本(如"简化的 Multi-Trip OP"),务必在模型中不少于保留升级的关键机制:
Multi-Trip → 务必建模"多次访问同一 base 点"
带时间窗 → 务必建模"访问时刻 ∈ [a, b]"
随机/鲁棒 → 务必建模不少于 2 个场景并对比
多阶段 → 务必建模不少于 2 个阶段的转移
不可"简化"为名把升级完全去掉。
⛔ 防错复核(必做): 查阅 参考资料/error_prevention.md,依据本题涉及的题型(优化/微分方程/统计/评价/图论/几何/动态规划),对照相应章节的"务必做"和"禁止做"条目。在 建模报告.md 末尾写一行:本题涉及题型:[X, Y, Z],已对照防错手册审查。
各个假设务必有合理性阐明。假设要合理且必要,不做不切真实的简化。
⛔ 假设参数化原则: 关键假设务必在代码层面做成可切换的参数,而不是硬编码到逻辑里。这样发现假设错误时,改一个参数就能修正,不需重写全部求解逻辑。
在 建模报告.md 中,各个假设旁边务必写明:
假设 1: [假设内容]
- 理由: [为什么这样假设,不能留空]
- 参数化: [对应代码中的哪个变量/开关]
- 替代假设: [如果这个假设不成立,替代方案是什么]
示例:
假设 3: 每类设备允许多台并行分担同一工序的工程量
- 理由: 题目说"各类设备须分别完成该工序对应的工程量","各类"指设备类型而非单台设备;且问题四增加预算购买设备才有意义
- 参数化: ALLOW_PARALLEL = True(代码中的开关变量)
- 替代假设: 每类设备只用 1 台(ALLOW_PARALLEL = False),但这会导致问题四退化为问题三
⛔ 若某个假设写不出有力的理由,阐明这个假设需再推敲。 回到 问题分析.md 的假设预检结果重新审视。
各个子问题:
方法调研 — 用 WebSearch 搜索"[问题类别] 数学建模 方法"或"[problem type] optimization method",了解这类问题的主流求解方法。避免只凭训练知识选方法——同一类问题在不同规模下最优方法可能完全不同(如 TSP 小规模用精确求解,大规模用 LKH 启发式)
模型选取与理由 — 为什么选这个模型,与候选模型的优势对比,引用调研到的文献支撑
数学公式推导 — 完整严谨,采用 LaTeX 数学环境(目标函数+约束条件)
求解算法设计 — 伪代码或过程描述
⛔ 审计身份与论文表达卡(写入同一份 建模报告.md):
模型定义 Q1 | 正式名称: [题目机制 + 标准数学模型] | 标准模型族: [可识别的学术模型族] | 求解算法: [实际使用的算法]
模型结构 Q1 | 决策变量/状态量: [变量及含义] | 目标函数/统计关系: [优化目标或统计/动力学关系] | 核心约束/方程: [决定模型结构的约束或方程] | 定制机制: [题目特有机制]
模型语义 Q1 | 目标数量: [0/1/2...] | 目标方向: [none/min/max/min,max...] | 变量类型: [continuous/integer/binary/mixed/state] | 关系类型: [linear/nonlinear/differential/stochastic/geometric/simulation/hybrid] | 多目标证据: [not_applicable/冲突目标及聚合或Pareto证据]
论文表达 Q1 | 展示名称: [简洁可发表名称] | 问题角色: new_model | 继承模型: none | 核心方法: [摘要中需要保留的一个核心算法或方法]若问题角色为 model_extension,紧接着增加:
模型增量 QN | 继承方程: [...] | 新增变量: [...] | 新增/修改约束: [...] | 目标变化: [...] | 求解变化: [...] | 验证变化: [...]正式名称必须让评委直接识别标准数学结构。推荐“考虑维护约束的机组承诺混合整数线性规划模型”“基于季节项与滞后项的动态回归模型”“带时间窗的取送货车辆路径模型”;禁止只写“聚合承诺模型”“超边修复模型”“优化模型”“决策模型”或“综合模型”。
论文展示名称不是审计名称的机械缩写。它应保留主要数学结构,删除运行模式、验证器、预算、冻结合同和过细约束清单,中文通常控制在 8--24 个汉字。核心方法 只登记摘要需要出现的主要求解算法;初始化、修复、加速和独立校验方法留在算法与验证章节。
先判定子问题角色:
new_model:新建数学模型,三行卡均必填;model_extension:扩展上游模型,三行卡均必填并写明继承模型;comparison、validation、application:不得为满足格式强造新模型,只写论文表达卡,展示名称改为“基于前述模型的方案比较/稳健性检验/情景应用”,并登记 继承模型: Q1,Q2 等真实依赖。模型、机制和算法必须分层:混合整数线性规划、动态回归、车辆路径、状态空间等是模型族;维护约束、预算平衡、滚动时域、超边修复是定制机制;HiGHS、Gurobi、分支定界、遗传算法、粒子群、匈牙利算法等是求解算法。DARP、VRP 等问题类别不得单独替代数学表达结构;多指标决策方法可登记为标准模型族时,必须同时写出指标、权重、归一化和聚合/排序关系,不能只报方法名称。
MCM/ICM 另写:PAPER EXPRESSION Q1 | DISPLAY NAME: ... | QUESTION ROLE: new_model | INHERITS FROM: none | CORE METHOD: ...。审计身份仍使用 MODEL DEFINITION 与 MODEL STRUCTURE 两行。
方法选取参考 参考资料/methods_table.md。
保证全部公式中的符号都有定义:
| 符号 | 含义 | 单位 | 取值界限 | 首次出现 |
|------|------|------|----------|----------|
模型检验:回代检验、交叉校验、残差分析
灵敏度分析:关键参数的变化界限和影响
鲁棒性检验:数据扰动下的稳定性
关键原则:物理约束 > 数据忠实度 > 计算正确性
编码阶段是纯实施者,遇到"结果不对"仅可按建模阶段的预案操作,严禁自行发明修正方法。由此建模阶段务必把全部决策做完。
实施环节:
对照防错手册复核模型:重新查阅 参考资料/error_prevention.md 中本题相应题型的"务必做"和"禁止做"条目,逐条确认模型是否满足。不满足的当场调整模型。
交付建模报告的 5 项必备内容(在 建模报告.md 末尾,computational-realization 务必对照实施):
① 结果约束清单(硬边界,超出即判定代码有误):
## 结果约束清单
- [变量名] ∈ [下界, 上界],物理含义:[为什么是这个范围]
- [变量名] 的符号/方向约束:[说明]
- [守恒量]:[应满足的恒等式或误差上限]
② 预期行为描述(定性描述合理结果的"形状"):
## 预期行为
- 时间尺度:系统应在 [X] 时间内达到 [什么状态]
- 稳态特征:[哪些量] 应趋于常数/周期/衰减
- 瞬态特征:[初始阶段应该看到什么现象]
- 单调性/对称性:[哪些量应该单调递增/对称/...]
③ 异常处理预案(每种异常只给一种修正方法,不留选取空间):
## 异常处理预案
若出现 [具体异常描述]:
→ 原因判断:[最可能的原因]
→ 唯一修正方法:[具体步骤]
→ 禁止:[不允许的替代方案]
④ 方法唯一性声明(各个计算环节指定唯一方法,涵盖预处理/后处理/插值/滤波):
## 方法指定
步骤 N:[做什么]
方法:[唯一指定的方法名 + 关键参数]
输入:[从哪来]
输出:[到哪去]
禁止替代:[不允许用的方法,以及为什么不用]
⑤ 验证检查点(编码阶段务必实施的 pass/fail checklist):
## 验证检查点
□ [检查项]:[判定条件],若 fail → [跳转到哪个异常预案]
□ [检查项]:[判定条件],若 fail → [跳转到哪个异常预案]
□ 最终:所有输出量均在约束清单范围内
⑥ 优化结果结构性校验输入(优化类子问题务必给出,编码阶段的 structural_validation() 依赖这些信息):
## 结构性验证输入(供 computational-realization 层级 5 使用)
### 约束活跃性预期
- [约束名1]:预期活跃/不活跃,理由:[为什么这个约束应该/不应该取等号]
- [约束名2]:预期活跃/不活跃,理由:[...]
- 如果所有约束都不活跃 → 说明 [什么情况],需要 [什么操作]
### 决策变量合理范围与预期行为
| 变量 | 物理含义 | bounds | 预期取值区间 | 若取到边界说明什么 |
|------|---------|--------|-------------|------------------|
| x_1 | [含义] | [lb, ub] | [预期在哪个子区间] | [取到上界=资源耗尽/取到下界=该资源无用] |
### 灵敏度方向表
| 决策变量 | 增大时目标函数方向 | 预期灵敏度量级 | 若方向相反说明什么 |
|----------|-------------------|---------------|------------------|
| x_1 | ↓(减小=更优) | 高(主导项) | 目标函数符号写反了 |
### 稳定性预期
- 问题是凸的/非凸的?
- 预期有几个局部最优?(1个=结果应完全稳定;多个=允许 CV<5%)
- 可接受的变异系数阈值:[X]%
### 资源利用率预期
- [资源1]:预期利用率 [X%-Y%],若为 0 说明 [什么问题]
- [资源2]:预期利用率 [X%-Y%],若为 0 说明 [什么问题]
⛔⛔⛔ 建模阶段强制修复原则(不可跳过):
复核中发现任何问题,务必当场修复模型再继续,不可留给 computational-realization 阶段:
模型缺少约束 → 立即补充约束条件
开环积分可能漂移 → 立即加入反馈/阻尼/去漂移机制
守恒律不满足 → 立即补充遗漏项
极端输入导致发散 → 立即加入饱和/截断/正则化
⛔ 禁止的做法:
❌ 发现问题但写"留给 computational-realization 阶段处理"
❌ 在预期界限表里写了修正方案但不调整模型本身
❌ 只在文字中提到"需注意XXX"但模型公式没变
⛔ 检测到问题 = 务必修复。解释缘由 ≠ 处理完毕。当前环节不准许带着已知问题交付 建模报告.md。
留存到 建模报告.md:模型假设、符号阐明、各个子问题的模型/公式/算法、检验方案、灵敏度分析方案、计算实验实现要点。
⛔ 务必将 问题分析.md 中的图形与表格预规划带入 建模报告.md。 在报告末尾附上图形与表格预规划章节(从 问题分析.md 复制或更新),保证 evidence-visualization 能读到完整的图形与表格清单。若建模过程中发现需额外的图形与表格(如灵敏度分析曲线、模型对比热力图),在此处补充。
⛔ MANDATORY: 交付前自检(写完 建模报告.md 后务必按项核验):
echo "=== 建模报告自检 ==="
[ -f 建模报告.md ] || { echo "❌ 建模报告.md 不存在!"; exit 1; }
# 1. 子问题覆盖度
PROB_COUNT=$(grep -c '问题[一二三四五六七八九十0-9]' 问题分析.md 2>/dev/null || echo 0)
MODEL_SECTIONS=$(grep -c '## .*问题[一二三四五六七八九十0-9]\|## .*Problem' 建模报告.md 2>/dev/null || echo 0)
echo "赛题子问题数: $PROB_COUNT, 建模报告覆盖: $MODEL_SECTIONS"
[ "$MODEL_SECTIONS" -lt "$PROB_COUNT" ] && echo "❌ 有子问题未建模!"
# 2. 每个子问题是否有目标函数或模型公式
OBJ_COUNT=$(grep -c '目标函数\|min\|max\|最小化\|最大化\|objective\|模型公式\|数学模型' 建模报告.md 2>/dev/null || echo 0)
echo "目标函数/模型公式出现次数: $OBJ_COUNT"
[ "$OBJ_COUNT" -eq 0 ] && echo "❌ 未找到任何目标函数或模型公式!"
# 3. 约束条件(优化类必须有)
CONSTRAINT_COUNT=$(grep -c '约束\|s\.t\.\|subject to\|限制条件\|≤\|≥' 建模报告.md 2>/dev/null || echo 0)
echo "约束条件出现次数: $CONSTRAINT_COUNT"
# 4. 符号说明表是否存在
grep -q '符号.*说明\|符号.*含义\|Symbol.*Description' 建模报告.md && echo "✅ 符号说明表存在" || echo "❌ 缺少符号说明表"
# 5. 灵敏度分析方案是否存在
grep -qi '灵敏度\|sensitivity\|鲁棒性\|robustness\|稳健性' 建模报告.md && echo "✅ 灵敏度/鲁棒性分析方案存在" || echo "⚠ 缺少灵敏度分析方案(评审加分项)"
# 6. 图表预规划是否带入
grep -qi '图表预规划\|fig_\|TABLE_\|DrawIO' 建模报告.md && echo "✅ 图表预规划已带入" || echo "❌ 缺少图表预规划(evidence-visualization 步骤需要)"
# 7. 计算实验实现要点是否存在
grep -qi '编程\|实现要点\|Python\|算法步骤\|伪代码' 建模报告.md && echo "✅ 计算实验实现要点存在" || echo "⚠ 缺少计算实验实现要点(computational-realization 步骤需要)"
# 8. 问题递进性检查(最关键)
echo ""
echo "=== 问题递进性检查 ==="
echo "⛔ 人工审查:在你的模型下,每个问题的结果是否比前一个有明显变化?"
echo " 如果某个后续问题的结果和前一个几乎相同,说明模型假设可能有问题。"
echo " 特别检查:新增的变量/资源/约束是否对目标函数有边际效益?"
echo " 如果没有 → 回到 问题分析.md 的假设预检重新审视。"
# 9. 假设参数化检查
PARAM_COUNT=$(grep -c '参数化:\|ALLOW_\|ENABLE_\|USE_\|开关变量' 建模报告.md 2>/dev/null || echo 0)
echo "假设参数化标记数: $PARAM_COUNT"
[ "$PARAM_COUNT" -eq 0 ] && echo "⚠ 未找到假设参数化标记——关键假设应该在代码中做成可切换参数"
若有 ❌ 项,务必补充后再结束当前环节。⚠ 项推荐补充但不强制。
公式务必严谨:各个变量定义,各个等式有推导依据
⛔ Markdown 中的 LaTeX 公式格式标准(保证前端能无误渲染):
块级公式:$$ 务必独立占一行,前后各空一行
行内公式:用 $...$,内部避免用 _ 做下标时与 markdown 斜体冲突,复杂公式用块级
\begin{aligned} 等多行环境必须放在 $$...$$ 块级公式中,不要放在行内 $...$ 中
避免在公式中使用 \text{} 包裹中文(KaTeX 对中文支持有限),中文说明放在公式外面
模型假设是评审重点:合理、必要、有说服力
符号阐明表务必完整
灵敏度分析不可省(评审加分项)
计算实验实现要点要具体:算法、库、输入交付格式
⛔ 主交付文件:建模报告.md。避免在根目录写额外报告
⛔ 当前环节只交付 建模报告.md,避免写 Python/MATLAB 代码文件。 代码实现是下一步 computational-realization 的工作项。当前环节只需在报告中描述算法伪代码、求解思路、计算实验实现要点即可。若需校验某个公式或做简单计算,可用 Bash 内联 Python 一次性脚本,但避免建立 程序/*.py 文件
⛔ 分段写入:每一次 Bash heredoc < 150 行。 建模报告.md 一般情况下很长,务必分 3-4 段追加写入(cat << 'EOF' >> 建模报告.md),避免一次性写完整个文件
详细条目见 参考资料/error_prevention.md,以下为最高优先级的两条硬性禁止:
禁止未声明的几何/物理简化 — 务必用实体完整几何作为约束判据,禁止降维简化(矩形→线段、实体→质心点)。若确需简化务必明示声明适用条件和误差上界。
禁止约束遗漏 — 题目中各个"不超过/不少于/务必满足"都务必相应一个数学约束表达式。物理接触约束(不可穿透/重叠/超出边界)务必明示建模为不等式约束。
© WuXinbo-bo, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files (references) in references/stage_protocols/model-formulation of WuXinbo-bo/Math-model-skills.
Open the folder on GitHubat commit ee8a616
Math Model Formulation Stage next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Math Model Formulation Stage this skillWuXinbo-bo/Math-model-skills | 111 | — | ~2.9k | Automated safety check: Pass | MIT | |
| Math Modeling Competition WorkflowXiaoMaColtAI/math-modeling-skill | 1.9k | — | ~1.2k | Automated safety check: Pass | None | |
| AutoMCM-Pro Math Modeling AgentRealSeaberry/AutoMCM-Pro | 257 | — | ~8.5k | Automated safety check: Pass | MIT | |
| Formal Modeling Paper Writeryushui2022/MathModel-Skill | 453 | — | ~1.6k | Automated safety check: Pass | MIT | |
| AutoMCM Math Modeling AgentRealSeaberry/AutoMCM-Pro | 257 | — | ~2.3k | Automated safety check: Pass | MIT | |
| MCM/ICM Autonomous Modeling AgentRealSeaberry/AutoMCM-Pro | 257 | — | ~2.8k | Automated safety check: Pass | MIT |
XiaoMaColtAI/math-modeling-skill
Three-role workflow for math modeling contests: problem analysis, code and results, then a paper, with independent subagent checks at each stage gate.
RealSeaberry/AutoMCM-Pro
Runs a math modeling competition entry end to end, in AI-led or human-led mode, with Git checkpoints and self-verified solver code before it enters the LaTeX paper.
yushui2022/MathModel-Skill
Plans, drafts, audits, formats and verifies a formal mathematical-modeling paper from an evidence chain, delivering audited Markdown and a Word file with native equations.
RealSeaberry/AutoMCM-Pro
Runs a staged workflow for math modeling contests such as CUMCM and MCM/ICM, with checkpoints, verified solver code and a LaTeX paper, on DeepSeek Harness.
RealSeaberry/AutoMCM-Pro
Runs an MCM/ICM math modeling competition end to end: collects contest metadata, builds and verifies models and code, then generates an English LaTeX paper and any required memo.
zLanqing/codex-claude-academic-skills
A skill your agent uses when working with symbolic mathematics in Python.
WuXinbo-bo/Math-model-skills
Runs a staged pipeline for mathematical modeling research and contest papers, from problem analysis and computation to paper writing, review rounds and submission checks.
WuXinbo-bo/Math-model-skills
Pipeline stage that turns a mathematical modeling report into runnable programs per sub-question, frozen numerical results and reviewable evidence files.
WuXinbo-bo/Math-model-skills
Runs several independent review rounds on a finished math-modeling competition paper and rewrites it until it clears a fixed score and defect bar.
WuXinbo-bo/Math-model-skills
Breaks a math modeling competition problem statement into sub-problems, variables, constraints and evidence needs, and writes the result to a problem analysis file.
WuXinbo-bo/Math-model-skills
Meta-model-agent 完成编译、版式、匿名、页数、引用与提交前合规验收。适用于提交质量验收. An agent skill from WuXinbo-bo/Math-model-skills.
WuXinbo-bo/Math-model-skills
Meta-model-agent 将计算成果转换为可发表的数据图形、表格和排版引用。适用于证据图谱构建. An agent skill from WuXinbo-bo/Math-model-skills.
Works with
Categories
Stage protocol for a math-modeling pipeline that turns a problem analysis into a unified mathematical mechanism, formulas, a solution route and a validation plan. This is one stage in a pipeline for mathematical modeling contests, written in Chinese.5 KB.
Math Model Formulation Stage fits situations like: turning a contest problem analysis into a concrete mathematical model; planning formulas, solution algorithms and validation for each sub-question; extending an earlier model with new variables or constraints and recording the change.
Run `npx skills add WuXinbo-bo/Math-model-skills --skill model-formulation -a claude-code`. Or copy the skill folder (references/stage_protocols/model-formulation in WuXinbo-bo/Math-model-skills) into .claude/skills/model-formulation in your project. Claude Code loads it when a task matches its description.
Run `npx skills add WuXinbo-bo/Math-model-skills --skill model-formulation -a codex`. Or copy the skill folder (references/stage_protocols/model-formulation in WuXinbo-bo/Math-model-skills) into .agents/skills/model-formulation in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add WuXinbo-bo/Math-model-skills --skill model-formulation -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/model-formulation, .gemini/skills/model-formulation, .github/skills/model-formulation and .opencode/skills/model-formulation in your project.
SKILL.md names no scripts, command-line tools or credentials: Math Model Formulation Stage is instructions for the agent only. Our summary lists: The earlier problem-analysis file and the contest data; The model-quality-contracts reference file; Python, the default tool.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Math Model Formulation Stage is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.9k tokens (SKILL.md is roughly 12k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 13k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Math Model Formulation Stage: Math Modeling Competition Workflow (XiaoMaColtAI/math-modeling-skill, 1.9k stars), AutoMCM-Pro Math Modeling Agent (RealSeaberry/AutoMCM-Pro, 257 stars), Formal Modeling Paper Writer (yushui2022/MathModel-Skill, 453 stars) and AutoMCM Math Modeling Agent (RealSeaberry/AutoMCM-Pro, 257 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
WuXinbo-bo (a GitHub user) maintains it in WuXinbo-bo/Math-model-skills, which has 111 GitHub stars. The repository holds 9 skills in this directory. The repository was last updated on September 21, 2026.
Source: WuXinbo-bo/Math-model-skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.