|
1 | 1 | mutable struct BifurcationCurve{DType,SPType}
|
2 |
| - d::DType |
| 2 | + points::DType |
3 | 3 | stab::Vector{String}
|
4 | 4 | special_points::SPType
|
5 | 5 | changes::Vector{Int}
|
6 | 6 | end
|
7 | 7 |
|
8 | 8 | @recipe function f(bif::BifurcationCurve,coords)
|
9 |
| - x = bif.d[coords[1]] |
10 |
| - y = bif.d[coords[2]] |
| 9 | + x = bif.points[coords[1]] |
| 10 | + y = bif.points[coords[2]] |
11 | 11 | g = bif.stab
|
12 | 12 | style_order = unique(bif.stab)
|
| 13 | + |
13 | 14 | linestyle --> reshape([style == "S" ? :solid : :dash for style in style_order],1,length(style_order))
|
14 | 15 | color --> reshape([style == "S" ? :blue : :red for style in style_order],1,length(style_order))
|
15 | 16 | legend --> false
|
16 | 17 | xlabel --> coords[1]
|
17 | 18 | ylabel --> coords[2]
|
| 19 | + |
18 | 20 | for k in keys(bif.special_points)
|
19 | 21 | @series begin
|
20 | 22 | seriestype --> :scatter
|
@@ -108,11 +110,11 @@ function bifurcation_curve(PC,bif_type,freepars;max_num_points=450,
|
108 | 110 |
|
109 | 111 | # Get the curve
|
110 | 112 | pts = PyDict(PC[:curves][name][:_curveToPointset]())
|
111 |
| - d = OrderedDict{Symbol,Vector{Float64}}() |
| 113 | + points = OrderedDict{Symbol,Vector{Float64}}() |
112 | 114 | for k in keys(pts)
|
113 |
| - d[Symbol(k)] = pts[k] |
| 115 | + points[Symbol(k)] = pts[k] |
114 | 116 | end
|
115 |
| - len = length(d[first(keys(d))]) |
| 117 | + len = length(points[first(keys(points))]) |
116 | 118 |
|
117 | 119 | # Get the stability
|
118 | 120 | # S => Stable
|
@@ -156,7 +158,7 @@ function bifurcation_curve(PC,bif_type,freepars;max_num_points=450,
|
156 | 158 |
|
157 | 159 | changes = find_changes(stab)
|
158 | 160 |
|
159 |
| - BifurcationCurve(d,stab,special_points,changes) |
| 161 | + BifurcationCurve(points,stab,special_points,changes) |
160 | 162 | end
|
161 | 163 |
|
162 | 164 | function find_changes(stab)
|
|
0 commit comments