Comments (5)
you have to do
using JLD2
before using BifurcationKit
. The online docs have not yet propagated the change but this is explained when doing ? continuation
or ? ContinuationPar
from bifurcationkit.jl.
I have installed JLD2
and now it works. Thanks. However, I find that it has issues saving the last continuation step and also the reverse branch when I have bothside=true
.
using BifurcationKit, LinearAlgebra, Plots, Parameters, Setfield, JLD2
const BK = BifurcationKit
N(x; a = 0.5, b = 0.01) = 1 + (x + a*x^2)/(1 + b*x^2)
function F_chan(x, p)
@unpack α, β = p
f = similar(x)
n = length(x)
f[1] = x[1] - β
f[n] = x[n] - β
for i=2:n-1
f[i] = (x[i-1] - 2 * x[i] + x[i+1]) * (n-1)^2 + α * N(x[i], b = β)
end
return f
end
n = 101
sol = [(i-1)*(n-i)/n^2+0.1 for i=1:n]
par = (α = 3.3, β = 0.01)
optnewton = NewtonPar(tol = 1e-11, verbose = false)
out, = @time newton( F_chan, sol, par, optnewton)
optcont = ContinuationPar(dsmin = 0.01, dsmax = 0.2, ds= 0.1, pMin = 0., pMax = 4.1, saveToFile=true,
newtonOptions = NewtonPar(maxIter = 10, tol = 1e-9))
filename = "test_123"
br, = continuation(F_chan, out, par, (@lens _.α), optcont; plot = false, verbosity = 1, filename=filename, bothside=true)
br2 = load(@sprintf("%s-branch.jld2",filename))["branch"] # load the saved branch
- The output screen (from
verbosity=1
) doesn't show any error/warnings for the 'forward' continuation, but I think it fails to save the last continuation step atalpha=4.1
:
julia> any(br.param .== 4.1)
true
julia> any(br2.param .== 4.1)
false
- Once the 'forward' continuation is done, it starts doing the 'reverse' continuation. Now the output screen shows the following:
#####################################################
────────── Pseudo-Arclength Continuation ────────────
───────────────── INITIAL GUESS ────────────────────
--> convergence of initial guess = OK
--> parameter = 3.3, initial step
───────────────── INITIAL TANGENT ───────────────────
--> convergence of initial guess = OK
--> parameter = 3.2993333333333332, initial step (bis)
Predictor: SecantPred()
──────────────────────────────────────────────────────────────────────
Continuation Step 0
Step size = -1.0000e-01
Parameter α = 3.3000e+00 ⟶ 3.1672e+00 [guess]
Parameter α = 3.3000e+00 ⟶ 3.1662e+00
Predictor: SecantPred()
┌ Error: Could not save branch in the jld2 file
└ @ BifurcationKit C:\Users\dchang\.julia\packages\BifurcationKit\eoTLY\src\BifurcationKit.jl:114
──────────────────────────────────────────────────────────────────────
Continuation Step 1
Step size = -1.2450e-01
Parameter α = 3.1662e+00 ⟶ 2.9997e+00 [guess]
Parameter α = 3.1662e+00 ⟶ 2.9974e+00
Predictor: SecantPred()
┌ Error: Could not save branch in the jld2 file
└ @ BifurcationKit C:\Users\dchang\.julia\packages\BifurcationKit\eoTLY\src\BifurcationKit.jl:114
I get that error message for all the steps in the 'reverse' continuation. And when I compare br.param
and br2.param
, then it is clear that the whole 'reverse' branch is missing.
from bifurcationkit.jl.
Oh! I never tested it with bothside = true
. I will try to fix it asap
from bifurcationkit.jl.
This should be fixed on master
from bifurcationkit.jl.
Can I close this issue?
from bifurcationkit.jl.
Related Issues (20)
- typos HOT 3
- acceptSolution in DefCont() not used HOT 1
- continuation of periodic orbit from Hopf curve HOT 1
- Issue when implementing the KdV equation HOT 9
- Continuation of LPC from Bautin/GH point HOT 2
- Out of memory for 1D periodic non-linear system HOT 8
- Plotting with Makie HOT 3
- Getting print statements despite `verbosity=0` HOT 6
- BifurcationKit not working with ArrayPartitions ? HOT 1
- getperiod vs. getPeriod HOT 3
- _isinplace causes incorrect dispatch when both out of place and in place versions of a function is defined HOT 9
- Add `BifurcationProblem` dispatch for ModelingToolkit problems (possibly in an extension?) HOT 8
- BifurcationKit incompatible with latest ModelingToolkit version HOT 8
- record from solution title looks werid in docs HOT 2
- Incorrect calls to `EventSpecialPoint` HOT 2
- Problems with event detection HOT 5
- using `ContinuationPar` directly as input to `bifurcationdiagram` (rather than `(args...) -> opts_br`) HOT 2
- Use Julian style of code? HOT 8
- Continuation doesn't start when using Natural() and pMin = p0 HOT 1
- No way to set BifFunction's delta parameter HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bifurcationkit.jl.