Skip to content

Add a figure to the Newton maximum example - #663

Merged
d-morrison merged 2 commits into
mainfrom
claude/mds646-newton-maximum-fig
Nov 6, 2026
Merged

d-morrison merged 2 commits into
mainfrom
claude/mds646-newton-maximum-fig

Conversation

@d-morrison

Copy link
Copy Markdown
Contributor

Requested by Ezra · project thread

Adds a figure to exm-newton-maximum: the cubic f(x) = x³/3 − 4x, its downward-opening quadratic model at the start −2.5, the model's stationary point −2.05, and the local maximum at −2. R (ggplot2) and Python (matplotlib) tabs; cited from and nested in the example.

Part of #646 (figures for the optimization examples), under #579.

Files:

  • _subfiles/vector-calc/_fig-newton-maximum.qmd (new)
  • _subfiles/vector-calc/_exm-newton-maximum.qmd

Rendered optimization-newton.qmd locally and checked both figures.


Generated by Claude Code

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019xfc9pBmXswEX8Uu9Kt7f7
@d-morrison d-morrison self-assigned this Nov 5, 2026
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Claude finished review — View run


Nothing blocking in this PR. I did not render the page, so the figure itself is unchecked.

I checked these:

  • Plotted numbers: The Newton-step values are correct for f(x) = x³/3 − 4x. At x = −2.5, f′ = 2.25 and f″ = −5, so the model is f₀ + 2.25·dx − 2.5·dx². Its stationary point is at dx = 0.45, which is −2.05, matching the figure and the alt text. The local maximum at −2 gives f = 16/3, and the y-limits (−2, 6.5) contain every plotted point.
  • Cross-references: #def-cubic-polynomial is defined in _subfiles/algebra/_def-quadratic-cubic.qmd. #def-newton-step, #def-stationary-point, #def-iterate and #def-local-maximizer are all defined under _subfiles/vector-calc/. The new figure is included only from _exm-newton-maximum.qmd, and that file is included once, from _sec_optimization_newton.qmd.
  • Figure div: fig-newton-maximum is a figure div, not a theorem-type div, so the no-nesting rule doesn't apply. The R and Python tabs have matching alt text, colours and data. The variable prefixes and the \step macro follow the existing subfile conventions.

Suggestions (non-blocking)

  • _subfiles/vector-calc/_fig-newton-maximum.qmd:106: the caption writes $f(x) = x^3 / 3 - 4x$ with a literal f. The example it points to already uses f and f'', so this matches the surrounding text. If latex-macros has a function-name macro for this f, use it there and in the example.
  • _subfiles/vector-calc/_exm-newton-maximum.qmd:16: "the cubic" has an antecedent only if the reader remembers the earlier example. The caption does tie it to @exm-newton-maximum, so I'm leaving it as a suggestion.

Verdict

Ready for merge

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "93c0694bd1ac25a2ff626a789500332e761736fe",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "Checked _fig-newton-maximum.qmd: the plotted quadratic model, stationary point at -2.05 and maximum at -2 are numerically correct, and all linked def ids resolve.",
  "holistic_assessment": "Small additive figure included once from the existing example; no regression, scope, or build-hygiene concerns, though the page was not rendered here."
}

I fetched PR #663 just now. It is open, not a draft and not merged. Its head is 93c0694bd1ac25a2ff626a789500332e761736fe, the commit I reviewed, so the verdict stands.

Verdict

Ready for merge

Structured Review Data (JSON)
{
  "schema_version": "1.1",
  "reviewer": "claude",
  "commit_sha": "93c0694bd1ac25a2ff626a789500332e761736fe",
  "verdict": "CLEAN",
  "findings": [],
  "detailed_assessment": "Checked _fig-newton-maximum.qmd: the plotted quadratic model, stationary point at -2.05 and maximum at -2 are numerically correct, and all linked def ids resolve.",
  "holistic_assessment": "Small additive figure included once from the existing example; no regression, scope, or build-hygiene concerns, though the page was not rendered here."
}

Reviewed commit: 93c0694

@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

💰 Cost: $0.2097 (review) — run

@github-actions

github-actions Bot commented Nov 6, 2026

Copy link
Copy Markdown
Contributor
PR Preview Action v1.8.2
🚀 Preview available at: https://Morrison-Lab.github.io/mds/pr-preview/pr-663/

Built to branch gh-pages at 2026-11-06 00:38 UTC.

d-morrison commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor Author

Annotations reviewed: 93c0694

All are platform notices (the ubuntu-latest migration, an empty SUBMODULES_TOKEN, a diff-highlight cap); none concern this change.


Posted by Claude Code (AI agent) --- not written by a human.
Generated by Claude Code


Generated by Claude Code

@d-morrison
d-morrison merged commit 26c63db into main Nov 6, 2026
44 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants