diff --git a/src/caches/dynamical_caches.jl b/src/caches/dynamical_caches.jl index 22dae0ce..5980526f 100644 --- a/src/caches/dynamical_caches.jl +++ b/src/caches/dynamical_caches.jl @@ -20,7 +20,7 @@ end function alg_cache(alg::BAOAB,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototype,jump_rate_prototype,::Type{uEltypeNoUnits},::Type{uBottomEltypeNoUnits},::Type{tTypeNoUnits},uprev,f,t,dt,::Type{Val{false}}) where {uEltypeNoUnits,uBottomEltypeNoUnits,tTypeNoUnits} k = zero(rate_prototype.x[1]) c1 = exp(-alg.gamma*dt) - c2 = sqrt(1 - alg.scale_noise*c1^2) # if scale_noise == false, c2 = 1 + c2 = alg.scale_noise ? sqrt((1 - c1^2)/abs(dt)) : 1 # if scale_noise == false, c2 = 1 BAOABConstantCache(k, uEltypeNoUnits(1//2), uEltypeNoUnits(c1), uEltypeNoUnits(c2)) end @@ -34,7 +34,7 @@ function alg_cache(alg::BAOAB,prob,u,ΔW,ΔZ,p,rate_prototype,noise_rate_prototy half = uEltypeNoUnits(1//2) c1 = exp(-alg.gamma*dt) - c2 = sqrt(1 - alg.scale_noise*c1^2) # if scale_noise == false, c2 = 1 + c2 = alg.scale_noise ? sqrt((1 - c1^2)/abs(dt)) : 1 # if scale_noise == false, c2 = 1 tmp = zero(u) diff --git a/src/perform_step/dynamical.jl b/src/perform_step/dynamical.jl index 074cbc7d..68c2d1fa 100644 --- a/src/perform_step/dynamical.jl +++ b/src/perform_step/dynamical.jl @@ -42,7 +42,7 @@ end u2 = u1 + half*dt*du2 # O - noise = integrator.g(u2,p,t+dt*half).*W.dW / sqdt + noise = integrator.g(u2,p,t+dt*half).*W.dW du3 = c1*du2 + c2*noise # A @@ -69,7 +69,7 @@ end # O integrator.g(gtmp,utmp,p,t+dt*half) - @.. noise = gtmp*W.dW / sqdt + @.. noise = gtmp*W.dW @.. dutmp = c1*dutmp + c2*noise # A