diff --git a/src/problems.jl b/src/problems.jl index a34ea386c..2900c7c09 100644 --- a/src/problems.jl +++ b/src/problems.jl @@ -1,31 +1,3 @@ -""" -`SDEProblem` - -Wraps the data which defines an SDE problem - -```math -u = f(u,t)dt + Σgᵢ(u,t)dWⁱ -``` - -with initial condition ``u0``. - -### Constructors - -`SDEProblem(f,g,u0;analytic=nothing)` : Defines the SDE with the specified functions and -defines the solution if analytic is given. - -### Fields - -* `f`: The drift function in the SDE. -* `g`: The noise function in the SDE. -* `u0`: The initial condition. -* `analytic`: A function which describes the solution. -* `knownanalytic`: True if the solution is given. -* `numvars`: The number of variables in the system -* `sizeu`: The size of the initial condition (and thus `u`) -* `noise`: The noise process applied to the noise upon generation. - -""" type SDEProblem <: AbstractSDEProblem f::Function g::Function diff --git a/src/sde/sde_solve.jl b/src/sde/sde_solve.jl index 9bd398012..5b65ebc8f 100644 --- a/src/sde/sde_solve.jl +++ b/src/sde/sde_solve.jl @@ -1,41 +1,3 @@ -""" -`solve(prob::SDEProblem,tspan)` - -Solves the SDE as defined by prob on the time interval tspan. If not given, tspan defaults to [0,1]. - -### Keyword Arguments - -* `dt`: Sets the initial stepsize. Defaults to an automatic choice. -* `save_timeseries`: Saves the result at every timeseries_steps steps. Default is true. -* `timeseries_steps`: Denotes how many steps between saving a value for the timeseries. Defaults to 1. -* `adaptive` - Turns on adaptive timestepping for appropriate methods. Default is false. -* `γ` - The risk-factor γ in the q equation for adaptive timestepping. Default is 2. -* `qmax` - Defines the maximum value possible for the adaptive q. Default is 1.125. -* `δ` - The weight-factor in the error estimate. Default is 1/6. -* `ablstol` - Absolute tolerance in adaptive timestepping. Defaults to 1e-3. -* `reltol` - Relative tolerance in adaptive timestepping. Defaults to 1e-6. -* `maxiters` - Maximum number of iterations before stopping. Defaults to 1e9. -* `dtmax` - Maximum dt for adaptive timestepping. Defaults to half the timespan. -* `dtmin` - Minimum dt for adaptive timestepping. Defaults to 1e-10. -* `internalnorm` - The norm for which error estimates are calculated. Default is 2. -* `progressbar` - Turns on/off the Juno progressbar. Defualt is false. -* `progress_steps` - Numbers of steps between updates of the progress bar. Default is 1000. -* `discard_length` - Size at which to discard future information in adaptive. Default is 1e-15. -* `tableau`: The tableau for an `:SRA` or `:SRI` algorithm. Defaults to SRIW1 or SRA1. -* `adaptivealg`: The adaptive timestepping algorithm. Default is `:RSwm3`. -* `alg`: String which defines the solver algorithm. Defult is "SRIW1Optimized". Possibilities are: - - - `:EM`- The Euler-Maruyama method. - - `:RKMil` - An explicit Runge-Kutta discretization of the strong Order 1.0 Milstein method. - - `:SRA` - The strong Order 2.0 methods for additive SDEs due to Rossler. Not yet implemented. - Default tableau is for SRA1. - - `:SRI` - The strong Order 1.5 methods for diagonal/scalar SDEs due to Rossler. - Default tableau is for SRIW1. - - `:SRIW1Optimized` - An optimized version of SRIW1. Strong Order 1.5. - - `:SRA1Optimized` - An optimized version of SRIA1. Strong Order 2.0. - - `:SRAVectorized` - A vectorized implementation of SRA algorithms. Requires 1-dimensional problem. - - `:SRIVectorized` - A vectorized implementation of SRI algorithms. Requires 1-dimensional problem. -""" function solve(prob::AbstractSDEProblem,tspan::AbstractArray=[0,1];dt::Number=0.0,save_timeseries::Bool = true, timeseries_steps::Int = 1,alg=nothing,adaptive=false,γ=2.0,alg_hint=nothing, abstol=1e-3,reltol=1e-6,qmax=1.125,δ=1/6,maxiters::Int = round(Int,1e9),