SciML / DiffEqNoiseProcess.jl

A library of noise processes for stochastic systems like stochastic differential equations (SDEs) and other systems that are present in scientific machine learning (SciML)
https://docs.sciml.ai/DiffEqNoiseProcess/stable/
Other
63 stars 29 forks source link

add `reinit!` specialized to NoiseWrapper #122

Closed rmsrosa closed 1 year ago

rmsrosa commented 1 year ago

This should fix #121 , which was reported on Slack.

Currently, NoiseWrapper has no specialized reinit! method and falls back to the general one for AbstractNoiseProcess, which only sets W.curW for a NoiseGrid, otherwise W.curW is left unchanged. So, when solving it twice, W.curW starts the second run with a value equal to the last value of the previous run.

This PR adds a specialized reinit! for NoiseWrapper that takes care of that.

I could have checked for a NoiseWrapper inside the reinit of AbstractNoiseProcess, but I though a separate reinit! would be cleaner.