Skip to content

Give components added by addat! a value - #5000

Open
ramlakhanmadheshiya wants to merge 2 commits into
SciML:masterfrom
ramlakhanmadheshiya:ram/addat-append-value
Open

ramlakhanmadheshiya wants to merge 2 commits into
SciML:masterfrom
ramlakhanmadheshiya:ram/addat-append-value

Conversation

@ramlakhanmadheshiya

Copy link
Copy Markdown
Contributor

New components from addat! start at val (default zero) in u and the step history.
idxs must be the next indices, since the state buffers only append.
The default solver now resizes its stiff sub-caches too.

using StochasticDiffEq
f!(du, u, p, t) = (du .= -0.5 .* u; nothing)
g!(du, u, p, t) = (du .= 0.1 .* u; nothing)
integ = init(SDEProblem(f!, g!, [1.0, 2.0], (0.0, 1.0)), EM(); dt = 1 / 64, seed = 1)
addat!(integ, 3:3, [1.0])
solve!(integ)
integ.u[3]  # 0.7600697513197398

Fixes #4828

@ramlakhanmadheshiya
ramlakhanmadheshiya marked this pull request as ready for review November 14, 2026 13:30

This branch has not been deployed

No deployments
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.

addat!(integrator, idxs, val) is documented but unimplemented; addat!(integrator, idxs) leaves new state uninitialized

1 participant