Custom Problem

MCBB.CustomProblemType
CustomProblem

Structure that emulates some of the fields/behaviour of DEProblem subtypes from DifferentialEquations. The results are supposed to be a (Ndim x Nt)-array.

Fields:

  • f: Problem function, signature: (u0, p, tspan) -> results
  • u0::AbstractArray: Initial conditions
  • p: Parameters
  • tspan: Time Span
source
DiffEqBase.solveMethod
solve(prob::CustomProblem)

Solves/runs the system/experiment with the initial conditions and parameters that were set during construction of prob.

source
MCBB.CustomSolutionType
CustomSolution

Solution type of CustomProblem. Contains the solution as an abstract array and the problem. Can be index like an array.

Fields:

  • sol::AbstractArray: Solution as an Array (1d (N_t-long Array) or 2d (N_dim x N_ts)-sized Array)
  • prob::CustomProblem: Problem that was solved to get the solution
source
DiffEqBase.solveMethod
solve(prob::CustomMonteCarloProblem; num_monte::Int=100)

Solves the CustomMonteCarloProblem num_monte-times.

TO-DO: parallelization!!!!

source
MCBB.CustomMonteCarloProblemType
CustomMonteCarloProblem

Structure similar to DifferentialEquations's MonteCarloProblem but for problems that can not be solved with DifferentialEquations. The fields emululate those of EnsembleProblem:

  • prob::CustomProblem: The base problem that should be solved
  • prob_func::Function: same as for EnsembleProblem: A function (prob, i, repeat) -> new_problem that returns the i-th problem that should be solved
  • eval_func::Function: same as for EnsembleProblem: A function (sol, i) -> (results, repeat) that evaluated the i-th solution
source
MCBB.CustomMCBBProblemType
CustomMCBBProblem <: MCBBProblem

Structure similar to DEMCBBProblem but for problems that can not be solved with DifferentialEquations as a backend.

Note that its supertypes are MCBBProblem and myMCProblem, but not any of the DifferentialEquations abstract problem types. Many functions that work on DEMCBBProblem work on CustomMCBBProblem as well as they are defined for MCBBProblem.

The struct has the following fields:

  • p: CustomMonteCarloProblem to be solved, part of DifferentialEquations
  • N_mc: Number of (Monte Carlo) runs to be solved
  • rel_transient_time: Only after this time (relative to the total integration time) the solutions are evaluated
  • ic: ($N_{mc} \times N_{dim_{ic}}$)-Matrix containing initial conditions for each run.
  • par: ($N_{mc} \times N_{par}$)-Matrix containing parameter values for each run.
  • par_var: ParameterVar, information about how the parameters are varied, see ParameterVar

Constructors

It has the same constructors as DEMCBBProblem just with a CustomProblem instead of an DEProblem.

source
MCBB.CustomMCBBSolutionType
CustomMCBBSolution <: MCBBSol

Type that stores the solutions of a CustomMCBBProblem. Is returned by the corresponding solve routine.

Its fields are:

  • sol: solution of the CustomMonteCarloProblem
  • N_mc: number of solutions saved / Monte Carlo trials runs
  • N_t: number of time steps for each solutions
  • N_dim: sytem dimension
  • N_meas: number of measures used, ``N{meas} = N{meas{dim}} + N{meas_{global}}
  • N_meas_dim: number of measures that are evalauted for every dimension seperatly
  • N_meas_global: number of measures that are evalauted globally
  • N_meas_matrix: number of measures that are evalauted globally and return matrices
  • solve_command: A function that solves one individual run/trial with the same settings as where used to, for the CustomProblem type this is trivial (its the field f) but this field is here so that CustomMCBBSolution is compatible with DEMCBBSol

Note, in case N_dim==1 => N_meas_global == 0 and N_meas_dim == N_meas

source
LinearAlgebra.normalizeMethod
normalize(sol::CustomMCBBSolution, k::AbstractArray)

Returns a copy of sol with the solutions normalized to be in range [0,1]. It is possible to only select that some of the measures are normalized by providing an array with the indices of the measures that should be normalized, e.g. [1,2] for measure 1 and measure 2 to be normalized.

normalize(sol::DEMCBBSol)

If no extra array is provided, all measures are normalized.

source