Skip to content

Instantly share code, notes, and snippets.

@SoTaInverSpinel
Created September 19, 2018 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SoTaInverSpinel/28cb3f5932d54277d1957a725064153b to your computer and use it in GitHub Desktop.
Save SoTaInverSpinel/28cb3f5932d54277d1957a725064153b to your computer and use it in GitHub Desktop.
#陰解法
#参考:三浦岳、発生の数理、京都大学学術出版会、2015、4.5
#julia v0.6
using Plots
gr()
A=circshift(eye(10),(0,1))+circshift(eye(10),(0,-1))-2*eye(10)
dt=0.05
initialDistribution=[0,0,0,1,1,1,0,0,0,0]
onestep(v)=(inv(eye(10)-dt*A))*v
u=initialDistribution
anim = @animate for g=0:100
plot(u,
#xticks=0:1:20,
ylim=(0.0,1.5),
yticks=0.0:0.1:1.5,
seriestype=:bar,
title="gen = $g")
u=onestep(u)
end
@time gif(anim, "tmp/diff04.gif", fps = 5)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment