Skip to content

DDEProblemLibrary: fix sign error in RADAR5 Oregonator (u1 equation) - #233

Draft
ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix-radar5-oregonator-sign
Draft

ChrisRackauckas-Claude wants to merge 1 commit into
SciML:masterfrom
ChrisRackauckas-Claude:fix-radar5-oregonator-sign

Conversation

@ChrisRackauckas-Claude

Copy link
Copy Markdown
Member

Please ignore until reviewed by @ChrisRackauckas.

What changed and why

prob_dde_RADAR5_oregonator computes a = -k₁*A*u[2] - k₂*u[1]*v once and uses it in both components, so du[1] gets -k₁ A u₂ where RADAR5 has +k₁ A u₂. The RADAR5 driver (RADAR5-V2.1/OREGONATOR/dr-oregon.f, from http://www.unige.ch/~hairer/radar5-v2.1.tar) has:

F(1)=  kM1*A*Y(2) - kM2*Y(1)*Y2L1 + kM3*B*Y(1)-2.D0*kM4*Y(1)**2
F(2)= -kM1*A*Y(2) - kM2*Y(1)*Y2L1 + fr*kM3*B*Y(1)

With the wrong sign, u₁ decays to 0 and the solution stays flat at u₂ ≈ 1e-5 on [0, 100.5], so the SciMLBenchmarks StiffDDE/Oregonator_wpd page compares solvers on a trivial solution. This PR fixes the RHS and the docstring, adds a Core test comparing the RHS to the RADAR5 FCN, and bumps DDEProblemLibrary to 0.1.10.

Verification

Before/after solution with MethodOfSteps(Rodas5P()), reltol = 1e-9, abstol = 1e-18 (DelayDiffEq 6.4.0, Julia 1.11.9), u₂ sampled at t = 0:5:100:

library (current): retcode=Success nsteps=85    u1 range=(-5.18e-11, 1.0e-10) u2 range=(9.9998e-6, 1.0e-5)
  u2: [1.0e-5, 1.0e-5, 1.0e-5, ... 1.0e-5]
RADAR5 RHS (this PR): retcode=Success nsteps=19662 u1 range=(5.06e-11, 1.86e-7) u2 range=(2.83e-7, 1.0e-5)
  u2: [1.0e-5, 4.48e-6, 2.0e-6, 8.96e-7, 4.01e-7, 3.53e-7, 3.11e-7, 3.02e-7, 4.7e-7, 4.13e-7, 3.63e-7, 3.2e-7, 3.09e-7, 4.84e-7, 4.26e-7, 3.74e-7, 3.29e-7, 2.94e-7, 6.21e-7, 4.39e-7, 3.86e-7]

New test fails without the fix (GROUP=Core, lib/DDEProblemLibrary, Julia 1.11):

RADAR5 Oregonator right-hand side: Test Failed at .../lib/DDEProblemLibrary/test/radar5.jl:16
  Expression: ≈(du, expected, rtol = 1.0e-12)
   Evaluated: [-8.69948e-5, -8.69628e-5] ≈ [-8.58692e-5, -8.69628e-5] (rtol=1.0e-12)
ERROR: LoadError: Some tests did not pass: 0 passed, 1 failed, 0 errored, 0 broken.

and passes with it:

Test Summary: | Pass  Total  Time
Load Tests    |    1      1  0.1s
Test Summary: | Pass  Total  Time
RADAR5        |    1      1  4.0s
     Testing DDEProblemLibrary tests passed

GROUP=QA: Aqua | 20 20, passed. Runic --check and typos clean on changed files.

Not verified

Julia lts/pre not run locally (only 1.11). The problem's solution changes, so any downstream results that use prob_dde_RADAR5_oregonator (SciMLBenchmarks StiffDDE/Oregonator_wpd) change with this release.

🤖 Generated with Claude Code (model: claude-opus-5-5[1m])

https://claude.ai/code/session_01Vrsu4PESdABpNaxYiTBVfd

RADAR5-V2.1/OREGONATOR/dr-oregon.f has F(1) = +kM1*A*Y(2) - ..., but
prob_dde_RADAR5_oregonator shared `a = -k1*A*u2 - k2*u1*v` between both
components, flipping the sign of the first term in du[1]. With the wrong
sign u1 decays to zero and the solution stays flat at u2 = 1e-5 instead of
oscillating. Fix the RHS and docstring, add a test against the RADAR5 FCN.

Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Agent-Harness: Claude Code 2.1.280
Agent-Model: claude-opus-5-5[1m]
Agent-Session: https://claude.ai/code/session_01Vrsu4PESdABpNaxYiTBVfd
Claude-Session: https://claude.ai/code/session_01Vrsu4PESdABpNaxYiTBVfd
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