| name | math-modeling-solver |
| description | Solve or improve end-to-end mathematical-modeling competition and applied-modeling work: problem decomposition, MATLAB-first computation, model design, validation, credible innovation, and evidence-backed paper delivery. Use for complete solutions, award-seeking papers, redesign of an existing model, or review of a substantive modeling route. Before the first formal numerical execution, verify an official MATLAB execution route and the task-relevant capabilities. |
Math Modeling Solver
Orchestrate the complete modeling argument from question to verified deliverable. Optimize for truthful, problem-specific contribution: every important result must be executable, checked, explainable, and bounded by evidence.
Scope
- Keep this Skill active when the request spans several of: framing, data, formulation, computation, validation, innovation, and integrated writing.
- Route evidence-only audits to
audit-modeling-evidence, figure-only work to build-modeling-figures, and formatting/submission-only work to deliver-cumcm-paper.
- A request to improve an existing model or redo one substantive subquestion is in scope. Preserve shared variables, units, constraints, and evidence links across subquestions.
Non-negotiable rules
- Never invent inputs, runs, metrics, citations, figures, or conclusions. Label synthetic examples
demo; formal evidence may come from traceable data, verified analytical derivation, or an executed simulator.
- Write the problem contract before computation: objectives, inputs, outputs, units, hard constraints, assumptions, dependencies, and requested deliverables.
- Use MATLAB as the preferred authoritative numerical backend when an official MATLAB MCP capability or an authorized local MATLAB route is available and suitable. Do not select Python merely because a familiar template exists.
- Establish a transparent or exact baseline before adding complexity. Add a component only for a named, observed failure or an explicit structural requirement.
- Do not select algorithms from keywords and do not equate innovation with model count. Hyperparameter variants are not distinct innovations.
- Separate selection data from final evaluation. Record commands, parameters, seeds, versions, provenance, and artifact paths for formal runs.
- Match validation to the claim and task family. Reproducibility, sensitivity, robustness, and generalization are different claims.
- Freeze canonical numbers before writing; map every headline claim to a formula, verified source, result file, table, or figure.
- Report uncertainty, infeasibility, negative results, failure regions, and extrapolation limits.
- Request user confirmation only when interpretation materially changes the requested scope, external publication is involved, or authority is missing. Otherwise record the rationale and continue autonomously.
State contract
Record only the dimensions needed by the task:
data_mode: formal or demo.
workflow_stage: explore, validate, or deliver.
ambition_mode: baseline, competitive, or ceiling.
delivery_profile: paper-bundle, contest-word, cumcm-latex, code-only, or custom.
result_status: draft, validated, or frozen; manuscript packaging is an artifact state, not a numerical-result state.
A complete competition request defaults to competitive; “冲上限/冲奖/最高水平” selects ceiling. Audit outcomes are pass, warn, failed, or blocked. Use blocked only when an essential input or authorization prevents meaningful progress; use failed when an inspectable artifact violates a check, and warn for an honest but limited result.
Core decision flow
-
Lock the statement, attachments, time and compute budget, data mode, ambition, and delivery profile.
-
Decompose the problem. Give each subquestion a primary and, when needed, auxiliary task family; draw dependencies before choosing methods.
-
Identify numerical needs and task-relevant MATLAB capabilities. Then complete the backend preflight below before the first formal numerical execution.
-
Resolve SKILL_ROOT as the directory containing this file. Invoke bundled scripts by absolute quoted path; never assume the user project is the current directory. For a new project, run:
python "<SKILL_ROOT>/scripts/init_modeling_project.py" "<PROJECT_DIR>" --mode formal --workflow-stage explore --ambition-mode competitive --questions N
-
Choose a validation archetype and establish the smallest defensible comparator. For empirical model selection, run a baseline and at most one or two challengers aimed at named failure modes. For analytical or exact tasks, a bound, limiting case, conservation law, KKT/dual certificate, or enumerated small case may replace a second model.
-
Register the hypothesis, fair budget, primary metric, minimum meaningful gain, stop rule, and required artifact before adaptive search. Do not inspect the final holdout repeatedly.
-
Build an innovation portfolio from baseline gaps and problem structure. Test only the smallest high-value set; demote negative or unstable candidates instead of disguising them.
-
Validate by task family, freeze canonical results, and run the project audit. Write only from frozen evidence.
-
After the evidence audit, run a separate competition-readiness review. Excellent papers are optional post-hoc comparators for argument structure and evidence roles, never a source of methods by imitation.
-
Deliver only what the user requested, plus concise statuses for the backend, evidence audit, innovation gate, deviations, and unresolved risks.
MATLAB-first backend gate
Perform this gate after the computation needs are known and before the first formal numerical run:
- Discover callable capabilities from the official MATLAB MCP integration. Tool names such as
detect_matlab_toolboxes, evaluate_matlab_code, run_matlab_file, and check_matlab_code are examples, not required identifiers.
- Make a harmless real call that proves execution and records MATLAB release, operating system, relevant toolboxes, capability/tool used, timestamp, and artifact path. A configuration entry alone is not proof.
- Write
audit/backend-contract.json and map each numerical subquestion to its authoritative backend.
- Prefer routes in this order: official MATLAB MCP; authorized non-interactive local MATLAB; another backend with a concrete user requirement, capability advantage, or unrecoverable availability reason.
- Run MATLAB Code Analyzer through an exposed capability or native
checkcode, then execute with fixed inputs and seeds. Reopen saved outputs before treating them as evidence.
- Run the MATLAB–Python bridge preflight only when numerical arrays, state, scores, or control decisions cross languages. Document conversion, web access, and manuscript assembly alone do not trigger it.
Audit the record with:
python "<SKILL_ROOT>/scripts/audit_backend_contract.py" "<PROJECT_DIR>/audit/backend-contract.json"
On failure, read references/matlab-mcp-setup.md; do not silently change the numerical owner.
Model roles and experiment budget
sanity baseline: checks data, metric, units, and implementation.
competitive baseline: a strong, structurally appropriate mainstream or exact comparator when model comparison is meaningful.
current champion: the best candidate under the frozen selection contract.
challenger: one distinct mechanism targeting a documented failure; normally test no more than two before reassessing.
final frozen champion: the validated result after the untouched final evaluation.
ceiling increases the depth of failure analysis, validation, and independent checking—not the number of algorithms that must run. Neural networks, ensembles, stacking, and metaheuristics require positive justification from sample size, structure, exact-solver limits, compute budget, and validation power. Prefer exact reformulation, physical constraints, or decomposition before generic stochastic search.
Innovation gate
For competitive and ceiling work, maintain planning/innovation-portfolio.json. Candidate types include formulation, mechanism-data fusion, solver, validation/uncertainty, and decision insight; evidence presentation may support but normally cannot be the sole primary contribution.
Each serious candidate records the baseline gap, mechanism, expected decision value, fair comparator, falsification test, evidence artifact, risk, cost, and claim boundary. Select a primary contribution only after evidence; a conventional solution may finish with warn, but an unsupported novelty claim is failed or blocked.
python "<SKILL_ROOT>/scripts/audit_innovation_portfolio.py" "<PROJECT_DIR>/planning/innovation-portfolio.json"
Run the competition-readiness rubric after frozen evidence exists. Literature novelty words such as “first” or “novel” require a current literature search; contest-specific contribution does not automatically imply literature novelty.
Validation archetypes
| Archetype | Minimum promotion evidence |
|---|
| Prediction/classification | leakage-safe nested or selection-isolated validation; group/time structure; calibration or subgroup errors when relevant; final holdout once |
| Ranking/evaluation | normalization checks; weight and rank sensitivity; dominance/tie handling; decision stability |
| Mechanistic/analytical | dimensional consistency; conservation or invariants; limiting cases; parameter identifiability; independent conditions when available |
| Exact optimization | feasibility; solver status; bound/gap; KKT, dual, or enumeration check when applicable; post-optimal sensitivity |
| Heuristic optimization | equal evaluation budgets; paired scenarios and seeds; feasible-result distribution; exact/bound reference where possible |
| Stochastic simulation | rule verification; warm-up/steady-state rationale; replication count chosen from precision or coverage; confidence interval and scenario coverage |
| Multi-objective optimization | dominance on raw objectives; meaningful range and coverage; repeated stability; explicit final-point rule—two points alone do not establish a useful front |
An independent rerun proves reproducibility, not generalization. Choose task-specific validation from references/validation-playbook.md and references/candidate-validation-contract.md.
Direct conditional routing
- Intake and task-family decomposition:
references/problem-triage.md, references/task-family-router.md, references/data-and-reproducibility.md.
- Model choice and failure-driven upgrades:
references/model-selection.md, references/failure-to-method-router.md, references/when-to-upgrade-model-complexity.md.
- MATLAB/backend ownership:
references/matlab-native-workflow.md, references/matlab-mcp-setup.md.
- Validation and promotion:
references/validation-playbook.md, references/candidate-validation-contract.md, references/experiment-budget-and-promotion.md.
- Exact or simulation work:
references/exact-simulation-contract.md; for queues/events also references/discrete-event-scheduling.md.
- Innovation and contest strength:
references/innovation-and-competition.md, references/competition-timeline.md.
- Evidence gates and registries:
references/evidence-gated-workflow.md, references/evidence-registry-contract.md.
- Paper planning:
references/argument-first-paper-writing.md, references/paper-writing.md; for Word use references/contest-word-delivery.md, then route final Word/LaTeX/PDF compliance work to deliver-cumcm-paper.
- Figures: route figure-only work to
build-modeling-figures; otherwise use references/figure-contract-and-qa.md.
- Historical regression tests:
references/blind-benchmarking.md; keep evaluation rubrics hidden until candidate responses are frozen.
Audit and delivery
Resolve stage-specific gates and audit with absolute script paths:
python "<SKILL_ROOT>/scripts/resolve_required_gates.py" --project-dir "<PROJECT_DIR>"
python "<SKILL_ROOT>/scripts/audit_modeling_project.py" "<PROJECT_DIR>"
Internal required artifacts are the problem and backend contracts, experiment and innovation records when applicable, reproducibility manifest, validation evidence, frozen results, and claim ledger. They support the work but are not automatically user-facing deliverables. Package only the requested paper, code, result, figure, or custom bundle; preserve internal evidence in the project workspace.