Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve computation of residuals #124

Merged
merged 1 commit into from
Dec 21, 2018
Merged

Improve computation of residuals #124

merged 1 commit into from
Dec 21, 2018

Conversation

devmotion
Copy link
Member

This PR changes the computation of residuals to a slight modification of the implementation in OrdinaryDiffEq (see SciML/OrdinaryDiffEq.jl#574). Moreover, it adds adaptivity parameter delta (see http://docs.juliadiffeq.org/latest/solvers/sde_solve.html#Special-Keyword-Arguments-1) to all adaptive algorithms.

This PR fixes #123, the example

using StochasticDiffEq

f(u,p,t) = 0.4.*u
g(u,p,t) = 0.0.*u
u0 = [1., 1.]
prob = SDEProblem(f,g,u0,(0.0,1.0))
solve(prob, SKenCarp())

works now.

Additionally the PR fixes similar errors for algorithms SRA, SRA1, and SRA2 that were mentioned in SciML/DifferentialEquations.jl#401 (comment), the example

using StochasticDiffEq, DiffEqNoiseProcess

function numerical_sol(solver)
    f(u,p,t) = u
    g(u,p,t) = u
    u₀=[1.0im 2.0im; 3.0im 4.0im]
    W = WienerProcess(0., 0., 0.)
    tspan = (0.0, 1.0)
    prob = SDEProblem(f, g, u₀, tspan, noise=W)
    solve(prob, solver)
end

doesn't fail anymore for these algorithms.

@ChrisRackauckas ChrisRackauckas merged commit e35ca14 into master Dec 21, 2018
@devmotion devmotion deleted the residuals branch December 21, 2018 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants