Skip to content

expectation() should use p and u0 from ODEProblem #44

@owiecc

Description

@owiecc

What is the rationale behind having to explicitly pass the initial conditions and parameters to expectation function if these can be embedded into the ODEProblem?

function expectation(g::Function, prob::ODEProblem, u0, p, expalg::Koopman, args...)

This makes the code a bit strange as I can have double definitions of initial conditions and one seems to be ignored.

f(u,p,t) = p.*u

u0 = [-666.666]
u0_dist = [truncated(Normal(3.0,2.0),3-1000,3+1000)]

p = [-0.3]
tspan = (0.0,10.0)
prob = ODEProblem(f,u0,tspan,p)

expectation(f -> f(1.0), prob, u0_dist, p, Koopman(), Tsit5())

Wouldn't this be enough or am I missing something?

prob = ODEProblem(f,u0_dist,tspan,p)
expectation(f -> f(1.0), prob, Koopman(), Tsit5())

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