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

Parallel Ensemble Simulations: Example of a new problem type? #419

Open
npbarnes opened this issue Nov 9, 2020 · 1 comment
Open

Parallel Ensemble Simulations: Example of a new problem type? #419

npbarnes opened this issue Nov 9, 2020 · 1 comment

Comments

@npbarnes
Copy link

npbarnes commented Nov 9, 2020

After describing the arguments to EnsembleProblem there are two examples of for prob_func. Here's the exact quote:

One can specify a function prob_func which changes the problem. For example:

function prob_func(prob,i,repeat)
  @. prob.u0 = randn()*prob.u0
  prob
end

modifies the initial condition for all of the problems by a standard normal
random number (a different random number per simulation). Notice that since
problem types are immutable, it uses .=. Otherwise, one can just create
a new problem type:

function prob_func(prob,i,repeat)
  @. prob.u0 = u0_arr[i]
  prob
end

The first example demonstrates calculating a new random initial value and inserting it into the existing problem using .=. Nothing wrong with that. The second example is exactly the same except it uses the index i to index a pre-computed array. That's fine, but it doesn't seem to be what the text above it is talking about. Shouldn't the second example demonstrate creating a new problem? E.g.:

function prob_func(prob, i, repeat)
  ODEProblem(.....)
end
@ChrisRackauckas
Copy link
Member

It should probably demonstrate remake.

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

No branches or pull requests

2 participants