Skip to content

Support both symbolic and numeric interface? #37

Description

@hersle

There are advantages and disadvantages of both symbolic and numeric interfaces. It would be nice if SymBoltz could support both.

Maybe something like

struct CosmologyProblem{IsSymbolic}
    bg::ODEProblem
    pt::ODEProblem
    ...
end

struct CosmologySolution{IsSymbolic}
    ...
end

or

struct SymbolicCosmologyProblem
    ...
end

struct NumericCosmologySolution
    ...
end

CosmologyProblem(M::System, ...) = SymbolicCosmologyProblem(...)
CosmologyProblem(fbg::Function, fpt::Function, pars, ...) = NumericCosmologyProblem(...)

Every function (solve, source_grid, spectrum_*, ...) can dispatch on IsSymbolic:

function solve(prob::CosmologyProblem{true}, ...)
    ...
end
function solve(prob::CosmologyProblem{false}, ...)
    ...
end

In other words, the symbolic and numeric CosmologyProblems would both fulfill a common interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions