Initial commit

This commit is contained in:
ChuXun
2026-02-16 21:52:26 +08:00
commit 18ce59bec7
334 changed files with 35333 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
DIAGRAM_MACRO_LOGIC
```mermaid
graph TD
subgraph StageA [Step 1: Data Processing]
A1[OCV Fitting]
end
subgraph StageB [Step 2: Core Modeling]
B1[Power Map]
B2[CPL Closure]
B3[Thermal Dynamics]
end
subgraph StageC [Step 3: Application]
C1[Scenario Analysis]
C2[Uncertainty Quantification]
C3[Aging Forecast]
end
StageA --> StageB
StageB --> StageC
```
DIAGRAM_SYSTEM_INTERACTION
```mermaid
flowchart LR
I1[Screen Brightness L(t)] --> BS[Battery System]
I2[CPU Load C(t)] --> BS
I3[Network Activity N(t)] --> BS
I4[GPS Usage G(t)] --> BS
I5[Ambient Temperature T_a(t)] --> BS
```
DIAGRAM_CPL_LOOP
```mermaid
flowchart LR
P[Total Power P_tot] --> I[Current I (CPL Solve)]
I --> V[Terminal Voltage V_term]
V --> P
```

265
A题/图像/prompt.md Normal file
View File

@@ -0,0 +1,265 @@
TASK: Generate publication-quality, O-Prize-standard visuals for an MCM/ICM paper on smartphone battery drain. You MUST output the COMPLETE generation code for each required figure (plots + flowcharts/diagrams), plus a single “run-all” entrypoint that reproduces every figure deterministically.
CRITICAL REQUIREMENT (NON-NEGOTIABLE): PRESERVE EXISTING CONTENT INTEGRITY
- You MUST NOT rewrite, restructure, or renumber ANY existing paper sections or text.
- You MUST NOT change any existing model equations or definitions.
- Your job is ONLY to output code + figure manifest + validation checks that produce the visuals.
- Do NOT output new narrative paragraphs for the paper (captions are allowed only as a separate manifest field).
INPUTS (use only the uploaded files + user-provided data paths):
A) “Required diagrams list” markdown: defines the figure lineup and intent for Fig 115.
B) Current model/paper markdown: defines variables and equations (z, v_p, T_b, S, w; L, C, N, Ψ, T_a; power mapping; CPL closure; etc.).
C) Any existing workflow/flowchart markdown (e.g., Mermaid) if provided.
D) Simulation outputs / datasets: YOU MUST NOT invent filenames. Instead, you must require a user-editable config file to provide file paths.
DETERMINISM REQUIREMENTS:
- Fix all random seeds (one global seed constant).
- No dependence on system time.
- All figures must be reproducible bitwise given identical inputs.
- Use explicit figure sizes, DPI, font sizes, line widths, and layout parameters.
- Avoid any “automatic styling” that can vary by environment.
VISUAL QUALITY REQUIREMENTS (O-Prize standard):
- Export BOTH vector and raster:
- Vector: PDF (preferred) or SVG for diagrams.
- Raster: PNG at 300+ DPI for embedding.
- Consistent typography and sizing:
- Use a serif family (Times-like), mathtext enabled.
- Axis labels with units, readable ticks, uncluttered legends.
- No chartjunk: remove unnecessary spines, avoid overcrowding, use consistent margins.
- Every figure must have a clear “message” aligned with the diagram spec.
ALLOWED TOOLS / LIBS (Python):
- matplotlib (primary plotting)
- numpy, pandas
- scipy (curve fitting if needed)
- graphviz (preferred for flowcharts/diagrams via DOT)
- (Optional) matplotlib 3D for surfaces; must remain deterministic
OUTPUTS YOU MUST PRODUCE (exact order):
1) FIGURE_MANIFEST_v1 (JSON)
2) CODE_PACKAGE_v1 (multiple code files; each in its own code fence with file path header)
3) RUN_INSTRUCTIONS_v1 (plain text; exact commands)
4) VALIDATION_REPORT_v1 (JSON schema + what each check prints)
────────────────────────────────────────────────────────
METHODOLOGY (follow exactly)
────────────────────────────────────────────────────────
STEP 1 — Parse the required figure specification
- Read the “required diagrams list” markdown and extract Fig 115.
For each figure, store:
- fig_id (1..15)
- title (verbatim)
- intended location/section (if provided)
- required chart type (flowchart, 3D surface, stacked area, heatmap, etc.)
- required axes/annotations (e.g., ΔTTE arrow, R² > 0.99 display, “95% Confidence TTE” marker)
Do NOT add or remove figures.
STEP 2 — Define a strict data contract via a user-editable config
Because you cannot assume filenames, you MUST implement:
- config/figure_config.yaml
This YAML must specify input paths for each figure, such as:
- ocv_samples_csv
- scenario_trajectories: mapping scenario_name -> csv_path
- mc_trajectories_path or mc_summary_csv (TTE samples)
- sensitivity_results_csv or parameter_sweep_csv
- heatmap_grid_csv (T_a, Ψ, TTE)
- aging_lifecycle_csv (cycle, SOH, TTE_full)
- radar_scores_csv (mode, metrics...)
Each figure script MUST read only its declared inputs from this config.
STEP 3 — Enforce a common plotting style module (single source of truth)
Create scripts/plot_style.py that:
- Sets matplotlib rcParams (font family, font size, mathtext, line width, figure dpi for save)
- Defines helper utilities:
- save_figure(fig, out_basepath): writes .pdf and .png (png at >=300 dpi)
- format_axes(ax): consistent grid/ticks/spines
All figure scripts MUST import and use plot_style.py.
STEP 4 — Implement one script per figure (Fig 01 … Fig 15)
Folder: scripts/figures/
Naming:
- fig01_macro_logic_flowchart.py
- fig02_system_interaction_diagram.py
...
- fig15_radar_user_guide.py
Each figure script MUST:
- Define a single public function: make_figure(config: dict) -> dict
- Return a dict containing:
- output_files: list[str]
- computed_metrics: dict (e.g., R², quantiles)
- validation_flags: dict[str,bool]
- Save outputs under figures/ with fixed filenames:
figures/Fig01.pdf, figures/Fig01.png, ... figures/Fig15.*
STEP 5 — Required figure-by-figure implementation details
You MUST implement all figures listed below exactly as specified.
FIG 1 (Macro-Logic Flowchart)
- Type: diagram/flowchart
- Tool: Graphviz DOT (preferred) + python wrapper to render
- Nodes: Data Processing → Core Modeling → Application (must match spec wording)
- Output: Fig01.pdf + Fig01.png
FIG 2 (System Interaction Diagram)
- Type: diagram
- Must show inputs around system: L, C, N, G (GPS proxy), T_a; outputs: TTE, SOH
- Use Graphviz DOT with clusters: Inputs / Internal Modules / Outputs
- Output: Fig02.*
FIG 3 (OCV Curve Fitting)
- Inputs: ocv_samples_csv with columns: z, V_oc_meas
- Method: Fit to the papers chosen OCV form (use the exact OCV function from the paper markdown)
- Plot: scatter of data + fitted curve line
- Display: R² in the plot (must meet threshold in validation)
- Output: Fig03.*
FIG 4 (Internal Resistance Surface)
- Inputs: either (a) parameterized function R0(T_b,z or S) OR (b) a grid csv with columns (T_b, z, R0)
- Plot: 3D surface with labeled axes and units
- Output: Fig04.*
FIG 5 (Tail Energy Illustration)
- Inputs (preferred): a trajectory csv containing time, N(t), w(t), P_net(t) OR a small synthetic pulse-definition in config
- Plot: two-panel figure:
- Top: data burst indicator (N or packet events)
- Bottom: power state persistence (P_net or tail component k_tail*w)
- Must visually demonstrate “short burst → long tail”
- Output: Fig05.*
FIG 6 (CPL Avalanche Loop)
- Type: causal loop diagram
- Must show: V↓ → I↑ → Loss↑ → V↓↓ (exact concept)
- Use Graphviz DOT with arrow labels
- Output: Fig06.*
FIG 7 (Baseline Validation 2×2)
- Inputs: baseline trajectory csv with columns (t, z, V_term, I, T_b)
- Plot: 2×2 subplots: SOC, Voltage, Current, Temperature vs time
- Must visually confirm CPL signature: as V_term declines, I increases (include a note/annotation)
- Output: Fig07.*
FIG 8 (Power Breakdown Stacked Area)
- Inputs: baseline trajectory csv with columns (t, P_bg, P_scr, P_cpu, P_net, [P_gps if present])
- Plot: stacked area of power components vs time
- Output: Fig08.*
FIG 9 (Scenario Comparison & GPS Impact)
- Inputs: multiple scenario csvs with columns (t, z) and TTE summary values
- Plot: overlay 34 SOC curves (baseline, video, gaming, navigation)
- Must annotate ΔTTE due to GPS/navigation with a double-arrow and numeric label
- Output: Fig09.*
FIG 10 (Tornado Diagram)
- Inputs: sensitivity_results_csv with columns: parameter_name, low_TTE, base_TTE, high_TTE (or delta)
- Plot: horizontal tornado bars sorted by absolute impact
- Must include GPS, signal quality, temperature, brightness (as available)
- Output: Fig10.*
FIG 11 (Two-Parameter Heatmap)
- Inputs: heatmap_grid_csv with columns: T_a, Psi, TTE
- Plot: heatmap (T_a on x, Psi on y) colored by TTE (hours)
- Output: Fig11.*
FIG 12 (Monte Carlo Spaghetti Plot)
- Inputs: mc_trajectories file(s) OR a single tidy csv: run_id, t, z
- Plot: many thin SOC curves + one thick mean curve
- Use fixed seed only for any sampling/downselection
- Output: Fig12.*
FIG 13 (Reliability / Survival Curve)
- Inputs: tte_samples_csv with column: TTE
- Plot: empirical survival S(t)=P(TTE>t) as a step function
- Must mark “95% Confidence TTE” = 5th percentile (or specify explicitly) with a vertical line + label
- Output: Fig13.*
FIG 14 (Lifecycle Degradation)
- Inputs: aging_lifecycle_csv with columns: cycle_index, SOH, TTE_full
- Plot: dual-axis (SOH vs cycle, TTE_full vs cycle) with clear legends and units
- Output: Fig14.*
FIG 15 (User Guide Radar Chart)
- Inputs: radar_scores_csv with columns: mode, screen, cpu, location, network, experience (or exact metrics listed)
- Plot: radar comparing “power-saving mode” vs “high-performance mode”
- Output: Fig15.*
STEP 6 — Add a run-all pipeline
Create run_all_figures.py that:
- Loads config/figure_config.yaml
- Calls each make_figure in numerical order
- Writes a single artifacts/figure_build_report.json with metrics + flags
- Exits with non-zero code if any validation fails
STEP 7 — Validation (must be implemented, not just described)
Each figure must have at least one deterministic validation check:
- Fig03: R² >= 0.99 (configurable threshold but default 0.99)
- Fig07: correlation check showing CPL tendency (e.g., corr(V_term, I) < 0 under baseline)
- Fig09: ΔTTE annotation value matches computed TTE difference within tolerance
- Fig12: M >= 100 runs unless user sets otherwise
- Fig13: survival curve starts at 1 and ends near 0; 95% marker equals empirical percentile
- All plots: output files exist and are non-empty; axis labels present
────────────────────────────────────────────────────────
DELIVERABLE FORMATS (STRICT)
────────────────────────────────────────────────────────
1) FIGURE_MANIFEST_v1 (JSON only)
Schema:
{
"global": {
"seed": 12345,
"output_dir": "figures",
"formats": ["pdf","png"],
"dpi_png": 300
},
"figures": [
{
"fig_id": 1,
"title": "...",
"script": "scripts/figures/fig01_....py",
"inputs_from_config": ["..."],
"outputs": ["figures/Fig01.pdf","figures/Fig01.png"],
"caption_suggestion": "..."
},
...
]
}
2) CODE_PACKAGE_v1
- Output multiple code fences.
- Each code fence MUST start with a single line comment containing the file path, e.g.:
# scripts/plot_style.py
- Include at minimum:
- config/figure_config.yaml (template with placeholders)
- scripts/plot_style.py
- scripts/config_io.py (loads yaml)
- scripts/validation.py (shared checks)
- scripts/figures/fig01_*.py … scripts/figures/fig15_*.py
- run_all_figures.py
- requirements.txt
3) RUN_INSTRUCTIONS_v1 (plain text)
Must include exact commands:
- pip install -r requirements.txt
- python run_all_figures.py
4) VALIDATION_REPORT_v1 (JSON only)
Schema:
{
"status": "PASS" or "FAIL",
"failed_figures": [ ... ],
"details": {
"Fig03": {"R2": 0.995, "pass": true},
...
}
}
FORBIDDEN:
- Do NOT modify paper text.
- Do NOT invent data. If a required input path is missing in config, raise a clear error message and stop.
- Do NOT output partial scripts; every file must be complete and runnable.
- Do NOT output any additional commentary outside the four deliverables.
NOW EXECUTE: produce the four deliverables exactly.

View File

@@ -0,0 +1,161 @@
抱歉,之前的建议虽然精简,但对于追求 **O奖Outstanding Winner** 的顶级论文来说,确实还可以进一步丰富,特别是为了展现**建模的每一个细节**和**多维度的分析**。
仔细研读你的《论文结构2.md》后我为你重新规划了一份 **14-15 张图表** 的完整清单。这份清单的逻辑是:**“每一个关键数学假设都有图验证,每一个关键结论都有图支撑”**。
以下是根据你论文章节顺序排列的详细图表列表:
### ---
**第一部分:模型背景与架构 (Section 1-2)**
*目的:用视觉语言让评委在进入复杂公式前先看懂你的逻辑。*
**Fig 1: The "Macro-Logic" Flowchart (总体思维导图)**
* **位置:** Section 1 (Introduction) 或 Section 2 (Overview)
* **内容:** 这是一个大图,展示解决问题的三步走:
1. **Data Processing:** (OCV拟合, 参数提取)
2. **Core Modeling:** (Power Map $\\to$ CPL Feedback $\\to$ Thermal $\\to$ Battery State)
3. **Application:** (Scenario Analysis, UQ, Aging)
* **为何需要:** 评委第一眼需要看到你的“作战地图”。
**Fig 2: System Interaction Diagram (系统边界与变量图)**
* **位置:** Section 2 (Assumptions & Notations)
* **内容:** 中间是手机(电池),周围环绕着 5 个输入变量 ($L, C, N, G, T\_a$)。箭头指向内部模块,再从内部指由输出 ($TTE, SOH$)。
* **为何需要:** 直观展示你的 $u(t)$ 和 $x(t)$ 向量包含什么,特别是高亮你新增的 GPS 模块。
### ---
**第二部分:模型建立细节 (Section 3-5)**
*目的:展示你的模型不是凭空捏造的,而是基于物理和数据的。这是之前版本主要缺失的部分。*
**Fig 3: OCV Curve Fitting (开路电压拟合验证图)**
* **位置:** Section 3 (Battery Model) 或 Section 5 (Parameter Estimation)
* **内容:**
* 散点:实验数据点 (Reference Data Points)。
* 实线:你拟合的函数曲线 $V\_{oc}(z) \= \\alpha \+ \\beta z \+ ...$。
* **重点:** 展示拟合的 $R^2 \> 0.99$。
* **为何需要:** **这是O奖论文的硬通货。** 证明你的电压模型极其准确,不是随便写个线性公式。
**Fig 4: Internal Resistance Surface (内阻 $R\_0$ 三维曲面图)**
* **位置:** Section 3 (Battery Model)
* **内容:** 3D Surface Plot。
* X轴温度 ($T\_b$)
* Y轴SOC ($z$)
* Z轴内阻 ($R\_0$)
* **趋势:** 展示低温下内阻急剧升高,低电量下内阻升高。
* **为何需要:** 二维图太普通,三维图能瞬间提升模型的“物理复杂度”观感。
**Fig 5: The "Tail Energy" Illustration (网络尾流效应示意图)**
* **位置:** Section 3.1 (Power Mapping \- Network)
* **内容:** 时间轴上的脉冲图。
* 上图:数据包传输 (Data Burst) —— 只有一瞬间。
* 下图:功率状态 (Power State) —— 传输完后维持 High Power 一段时间,再降到 Idle。
* **为何需要:** 你的模型里提到了 $w(t)$ (Radio tail),如果不画图,评委很难理解这个微分方程的精妙之处。
**Fig 6: CPL "Avalanche" Loop (恒功率负载反馈机制图)**
* **位置:** Section 3.3 (CPL Closure)
* **内容:** 之前提到的闭环反馈图 ($V\\downarrow \\to I\\uparrow \\to Loss\\uparrow \\to V\\downarrow\\downarrow$)。
* **为何需要:** 解释为什么最后 10% 电量掉得特别快,这是物理核心。
### ---
**第三部分:仿真与结果分析 (Section 6-8)**
*目的:展示模型运行结果,证明其符合现实规律。*
**Fig 7: Baseline Validation (基准动力学四联图)**
* **位置:** Section 7 (Baseline Results)
* **内容:** 2x2 子图 (SOC, Voltage, Current, Temp)。
* **细节:** 必须清晰展示 Current 随 Voltage 下降而上升的曲线CPL特征
* **为何需要:** 证明模型运行正常,符合基本物理定律。
**Fig 8: Power Breakdown Stacked Area Plot (功率成分堆叠图)**
* **位置:** Section 7 (Baseline Results)
* **内容:** 堆叠面积图。
* X轴时间 (0 到 TTE)。
* Y轴功率 (Watts)。
* 颜色层:最底层是 $P\_{bg}$,上面是 $P\_{screen}$,再上面是 $P\_{cpu}$。
* **为何需要:** 让评委直观看到“到底电都去哪儿了”。
**Fig 9: Scenario Comparison & GPS Impact (多场景 TTE 对比图)**
* **位置:** Section 8 (Scenario Analysis)
* **内容:** 3-4 条 SOC 下降曲线(基准、视频、游戏、**导航**)。
* **标注:** 用双箭头标注出 **GPS 导致的 $\\Delta TTE$**
* **为何需要:** 直接回答题目关于“不同活动影响”的问题。
### ---
**第四部分:高级分析与灵敏度 (Section 9-11)**
*目的:这是拿 O 奖的关键,展示数学深度和不确定性处理。*
**Fig 10: Tornado Diagram (龙卷风图 \- 灵敏度排名)**
* **位置:** Section 9 (Sensitivity Analysis)
* **内容:** 横向条形图展示各参数屏幕、信号、温度、GPS对 TTE 的影响幅度。
* **为何需要:** 决策者最爱看这种图,一眼看出关键因子。
**Fig 11: Two-Parameter Heatmap (双变量热力图)**
* **位置:** Section 9 (Sensitivity Analysis)
* **内容:** 颜色方块图。
* X轴环境温度 ($T\_a$),从 \-10°C 到 40°C。
* Y轴信号质量 ($\\Psi$),从 0 到 1。
* 颜色TTE (小时)。
* **结论:** 颜色最深区域(低温+弱信号)就是“电池杀手区”。
* **为何需要:** 展示变量之间的**耦合效应 (Interaction Effect)**,比单变量分析高级。
**Fig 12: Monte Carlo "Spaghetti Plot" (蒙特卡洛随机路径图)**
* **位置:** Section 10 (Uncertainty Quantification)
* **内容:** 100 条灰色的 SOC 曲线叠加,中间有一条加粗的均值线。
* **为何需要:** 视觉化展示“不可预测性”,说明你的模型能处理随机波动。
**Fig 13: Reliability / Survival Curve (生存曲线图)**
* **位置:** Section 10 (Uncertainty Quantification)
* **内容:** 概率 $P(TTE \> t)$ 随时间下降的阶梯图。
* **标注:** 标出 "95% Confidence TTE"。
* **为何需要:** 将不确定性转化为**可靠性指标**,回答题目隐含的“用户想知道到底能用多久”的需求。
### ---
**第五部分:长期影响 (Section 11-13)**
*目的:展示时间维度的拓展。*
**Fig 14: Lifecycle Degradation (全生命周期老化图)**
* **位置:** Section 11 (Aging)
* **内容:**
* 左轴SOH (健康度) 随循环次数下降。
* 右轴:满电 TTE 随循环次数下降。
* **为何需要:** 证明你的模型不仅能看“一天”,还能看“一年”。
**Fig 15: "User Guide" Radar Chart (用户建议雷达图 \- Optional but Recommended)**
* **位置:** Section 12 (Recommendations)
* **内容:** 一个五边形雷达图对比“省电模式”vs“高性能模式”在不同维度屏幕、CPU、位置、网络、体验的得分。
* **为何需要:** 将复杂的数学结论转化为给非技术用户的直观建议,非常加分。
### ---
**总结**
现在你有 **15 张图**
* **逻辑/原理图:** 4 张 (Fig 1, 2, 5, 6\) —— *用 Visio 画*
* **物理/拟合图:** 2 张 (Fig 3, 4\) —— *用 Python 画*
* **结果/分析图:** 9 张 (Fig 7-15) —— *用 Python 画*
这完全符合一篇 25 页 O 奖论文的体量,图文比例非常完美。你需要我为你生成其中哪些数据图的代码?