pyomolisted
Install: claude install-skill cjh-solver/MathModeling-Skills-Arsenal
# Pyomo - Mathematical Optimization Modeling
Pyomo allows you to define optimization problems using a natural mathematical syntax (Sets, Parameters, Variables, Constraints). It decouples the model from the solver, allowing the same model to be solved by different engines without code changes.
## Contest-Orchestrator Adapter
在 `contest-orchestrator` 中,本技能只实现已批准的精确优化模型。调用前必须读取任务卡、`model_contract.yaml`、`symbol_table.md`、数据来源和 solver 预算;不得自行改目标、约束、参数或切换到启发式。依赖安装只可在用户批准的项目环境中执行,不得静默改变全局环境。
- 模型代码、solver 配置、日志和结果只写项目工作区;结果必须登记 `run_manifest`、`result_registry` 和 `numeric_source_map`。
- 必须记录可行性、`termination_condition`、目标值、变量值、约束违约、单位/量纲、随机性(如有)和复算命令;非 optimal 结果不得标记为最优。
- 返回 `status`、`active_mode`、`task_card`、`artifacts`、`evidence`、`checks`、`blockers`、`next_node` 节点包。不可行、超时或 solver 缺失时回流事实,不自动改模型。
- 默认不做截图、渲染复核或 AI 视觉检查;结果图走 `modelviz` → `scipilot-figure-skill`,用户明确要求时才启用视觉检查。
- 节点包、论文成品和报告不得包含元话语、内部交流、调试、失败过程、旧版本或未确认方案等负回响。
## Sensitivity Analysis Tool(B 题优化加固协同变更)
`scripts/sensitivity_analysis.py` 为 LP/MILP/NLP 模型提供参数扰动灵敏度分析。
- **输入**:`sensitivity_plan.yaml`,包含 `model_contract_sha256`、`subproblem_id`、参数基准值、扰动点列表、求解器配置
- **输出**:`sensitivity_report.yaml`,`schema_version=1.0`,每个扰动点登记 `objective`、`feasible`、`decision_change`、`constraint_violation`、`termination_condition`
- **状态契约**:只有 `status: verified` 且所有扰动点有真实数值或明确 `not_applicable_reason` 时,才允许通过 contest-orchestrator 的 H6 验证;`completed`/`manual_required` 为空证据通路,会被主控检查器拒绝
- **求解器不可用时**:生成 `status: manual_required` 报告,明确标注需要人工完