SciML / ModelingToolkit.jl

An acausal modeling framework for automatically parallelized scientific machine learning (SciML) in Julia. A computer algebra system for integrated symbolics for physics-informed machine learning and automated transformations of differential equations
https://mtk.sciml.ai/dev/
Other
1.38k stars 196 forks source link

fix: infer oop form for SDEProblem/SDEFunction with StaticArrays #2834

Closed AayushSabharwal closed 1 hour ago

AayushSabharwal commented 2 days ago

Close #2814

Checklist

Additional context

Add any other context about the problem here.

AayushSabharwal commented 1 day ago

The problem here is that this line doesn't work with static arrays. K is an SVector{1} whereas L is an SMatrix{1, 1} (since noise is a matrix). I guess that line should have an @..?

julia> [1;;] + [1]
1×1 Matrix{Int64}:
 2
julia> @SArray[1;;] + @SArray[1]
ERROR: DimensionMismatch: Sizes (Size(1, 1), Size(1,)) of input arrays do not match
ChrisRackauckas commented 1 day ago

That's a method only for diagonal noise, so that method won't work on array

AayushSabharwal commented 1 day ago

1x1 noise is diagonal, right? Which I guess is why I guess it hits that

ChrisRackauckas commented 1 day ago

Yeah, what we should do is detect that if isdiagonal then turn it it into a vector so it represents diagonal noise.