using DifferentialEquations μ = 0.456 ϵ = 0.0357 function bluesky(du,u,p,t) du[1] = u[1]*(2+μ-10(u[1]^2+u[2]^2)) + u[3]^2 + u[2]^2+2u[2] du[2] = -u[3]^3-(1+u[2])*(u[3]^2+u[2]^2+2u[2])-4*u[1]+μ*u[2] du[3] = (1+u[2])*u[3]^2+u[1]^2-ϵ end u0 = [1.0;0.0;0.0] tspan = (0.0,100.0) prob = ODEProblem(bluesky,u0,tspan) sol = solve(prob) using Plots plot(sol,vars=(1,2,3)) plt = path3d(1, xlim=(-3,3), ylim=(-3,3), zlim=(-3,3), xlab = "x", ylab = "y", zlab = "z", title = "Gavrilov-A. Shilnikov model", marker = 1) # build an animated gif, saving every 10th frame @gif for i=1:length(sol) push!(plt, sol[i][1], sol[i][2], sol[i][3]) end every 3 function displayfile(mimetype, filename) open(filename) do f base64text = base64encode(f) display("text/html", """""") end end displayfile("image/gif","./bluesky.gif") # ちょっと遅くしたもの displayfile("image/gif","./bluesky2.gif") plotly() plot(sol[1,:],sol[2,:],sol[3,:], size=(500, 500))