我正在尝试使用 DynamicalSystems julia 包来绘制由以下方程控制的离散动力系统的轨道图:
y_{n+1} = 1- by_n^2
我可以让它绘制但是我似乎无法让初始条件起作用,我正在尝试使用y_0 = -0.68
.
这是我的代码:
using DynamicalSystems
using PyPlot
function eom(dx, x, p, n)
dx[1] = 1 - p[1] * x[1]^2
end
ds = DiscreteDynamicalSystem(eom, [-0.68], [2.0, 0.0])
i = 1
pvalues = 0.0:0.001:2.0
n = 2000
Ttr = 2000
p_index = 1
output = orbitdiagram(ds, i, p_index, pvalues; n = n,
Ttr = Ttr, u0 = get_state(ds))
L = length(pvalues)
x = Vector{Float64}(undef, n*L)
y = copy(x)
for j in 1:L
x[(1 + (j-1)*n):j*n] .= pvalues[j]
y[(1 + (j-1)*n):j*n] .= output[j]
end
figure()
PyPlot.title("total points: $(L*n)")
plot(x, y, ls = "None", ms = 0.5, color = "black", marker = "o", alpha = 0.05)
xlim(pvalues[1], pvalues[end]);
xlabel("\$b\$"); ylabel("\$y\$")
tight_layout()
如果可能的话,有人能告诉我是否有办法使用 DynamicalSystems 获得分叉点。