# Error with Catalyst.jl bifurcation diagram tutorial

**URL:** <https://discourse.julialang.org/t/error-with-catalyst-jl-bifurcation-diagram-tutorial/79202>\
**Category:** New to Julia\
**Tags:** question, package\
**Created:** [April 8, 2022, 1:37am UTC](https://discourse.julialang.org/t/error-with-catalyst-jl-bifurcation-diagram-tutorial/79202 "2022-04-08T01:37:28Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dragolonth](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@Dragolonth](https://discourse.julialang.org/u/Dragolonth)\
**Post date:** [April 8, 2022, 1:37am UTC](https://discourse.julialang.org/t/error-with-catalyst-jl-bifurcation-diagram-tutorial/79202/1 "2022-04-08T01:37:28Z")

</div>

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:

```julia
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

```

```julia
odefun = ODEFunction(convert(ODESystem,rn),jac=true)
F = (u,p) -> odefun(u,p,0)      
J = (u,p) -> odefun.jac(u,p,0)

```

```julia
params = [1.,9.,0.001,0.01,2.,20.,3,0.05]

```

```julia
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.

```

```julia
using BifurcationKit, Plots, LinearAlgebra, Setfield

```

```julia
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.

```

```julia
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:

```julia
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!

---

<div class="post-metadata">

**Author:** ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Post date:** [April 8, 2022, 5:53am UTC](https://discourse.julialang.org/t/error-with-catalyst-jl-bifurcation-diagram-tutorial/79202/2 "2022-04-08T05:53:38Z")

</div>

Hi,

can you give the link from which you copied this?

---

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [April 8, 2022, 9:15am UTC](https://discourse.julialang.org/t/error-with-catalyst-jl-bifurcation-diagram-tutorial/79202/3 "2022-04-08T09:15:09Z")

</div>

It is from here: [Bifurcation Diagrams · Catalyst.jl](https://catalyst.sciml.ai/stable/tutorials/bifurcation_diagram/)  
@rveltz I will have a look at it and try to fix it, will drop a note here if I run into trouble.

---

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [April 8, 2022, 9:47am UTC](https://discourse.julialang.org/t/error-with-catalyst-jl-bifurcation-diagram-tutorial/79202/4 "2022-04-08T09:47:57Z")

</div>

Ok, the first issue is the option `showplot` is used instead of `plot`. However, after changing that, there’s still an error:

```julia
MethodError: no method matching (::var"#7#11")(::NamedTuple{(:x, :f, :nothing, :res, :it, :options, :x0, :resHist), Tuple{Vector{Float64}, Vector{Float64}, Nothing, Float64, Int64, NewtonPar{Float64, DefaultLS, DefaultEig{typeof(real)}}, Vector{Float64}, Vector{Float64}}}; fromNewton=true, iterationC=0, p=0.1)
Closest candidates are:
  (::var"#7#11")(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any; kwargs...) at In[7]:6

Stacktrace:
 [1] newton(Fhandle::var"#1#2", Jhandle::var"#3#4", x0::Vector{Float64}, p0::Vector{Float64}, options::NewtonPar{Float64, DefaultLS, DefaultEig{typeof(real)}}; normN::typeof(norm), callback::Function, kwargs::Base.Pairs{Symbol, Real, Tuple{Symbol, Symbol}, NamedTuple{(:iterationC, :p), Tuple{Int64, Float64}}})
   @ BifurcationKit ~/.julia/packages/BifurcationKit/eoTLY/src/Newton.jl:117
 [2] iterate(it::ContIterable{var"#1#2", var"#3#4", Vector{Float64}, Vector{Float64}, Setfield.IndexLens{Tuple{Int64}}, Float64, DefaultLS, DefaultEig{typeof(real)}, SecantPred, BorderingBLS{DefaultLS, Float64}, BifurcationKit.var"#587#603"{BifurcationKit.var"#587#588#604"}, var"#5#9", typeof(norm), BifurcationKit.DotTheta{BifurcationKit.var"#169#171", BifurcationKit.var"#170#172"}, typeof(BifurcationKit.finaliseDefault), var"#7#11", Nothing, Nothing}; _verbosity::Int64)
   @ BifurcationKit ~/.julia/packages/BifurcationKit/eoTLY/src/Continuation.jl:276
 [3] iterate
   @ ~/.julia/packages/BifurcationKit/eoTLY/src/Continuation.jl:259 [inlined]
 [4] getStatesContResults(iter::BifurcationKit.DefContIterable{ContIterable{var"#1#2", var"#3#4", Vector{Float64}, Vector{Float64}, Setfield.IndexLens{Tuple{Int64}}, Float64, DefaultLS, DefaultEig{typeof(real)}, SecantPred, BorderingBLS{DefaultLS, Float64}, BifurcationKit.var"#587#603"{BifurcationKit.var"#587#588#604"}, var"#5#9", typeof(norm), BifurcationKit.DotTheta{BifurcationKit.var"#169#171", BifurcationKit.var"#170#172"}, typeof(BifurcationKit.finaliseDefault), var"#7#11", Nothing, Nothing}, var"#6#10", BifurcationKit.var"#592#608", BifurcationKit.var"#593#609"}, roots::Vector{Vector{Float64}})
   @ BifurcationKit ~/.julia/packages/BifurcationKit/eoTLY/src/DeflatedContinuation.jl:73
 [5] deflatedContinuation(iter::BifurcationKit.DefContIterable{ContIterable{var"#1#2", var"#3#4", Vector{Float64}, Vector{Float64}, Setfield.IndexLens{Tuple{Int64}}, Float64, DefaultLS, DefaultEig{typeof(real)}, SecantPred, BorderingBLS{DefaultLS, Float64}, BifurcationKit.var"#587#603"{BifurcationKit.var"#587#588#604"}, var"#5#9", typeof(norm), BifurcationKit.DotTheta{BifurcationKit.var"#169#171", BifurcationKit.var"#170#172"}, typeof(BifurcationKit.finaliseDefault), var"#7#11", Nothing, Nothing}, var"#6#10", BifurcationKit.var"#592#608", BifurcationKit.var"#593#609"}, deflationOp::DeflationOperator{Int64, typeof(dot), Float64, Vector{Float64}}, contParams::ContinuationPar{Float64, DefaultLS, DefaultEig{typeof(real)}}, verbosity::Int64, plot::Bool)
   @ BifurcationKit ~/.julia/packages/BifurcationKit/eoTLY/src/DeflatedContinuation.jl:170
 [6] continuation(F::var"#1#2", J::var"#3#4", par::Vector{Float64}, lens::Setfield.IndexLens{Tuple{Int64}}, contParams::ContinuationPar{Float64, DefaultLS, DefaultEig{typeof(real)}}, defOp::DeflationOperator{Int64, typeof(dot), Float64, Vector{Float64}}; verbosity::Int64, maxBranches::Int64, seekEveryStep::Int64, maxIterDefOp::Int64, plot::Bool, tangentAlgo::SecantPred, linearAlgo::BorderingBLS{DefaultLS, Float64}, dotPALC::BifurcationKit.DotTheta{BifurcationKit.var"#169#171", BifurcationKit.var"#170#172"}, recordFromSolution::var"#5#9", plotSolution::BifurcationKit.var"#587#603"{BifurcationKit.var"#587#588#604"}, perturbSolution::var"#6#10", callbackN::var"#7#11", acceptSolution::BifurcationKit.var"#592#608", updateDeflationOp::BifurcationKit.var"#593#609", normN::typeof(norm))
   @ BifurcationKit ~/.julia/packages/BifurcationKit/eoTLY/src/DeflatedContinuation.jl:165
 [7] top-level scope
   @ In[7]:2
 [8] eval
   @ ./boot.jl:373 [inlined]
 [9] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base ./loading.jl:1196

```

I think there’s some problem with the `callbackN = (x, f, J, res, iteration, itlinear, options; kwargs...) -> res <1e7` function. Remvoing it an the error disappears (but we get a lot of `┌ Error: Same solution found for identical parameter value!!`, which might be expected acroding to [Deflated Continuation · Bifurcation Analysis in Julia](https://docs.juliahub.com/BifurcationKit/I1INQ/0.1.5/DeflatedContinuation/))

@rveltz Is it that something have changed internally to how the input or output of the `callbackN` function is expected to be? I also try the example form [Deflated Continuation · Bifurcation Analysis in Julia](https://docs.juliahub.com/BifurcationKit/I1INQ/0.1.5/DeflatedContinuation/)

```julia
using BifurcationKit, LinearAlgebra, Setfield, SparseArrays, Plots
const BK = BifurcationKit

k = 2
N = 1
F = (x, p) -> p .* x .+ x.^(k+1)/(k+1) .+ 0.01
Jac_m = (x, p) -> diagm(0 => p .+ x.^k)

opts = BK.ContinuationPar(dsmax = 0.051, dsmin = 1e-3, ds=0.001, maxSteps = 140, pMin = -3., saveSolEveryStep = 0, newtonOptions = NewtonPar(tol = 1e-8, verbose = false), saveEigenvectors = false);

brdc, = continuation(F,Jac_m, 0.5, (@lens _),
	ContinuationPar(opts, ds = -0.001, maxSteps = 800, newtonOptions = NewtonPar(verbose = false, maxIter = 6), plotEveryStep = 40),
	DeflationOperator(2.0, dot, .001, [[0.]]); plot=true, verbosity = 0,
	perturbSolution = (x,p,id) -> (x .+ 0.1 .* rand(length(x))),
	callbackN = (x, f, J, res, iteration, itlinear, options; kwargs...) -> res <1e3)

```

and get the identical error:

```julia
MethodError: no method matching (::var"#17#20")(::NamedTuple{(:x, :f, :nothing, :res, :it, :options, :x0, :resHist), Tuple{Vector{Float64}, Vector{Float64}, Nothing, Float64, Int64, NewtonPar{Float64, DefaultLS, DefaultEig{typeof(real)}}, Vector{Float64}, Vector{Float64}}}; fromNewton=true, iterationC=0, p=0.5)
Closest candidates are:
  (::var"#17#20")(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any; kwargs...) at In[10]:5

Stacktrace:
 [1] newton(Fhandle::var"#12#13", Jhandle::var"#14#15", x0::Vector{Float64}, p0::Float64, options::NewtonPar{Float64, DefaultLS, DefaultEig{typeof(real)}}; normN::typeof(norm), callback::Function, kwargs::Base.Pairs{Symbol, Real, Tuple{Symbol, Symbol}, NamedTuple{(:iterationC, :p), Tuple{Int64, Float64}}})
   @ BifurcationKit ~/.julia/packages/BifurcationKit/eoTLY/src/Newton.jl:117
 [2] iterate(it::ContIterable{var"#12#13", var"#14#15", Vector{Float64}, Float64, Setfield.IdentityLens, Float64, DefaultLS, DefaultEig{typeof(real)}, SecantPred, BorderingBLS{DefaultLS, Float64}, BifurcationKit.var"#587#603"{BifurcationKit.var"#587#588#604"}, BifurcationKit.var"#586#602", typeof(norm), BifurcationKit.DotTheta{BifurcationKit.var"#169#171", BifurcationKit.var"#170#172"}, typeof(BifurcationKit.finaliseDefault), var"#17#20", Nothing, Nothing}; _verbosity::Int64)
   @ BifurcationKit ~/.julia/packages/BifurcationKit/eoTLY/src/Continuation.jl:276
 [3] iterate
   @ ~/.julia/packages/BifurcationKit/eoTLY/src/Continuation.jl:259 [inlined]
 [4] getStatesContResults(iter::BifurcationKit.DefContIterable{ContIterable{var"#12#13", var"#14#15", Vector{Float64}, Float64, Setfield.IdentityLens, Float64, DefaultLS, DefaultEig{typeof(real)}, SecantPred, BorderingBLS{DefaultLS, Float64}, BifurcationKit.var"#587#603"{BifurcationKit.var"#587#588#604"}, BifurcationKit.var"#586#602", typeof(norm), BifurcationKit.DotTheta{BifurcationKit.var"#169#171", BifurcationKit.var"#170#172"}, typeof(BifurcationKit.finaliseDefault), var"#17#20", Nothing, Nothing}, var"#16#19", BifurcationKit.var"#592#608", BifurcationKit.var"#593#609"}, roots::Vector{Vector{Float64}})
   @ BifurcationKit ~/.julia/packages/BifurcationKit/eoTLY/src/DeflatedContinuation.jl:73
 [5] deflatedContinuation(iter::BifurcationKit.DefContIterable{ContIterable{var"#12#13", var"#14#15", Vector{Float64}, Float64, Setfield.IdentityLens, Float64, DefaultLS, DefaultEig{typeof(real)}, SecantPred, BorderingBLS{DefaultLS, Float64}, BifurcationKit.var"#587#603"{BifurcationKit.var"#587#588#604"}, BifurcationKit.var"#586#602", typeof(norm), BifurcationKit.DotTheta{BifurcationKit.var"#169#171", BifurcationKit.var"#170#172"}, typeof(BifurcationKit.finaliseDefault), var"#17#20", Nothing, Nothing}, var"#16#19", BifurcationKit.var"#592#608", BifurcationKit.var"#593#609"}, deflationOp::DeflationOperator{Float64, typeof(dot), Float64, Vector{Float64}}, contParams::ContinuationPar{Float64, DefaultLS, DefaultEig{typeof(real)}}, verbosity::Int64, plot::Bool)
   @ BifurcationKit ~/.julia/packages/BifurcationKit/eoTLY/src/DeflatedContinuation.jl:170
 [6] continuation(F::var"#12#13", J::var"#14#15", par::Float64, lens::Setfield.IdentityLens, contParams::ContinuationPar{Float64, DefaultLS, DefaultEig{typeof(real)}}, defOp::DeflationOperator{Float64, typeof(dot), Float64, Vector{Float64}}; verbosity::Int64, maxBranches::Int64, seekEveryStep::Int64, maxIterDefOp::Int64, plot::Bool, tangentAlgo::SecantPred, linearAlgo::BorderingBLS{DefaultLS, Float64}, dotPALC::BifurcationKit.DotTheta{BifurcationKit.var"#169#171", BifurcationKit.var"#170#172"}, recordFromSolution::BifurcationKit.var"#586#602", plotSolution::BifurcationKit.var"#587#603"{BifurcationKit.var"#587#588#604"}, perturbSolution::var"#16#19", callbackN::var"#17#20", acceptSolution::BifurcationKit.var"#592#608", updateDeflationOp::BifurcationKit.var"#593#609", normN::typeof(norm))
   @ BifurcationKit ~/.julia/packages/BifurcationKit/eoTLY/src/DeflatedContinuation.jl:165
 [7] top-level scope
   @ In[10]:1
 [8] eval
   @ ./boot.jl:373 [inlined]
 [9] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base ./loading.jl:1196

```

---

<div class="post-metadata">

**Author:** ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Post date:** [April 8, 2022, 11:07am UTC](https://discourse.julialang.org/t/error-with-catalyst-jl-bifurcation-diagram-tutorial/79202/5 "2022-04-08T11:07:04Z")

</div>

There are several issues. The best is to use the following limiter:

```julia
callbackN = BifurcationKit.cbMaxNorm(1e7)

```

so you dont have to worry about the signature. The next one is here:

```julia
DO = DeflationOperator( 2,     
                        dot,    
                        1., # note the Float here
                        [fill(0.,length(rn.states))]); 

```

You used integer valued `DeflationOperator`. Maybe I should be less strict in the function signature.

---

<div class="post-metadata">

**Author:** ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Post date:** [April 8, 2022, 11:07am UTC](https://discourse.julialang.org/t/error-with-catalyst-jl-bifurcation-diagram-tutorial/79202/6 "2022-04-08T11:07:36Z")

</div>

All in all:

```julia
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, plot=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 = BifurcationKit.cbMaxNorm(1e7), # Parameter for the continuation method, see BifurcationKit documentation.
)

plot(branches...)

```

---

<div class="post-metadata">

**Author:** ![Torkel](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/torkel/32/5030_2.png) [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Post date:** [April 8, 2022, 11:19am UTC](https://discourse.julialang.org/t/error-with-catalyst-jl-bifurcation-diagram-tutorial/79202/7 "2022-04-08T11:19:19Z")

</div>

Yes, that works well, thanks a lot for helping. Also, thanks @Dragolonth for reporting the issue. I will update the docs after lunch.

---

<div class="post-metadata">

**Author:** ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Post date:** [April 8, 2022, 11:43am UTC](https://discourse.julialang.org/t/error-with-catalyst-jl-bifurcation-diagram-tutorial/79202/8 "2022-04-08T11:43:54Z")

</div>

> [@Torkel](#):
>
> @rveltz Is it that something have changed internally to how the input or output of the `callbackN` function is expected to be? I also try the example form [Deflated Continuation · Bifurcation Analysis in Julia](https://docs.juliahub.com/BifurcationKit/I1INQ/0.1.5/DeflatedContinuation/)

Yes, the function signature has changed [here](https://github.com/rveltz/BifurcationKit.jl/commit/4d74943e292a8e2ba0b6349979b839e021e32a9b) so it is less cumbersome. I have not tagged a version yet so maybe you can add the BK version bound 1.10.0 on Catalyst’s website.

Apologies for this…

---

<div class="post-metadata">

**Author:** ![Dragolonth](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@Dragolonth](https://discourse.julialang.org/u/Dragolonth)\
**Post date:** [April 11, 2022, 6:44am UTC](https://discourse.julialang.org/t/error-with-catalyst-jl-bifurcation-diagram-tutorial/79202/9 "2022-04-11T06:44:09Z")

</div>

Amazing! Thank you @rveltz and @Torkel

---

<div class="post-metadata">

**Author:** ![Dragolonth](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@Dragolonth](https://discourse.julialang.org/u/Dragolonth)\
**Post date:** [April 11, 2022, 7:28am UTC](https://discourse.julialang.org/t/error-with-catalyst-jl-bifurcation-diagram-tutorial/79202/10 "2022-04-11T07:28:43Z")

</div>

I was getting this error message when I was using a float value:

```julia
MethodError: no method matching DeflationOperator(::Int64, ::typeof(dot), ::Float64, ::Vector{Vector{Float64}})
Closest candidates are:
  DeflationOperator(::T, ::Tdot, ::T, ::Vector{vectype}) where {T<:Real, Tdot, vectype} at C:\Users\Nikith Kurella\.julia\packages\BifurcationKit\Yvq7p\src\DeflationOperator.jl:14

Stacktrace:
 [1] top-level scope
   @ In[10]:10
 [2] eval
   @ .\boot.jl:373 [inlined]
 [3] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base .\loading.jl:1196

```

Using an integer value seemed to resolve this error

---

<div class="post-metadata">

**Author:** ![Dragolonth](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@Dragolonth](https://discourse.julialang.org/u/Dragolonth)\
**Post date:** [April 11, 2022, 7:31am UTC](https://discourse.julialang.org/t/error-with-catalyst-jl-bifurcation-diagram-tutorial/79202/11 "2022-04-11T07:31:14Z")

</div>

I seem to have run into another issue. After copying your code, I get this error:

```julia
UndefVarError: cbMaxNorm not defined

Stacktrace:
 [1] getproperty(x::Module, f::Symbol)
   @ Base .\Base.jl:35
 [2] top-level scope
   @ In[11]:16
 [3] eval
   @ .\boot.jl:373 [inlined]
 [4] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
   @ Base .\loading.jl:1196

```

I believe I have initialized the BifurcationKit package correctly, so I’m unsure as to why cbMaxNorm is not defined.

---

<div class="post-metadata">

**Author:** ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Post date:** [April 11, 2022, 7:34am UTC](https://discourse.julialang.org/t/error-with-catalyst-jl-bifurcation-diagram-tutorial/79202/12 "2022-04-11T07:34:30Z")

</div>

it is not exported, so `BifurcationKit.cbMaxNorm `

---

<div class="post-metadata">

**Author:** ![Dragolonth](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@Dragolonth](https://discourse.julialang.org/u/Dragolonth)\
**Post date:** [April 11, 2022, 7:44am UTC](https://discourse.julialang.org/t/error-with-catalyst-jl-bifurcation-diagram-tutorial/79202/13 "2022-04-11T07:44:54Z")

</div>

Thank you for bearing with me @rveltz. Forgive me if this is a basic question, but I seem to still be getting the error after using `BifurcationKit.cbMaxNorm`

Here is my code:

```julia
using BifurcationKit, Plots, LinearAlgebra, Setfield

```

```julia
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.

```

```julia
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, plot=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 = BifurcationKit.cbMaxNorm(1e7), # Parameter for the continuation method, see BifurcationKit documentation.
)

plot(branches...)

```

---

<div class="post-metadata">

**Author:** ![rveltz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rveltz/32/2707_2.png) [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Post date:** [April 11, 2022, 7:51am UTC](https://discourse.julialang.org/t/error-with-catalyst-jl-bifurcation-diagram-tutorial/79202/14 "2022-04-11T07:51:54Z")

</div>

please compare my code to yours, see `DO`
