ContinuationProblem
MCBB.ContinuationProblem
— TypeContinuationProblem <: myMCProblem
Introduces a Problem type for Bifurcation analysis. It sets up a DEProblem, solves it, then changes a parameter and sets the endpoint of the previous to be IC of a new problem. Repeats for a specified amount of times
Constructor
ContinuationProblem(p::DiffEqBase.DEProblem, par_range::ParameterVar, N::Int64, eval_func::Function, ic_bounds::AbstractArray=[-Inf,Inf],par_bounds::AbstractArray=[-Inf,Inf], hard_bounds::Bool=false)
p
: Base DifferentialEquations Problempar_range
: Description of how the parameter should be changed,ParameterVar
OR a tuple of (First: name of the parameter as a symbol, Second: AbstractArray or Function that contains all parameters for the experiment or a function that generates parameter values. The function has to be format(oldvalue) -> (newvalue)
, Third: OPTIONAL: a function that maps(old_parameter_instance; (par_range[1],new_parameter_value)) -> new_parameter_instance
. Default is 'reconstruct' from @with_kw/Parameters.jl is used)N
: OPTIONAL, Only needed if parameter variation is given a function to generate new parameter values. If so,N
is the total number of parameters and thus DEProblems to be solvedeval_ode_run
: function, same as forEnsembleProblems
ic_bounds
: Bounds for the IC that should not be exceededpar_bounds
: Bounds for the parameter that should not be exceededhard_bounds
: If a bound is reached: if true, stops the iteration, false continous with (upper/lower bound as IC)
Fields of the struct are the same as the arguments of the constructor.
MCBB.ContinuationSolution
— TypeContinuationSolution <: myMCSol
Solution object that is returned by solve(prob::ContinuationProblem,...)
.
Fields are:
sol
: Array of Arrays, analogously toEnsembleSolution
par
: Array, parameters of all runsN_mc
: Number of runs / DEProblems solvedN_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 seperatlyN_meas_global
: number of measures that are evalauted globallyN_meas_matrix
: number of measures that return matrices.
MCBB.compute_parameters
— Functioncompute_parameters(p::DiffEqBase.DEProblem , par_range::OneDimParameterVar, N::Integer)
Computes the parameters that are used for the calculation and returns them as an array.
DiffEqBase.solve
— Function solve(prob::ContinuationProblem, N_t=400::Int, rel_transient_time::Float64=0.9; return_probs::Bool=false, reltol::Float64=1e-9, cyclic_ic::Bool=false, kwargs...)
Custom solve for the ContinuationProblem. Saves and evaluates only after transient at a constant step size.
N_t
- Int, Number of timesteps of each solution of a DEProblemrel_transient_time
- Percentage of time after which the solutions are evaluatedreturn_probs
- if 'true' returns a array of DEProblems that were solvedreltol
- relative tolerance of the solver.Eespacially for systems with constantly growing variables such as certain phase oscilattors the tolerence has to be very smallcyclic_ic
- if true the initial conditions are always within $[-\pi,\pi]$