Skip to content

feat: accept array equations on the NonlinearProblem path - #5049

Draft
utkuyilmaz1903 wants to merge 3 commits into
SciML:masterfrom
utkuyilmaz1903:feature/array-nonlinear-systems
Draft

feat: accept array equations on the NonlinearProblem path#5049
utkuyilmaz1903 wants to merge 3 commits into
SciML:masterfrom
utkuyilmaz1903:feature/array-nonlinear-systems

Conversation

@utkuyilmaz1903

@utkuyilmaz1903 utkuyilmaz1903 commented Aug 30, 2026

Copy link
Copy Markdown
Member

Summary

  • Accept unscalarized array equations in NonlinearProblem and NonlinearLeastSquaresProblem after complete when unknowns are scalar.
  • Assemble mixed scalar and array equations into one residual, with one row per array element.
  • Preserve out-of-place ForwardDiff.Dual values from unknowns and tunable parameters.
  • Expand array derivatives before steady-state conversion.
  • Preserve FunctionWrapperSpecialize and non-square residual prototypes.

Constraints

  • Array unknowns remain unsupported.
  • Array residuals require mtkcompile before using jac = true or sparse = true.
  • The out-of-place allocator is restricted to nonlinear codegen. DAEProblem{false} Dual promotion is outside this PR.

Tests

  • 1D and 2D array equations
  • Mixed scalar and array equations
  • In-place, out-of-place, expression, and specialization paths
  • Non-square least-squares residuals
  • Unknown and parameter AD
  • Constant-size generated code up to n = 101
  • Existing feat: accept array equations on the implicit-DAE path #4983 DAE regression suite

Compat

  • New tests import unwrap from Symbolics so they run on older Symbolics.
  • DiffEqBase floor is 7.18.1 so downgrade CI accepts already-unwrapped parameters in nested AutoDespecialize.

Related: SciML/MethodOfLines.jl#623.

Import unwrap explicitly in the new NL tests and raise the DiffEqBase floor so nested AutoDespecialize accepts already-unwrapped parameters.
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.

1 participant