Skip to content

SDESystem composition #983

@thevolatilebit

Description

@thevolatilebit

Composing two SDESystems and trying to solve the resulting SDEProblem makes Julia complain LoadError: This solver is not able to use mass matrices.

A minimal example follows:

using ModelingToolkit, DifferentialEquations
@variables t
D = Differential(t)

f = sym -> begin
    @variables first(t) second(t) third(t)
    @parameters coeff
    eqs = [D(first) ~ first, D(second) ~ second]
    noiseeqs = [0.2*coeff, 0]
    SDESystem(eqs, noiseeqs, t, [first, second, third], [coeff]; name=sym, defaults=Dict(first=>2, second=>3, third=>1, coeff=>1))
end

sys1 = f(:prob1); sys2 = f(:prob2)
sys =  SDESystem([D(sys1.third)~2, D(sys2.third)~1], [], t, [], []; systems=[sys1, sys2])
prob = SDEProblem(sys, [], (0,1), [])

solve(prob)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions