File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -210,10 +210,13 @@ function DiffEqBase.__init(
210210 end
211211 rateType = typeof (rate_prototype) # # Can be different if united
212212
213- if prob. f isa DynamicalSDEFunction
214- noise_rate_prototype = rate_prototype. x[1 ]
215- elseif is_diagonal_noise (prob)
216- noise_rate_prototype = rate_prototype
213+
214+ if is_diagonal_noise (prob)
215+ if prob. f isa DynamicalSDEFunction
216+ noise_rate_prototype = rate_prototype. x[1 ]
217+ else
218+ noise_rate_prototype = rate_prototype
219+ end
217220 elseif prob isa DiffEqBase. AbstractRODEProblem
218221 if prob isa DiffEqBase. AbstractSDEProblem
219222 noise_rate_prototype = copy (prob. noise_rate_prototype)
@@ -287,7 +290,7 @@ function DiffEqBase.__init(
287290 else
288291 randElType = uBottomEltypeNoUnits # Strip units and type info
289292 if prob. f isa DynamicalSDEFunction
290- rand_prototype = copy (noise_rate_prototype)
293+ rand_prototype = copy (rate_prototype . x[ 1 ]) # Noise is a vector of the same size than the number of variables
291294 elseif is_diagonal_noise (prob)
292295 if typeof (u) <: SArray
293296 rand_prototype = zero (u) # TODO : Array{randElType} for units
You can’t perform that action at this time.
0 commit comments