Created
September 19, 2018 11:40
-
-
Save SoTaInverSpinel/28cb3f5932d54277d1957a725064153b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#陰解法 | |
#参考:三浦岳、発生の数理、京都大学学術出版会、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