Skip to content

Commit f73cdd6

Browse files
committed
improve examples
1 parent 3050d57 commit f73cdd6

File tree

5 files changed

+90
-5
lines changed

5 files changed

+90
-5
lines changed

examples/ellipsoid.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@ using MultiParamContinuation
1212
using Test, LinearAlgebra
1313
const MPC = MultiParamContinuation
1414

15-
F(u,p) = [u[1]^2 + u[2]^2 + p.R * u[3]^2 - 1] # sphere
15+
F(u,p) = [u[1]^2 + u[2]^2 + p.R * u[3]^2 - 1]
1616

1717
prob = ManifoldProblem(F,
1818
[0. ,0, 1],
1919
(R = 2.,);
20-
# get_tangent
2120
)
2221

23-
# problem quand j'ajoute une charte
2422
S = MPC.continuation(prob,
2523
Henderson(np0 = 4,
2624
θmin = 0.001,

examples/plane2.jl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using Revise
2+
cd(@__DIR__)
3+
using Pkg
4+
pkg"activate ."
5+
using MultiParamContinuation
6+
7+
using GLMakie
8+
Makie.inline!(false)
9+
Makie.inline!(true)
10+
11+
12+
using Test, LinearAlgebra
13+
const MPC = MultiParamContinuation
14+
15+
F(u,p) = [u[1] + u[2] - u[3]]
16+
17+
prob = ManifoldProblem(F, zeros(3), nothing)
18+
19+
S = continuation(prob,
20+
Henderson(np0 = 4),
21+
CoveringPar(max_charts = 20000,
22+
max_steps = 100,
23+
R0 = .1,
24+
ϵ = Inf,
25+
delta_angle = Inf,
26+
)
27+
)
28+
29+
MPC.plotd(S;
30+
plot_circle = true,
31+
# draw_tangent = false,
32+
draw_edges = true,
33+
plot_center = true,
34+
put_ids = true,
35+
ind_plot = [1,2])
36+
37+

examples/sphere_bifurcationKit.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ F(u,p) = [u[1]^2 + u[2]^2 + u[3]^2 - 1] # sphere
1919
prob = ManifoldProblem_BK(F,
2020
[1.1,0.,0.],
2121
nothing;
22-
# get_tangent
2322
)
2423

2524
# problem quand j'ajoute une charte

examples/sphere_event.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ using MultiParamContinuation, LinearAlgebra
1111

1212
const MPC = MultiParamContinuation
1313

14-
F(u,p) = [u[1]^2 + u[2]^2 + u[3]^2 - 1] # sphere
14+
F(u,p) = [u[1]^2 + u[2]^2 + u[3]^2 - 1]
1515

1616
function get_tangent(u, par)
1717
# compute the normal

examples/transcritical.jl

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
using Revise
2+
cd(@__DIR__)
3+
using Pkg
4+
pkg"activate ."
5+
6+
using GLMakie
7+
Makie.inline!(false)
8+
Makie.inline!(true)
9+
10+
using MultiParamContinuation
11+
12+
const MPC = MultiParamContinuation
13+
14+
function F(u,p)
15+
x,y,z = u
16+
[(z-x-.5*(y-1)*(y-1))*(x+y+z) + y/10]
17+
end
18+
19+
prob = ManifoldProblem(F, [-0.6,-0.6,-0.6], nothing;
20+
finalize_solution = Cube(1.1))
21+
22+
S = continuation(prob,
23+
Henderson(np0 = 4,
24+
θmin = 0.1,
25+
# use_curvature = true,
26+
),
27+
CoveringPar(max_charts = 20000,
28+
max_steps = 2000,
29+
verbose = 0,
30+
newton_options = NonLinearSolveSpec(;maxiters = 6, abstol = 1e-12, reltol = 1e-10),
31+
R0 = .1,
32+
ϵ = 0.005,
33+
delta_angle = 10.15,
34+
))
35+
36+
MPC.plotd(S;
37+
# draw_circle = true,
38+
draw_tangent = true,
39+
# plot_center = true,
40+
# put_ids = true,
41+
ind_plot = [1,3])
42+
43+
step!(S, 1000);fig = MPC.plotd(S; draw_circle = false)
44+
45+
46+
MPC.plot2d(S;
47+
# draw_circle = true,
48+
draw_tangent = true,
49+
plot_center = true,
50+
# put_ids = true,
51+
ind_plot = [1,2])

0 commit comments

Comments
 (0)