Hello everyone! I’m still fairly new to Julia and programming in general. I’ve been following the tutorial in the Catalyst.jl documentation for bifurcation diagrams, and I’ve run into an issue. My code (which is copied from the documentation) is as follows:
using Catalyst
rn = @reaction_network begin
(v0+v*(S*X)^n/((S*X)^n+(D*A)^n+K^n),d), ∅ ↔ X
(τ*X,τ), ∅ ↔ A
end S D τ v0 v K n d
odefun = ODEFunction(convert(ODESystem,rn),jac=true)
F = (u,p) -> odefun(u,p,0)
J = (u,p) -> odefun.jac(u,p,0)
params = [1.,9.,0.001,0.01,2.,20.,3,0.05]
p_idx = 1 # The index of the bifurcation parameter.
p_span = (0.1,20.) # The parameter range for the bifurcation diagram.
plot_var_idx = 1 # The index of the variable we plot in the bifurcation diagram.
using BifurcationKit, Plots, LinearAlgebra, Setfield
opts = ContinuationPar( dsmax = 0.05, # Maximum arclength value of the pseudo-arc length continuation method.
dsmin = 1e-4, # Minimum arclength value of the pseudo-arc length continuation method.
ds=0.001, # Initial arclength value of the pseudo-arc length continuation method (should be positive).
maxSteps = 100000, # The maximum number of steps.
pMin = p_span[1], # Minimum p-vale (if hit, the method stops).
pMax = p_span[2], # Maximum p-vale (if hit, the method stops).
detectBifurcation=3, # Value in {0,1,2,3} determening to what extent bofurcation points are detected (0 means nothing is done, 3 both them and there localisation are detected).
newtonOptions = NewtonPar(tol = 1e-9, verbose = false, maxIter = 15)) #Parameters to the newton solver (when finding fixed points) see BifurcationKit documentation.
DO = DeflationOperator( 2, # Algorithm parameter required when using deflated continuation, see BifurcationKit documentation.
dot, # Algorithm parameter required when using deflated continuation, see BifurcationKit documentation.
1, # Algorithm parameter required when using deflated continuation, see BifurcationKit documentation.
[fill(0.,length(rn.states))]); # Guess(es) of the fixed point for the initial parameter set. Do not need to be exact.
params_input = setindex!(copy(params),p_span[1],p_idx) # The input parameter values have to start at the first index of our parameter span.
branches, = continuation(F, J, params_input, (@lens _[p_idx]) ,opts , DO, # Gives our input.
verbosity = 0, showplot=false, # We do not want to display, or plot, intermediary results.
recordFromSolution = (x, p) -> x[plot_var_idx], # How we wish to print the output in the diagram. Here we simply want the value of the target varriable.
perturbSolution = (x,p,id) -> (x .+ 0.8 .* rand(length(x))), # Parameter for the continuation method, see BifurcationKit documentation.
callbackN = (x, f, J, res, iteration, itlinear, options; kwargs...) -> res <1e7) # Parameter for the continuation method, see BifurcationKit documentation.
The last snippet is throwing this error, and I’m unsure as to why:
MethodError: no method matching continuation(::var"#1#2", ::var"#3#4", ::Vector{Float64}, ::Setfield.IndexLens{Tuple{Int64}}, ::ContinuationPar{Float64, DefaultLS, DefaultEig{typeof(real)}}, ::DeflationOperator{Int64, typeof(dot), Vector{Float64}}; verbosity=0, showplot=false, recordFromSolution=var"#5#9"(), perturbSolution=var"#6#10"(), callbackN=var"#7#11"())
Closest candidates are:
continuation(::Any, ::Any, ::Any, ::Lens, ::ContinuationPar, ::DeflationOperator; verbosity, maxBranches, seekEveryStep, maxIterDefOp, showplot, tangentAlgo, linearAlgo, dotPALC, 452, printSolution, plotSolution, 455, perturbSolution, callbackN, acceptSolution, updateDeflationOp, normN) at C:\Users\Nikith Kurella\.julia\packages\BifurcationKit\Yvq7p\src\DeflatedContinuation.jl:103 got unsupported keyword argument "recordFromSolution"
continuation(::Any, ::Any, ::Any, ::Lens, ::ContinuationPar; kwargs...) at C:\Users\Nikith Kurella\.julia\packages\BifurcationKit\Yvq7p\src\Continuation.jl:594
continuation(::Any, ::Any, ::Any, ::Any, ::Lens, ::ContinuationPar; linearAlgo, kwargs...) at C:\Users\Nikith Kurella\.julia\packages\BifurcationKit\Yvq7p\src\Continuation.jl:577
...
Stacktrace:
[1] kwerr(::NamedTuple{(:verbosity, :showplot, :recordFromSolution, :perturbSolution, :callbackN), Tuple{Int64, Bool, var"#5#9", var"#6#10", var"#7#11"}}, ::Function, ::Function, ::Function, ::Vector{Float64}, ::Setfield.IndexLens{Tuple{Int64}}, ::ContinuationPar{Float64, DefaultLS, DefaultEig{typeof(real)}}, ::DeflationOperator{Int64, typeof(dot), Vector{Float64}})
@ Base .\error.jl:163
[2] top-level scope
@ In[8]:2
[3] eval
@ .\boot.jl:373 [inlined]
[4] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base .\loading.jl:1196
Any help would be much appreciated!