Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Translate Particle problem to EnsembleProblem #942

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

baggepinnen
Copy link
Contributor

This PR adds WIP functionality that automatically translates an ODEPRoblem{<:Particles} into an EnsembleProblem, solves the ensemble problem, and finally repackages the solution into an ODESolution with Particles.

This is an attempt at making MCM work with DAEs and other things that might be thrown off by the uncertain numbers.

The PR is WIP, I am quite unsure about how to create the final ODESolution{Particles}. The current state of the PR kind-of works in some cases but not in others. There might also be problems in the interaction between the plotting recipe for Particles and that for ODESolution, if I plot a single state-variable only, it works fine, but when plotting multiple idxs at the same time I get a garbage plot.

Any initial comments on what I might be doing wrong when I create the solution below is appreciated.


# [state_index][mc_index]
utraj = map(t) do t
data = reduce(hcat, OrdinaryDiffEq.EnsembleAnalysis.componentwise_vectors_timepoint(esol,t)) # nmc × nx
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
data = reduce(hcat, OrdinaryDiffEq.EnsembleAnalysis.componentwise_vectors_timepoint(esol,t)) # nmc × nx
data = reduce(hcat, SciMLBase.EnsembleAnalysis.componentwise_vectors_timepoint(esol,t)) # nmc × nx

@ChrisRackauckas
Copy link
Member

In principle this looks fine, though it should probably go to SciMLBase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants