Application Programming Interface

QuantizedSystemSolver.NLodeProblemMethod

NLodeProblem(odeExprs) This function parses the user code to dispatches on a specific problem construction. It returns a Problem object to be passed to the solve function.

source
QuantizedSystemSolver.solveMethod

solve(prob::NLODEProblem{PRTYPE,T,Z,D,CS},al::QSSAlgorithm{SolverType, OrderType},tspan::Tuple{Float64, Float64};sparsity::Val{Sparsity}=Val(false),saveat=1e-9::Float64,abstol=1e-4::Float64,reltol=1e-3::Float64,maxErr=Inf::Float64,maxStepsAllowed=10000000) where{PRTYPE,T,Z,D,CS,SolverType,OrderType,Sparsity}

This function dispatches on a specific integrator based on the algorithm provided. With the exception of the argument prob and tspan, all other arguments are optional and have default values:

-The algorithm defaults to nmliqss2, and it is specified by the QSSAlgorithm type, which is a composite type that has a name and an order. It can be extended independently of the solver.

-The sparsity argument defaults to false. If true, the integrator will use a sparse representation of the Jacobian matrix (not implemented).

-The saveat argument defaults to 1e-9. It specifies the time step at which the integrator will save the solution (not implemented).

-The abstol argument defaults to 1e-4. It specifies the absolute tolerance of the integrator.

-The reltol argument defaults to 1e-3. It specifies the relative tolerance of the integrator.

-The maxErr argument defaults to Inf. It specifies the maximum error allowed by the integrator. This is used as an upper bound for the quantum when a variable goes large.

-The maxStepsAllowed argument defaults to 10000000. It specifies the maximum number of steps allowed by the integrator. If the user wants to extend the limit on the maximum number of steps, this argument can be used.

After the simulation, the solution is returned as a Solution object.

source
QuantizedSystemSolver.plot_SolMethod

plot_Sol(sol::Sol{T,O},xvars::Int...;note=" "::String,xlims=(0.0,0.0)::Tuple{Float64, Float64},ylims=(0.0,0.0)::Tuple{Float64, Float64},legend=:true::Bool,marker=:circle::Symbol) where{T,O}

This function generates a plot of the solution of the system (returned as a plot object). With the exception of the solution object, all arguments are optional. The default values are:

  • note = " "

  • xlims = (0.0,0.0)

  • ylims = (0.0,0.0)

  • legend = true

  • marker=:circle

source
QuantizedSystemSolver.save_SolMethod

save_Sol(sol::Sol{T,O},xvars::Int...;note=" "::String,xlims=(0.0,0.0)::Tuple{Float64, Float64},ylims=(0.0,0.0)::Tuple{Float64, Float64},legend=:true::Bool) where{T,O}

Save the plot of the system solution for the variables xvars. With the exception of the solution object, all arguments are optional. The default values are:

  • note = " "

  • xlims = (0.0,0.0)

  • ylims = (0.0,0.0)

  • legend = true

source
QuantizedSystemSolver.getErrorMethod

getError(sol::Sol{T,O},index::Int,f::Function) where{T,O}

This function calculates the relative error of the solution with respect to a reference function.

source
QuantizedSystemSolver.getAverageErrorByRefsMethod

getAverageErrorByRefs(sol::Sol{T,O},solRef::Vector{Any}) where{T,O}

This function calculates the average relative error of the solution with respect to a reference solution. The relative error is calculated for each variable, and then it is averaged over all variables.

source