bifurcationkit / BifurcationKit.jl

A Julia package to perform Bifurcation Analysis
https://bifurcationkit.github.io/BifurcationKitDocs.jl/stable
Other
303 stars 37 forks source link

Getting print statements despite `verbosity=0` #111

Closed TorkelE closed 1 year ago

TorkelE commented 1 year ago

When I do:

bprob = BifurcationProblem(F, oprob.u0, oprob.p, (@lens _[1]);
                           recordFromSolution = (x, p) -> x[1], J = J)

bopts = ContinuationPar(dsmax = dsmax,          
                        dsmin = dsmin,          
                        ds = sqrt(dsmin*dsmax),           
                        maxSteps = maxSteps,     
                        pMin = p_span[1],      
                        pMax = p_span[2],      
                        detectBifurcation = 3)

bf = bifurcationdiagram(bprob, PALC(), 2, (args...) -> bopts; verbosity=0)

I still get print statements (although not as many as with e.g.verbosity=2:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
───▶ Automatic computation of bifurcation diagram

────────────────────────────────────────────────────────────────────────────────
──▶ New branch, level = 2, dim(Kernel) = 1, code = 0, from bp #1 at p = 2.5001045616107502, type = bp
- #  1,       bp at p ≈ +2.50010456 ∈ (+2.50010456, +2.50026103), |δp|=2e-04, [    guess], δ = ( 1,  0), step = 363, eigenelements in eig[364], ind_ev =   1
┌ Warning: The bifurcating eigenvalue is not that close to Re = 0. We found 0.01606274549196582 !≈ 0.  You can perhaps increase the argument `nev`.
└ @ BifurcationKit ~/.julia/packages/BifurcationKit/DlOaK/src/NormalForms.jl:35
┌ Info: It seems the point is a Saddle-Node bifurcation.
│ The normal form is aδμ + b1⋅x + b2⋅x^2 + b3⋅x^3
│  with coefficients 
└ (a = 0.10430111622527061, b1 = 1.0707818278261385, b2 = 6.6017054417911, b3 = -0.10215187667991692).
────────────────────────────────────────────────────────────────────────────────
──▶ New branch, level = 2, dim(Kernel) = 1, code = 0, from bp #2 at p = 1.6379627854217809, type = bp
- #  2,       bp at p ≈ +1.63796279 ∈ (+1.63796279, +1.63796279), |δp|=2e-11, [converged], δ = (-1,  0), step = 618, eigenelements in eig[619], ind_ev =   1
┌ Info: It seems the point is a Saddle-Node bifurcation.
│ The normal form is aδμ + b1⋅x + b2⋅x^2 + b3⋅x^3
│  with coefficients 
└ (a = -1.047208951553584, b1 = 5.683984001987023, b2 = 1.4149690753031312, b3 = -24.88438055921906).

Is there a way to get rid of these as well (and not get any printed stuff)?

For reference, here is the full code:

using Catalyst

model3 = @reaction_network begin
    @parameters S D τ v0 n η
    (v0 + (S*σ)^n / ((S*σ)^n + (D*A3)^n + 1),1.), ∅ ↔ σ
    (σ/τ,1/τ), ∅ ↔ A1
    (A1/τ,1/τ), ∅ ↔ A2
    (A2/τ,1/τ), ∅ ↔ A3
end
model = model3

p = [0.0, 0.25, 10.0, 0.1, 3, 0.]
p_span = (1.0, 4.0)
p_sym = :S
v_idx = 1

dsmax=(p_span[2]-p_span[1])/1000.0
dsmin=dsmax/1000.0
maxSteps=100000

p_start = updated_p(p, p_sym, p_span[1])
u0 = fill(p_start[3], length(species(model)))

oprob = ODEProblem(model, u0, (0.0, 0.0), p_start; jac = true)
F = (u,p) -> oprob.f(u, p, 0)
J = (u,p) -> oprob.f.jac(u, p, 0)

bprob = BifurcationProblem(F, oprob.u0, oprob.p, (@lens _[p_idx(p_sym)]);
                           recordFromSolution = (x, p) -> x[v_idx], J = J)

bopts = ContinuationPar(dsmax = dsmax,          
                        dsmin = dsmin,          
                        ds = sqrt(dsmin*dsmax),           
                        maxSteps = maxSteps,     
                        pMin = p_span[1],      
                        pMax = p_span[2],      
                        detectBifurcation = 3)

bf = bifurcationdiagram(bprob, PALC(), 2, (args...) -> bopts; verbosity=0)
rveltz commented 1 year ago

No, I was lazy. I can fix it tonight on master. Is enough or do you need a new tag?

TorkelE commented 1 year ago

master should be fine, thanks a lot :+1:

rveltz commented 1 year ago

should be good on master.

TorkelE commented 1 year ago

Thanks :)

rveltz commented 1 year ago

should we close?

TorkelE commented 1 year ago

Sorry, was meaning to but seems I pushed the wrong button!