coral pattern kinda done
parent
9223916f32
commit
0dd6062c5d
|
|
@ -4,8 +4,8 @@ using .AnimalFurFHN
|
||||||
include("../src/visualization.jl")
|
include("../src/visualization.jl")
|
||||||
using .Visualization
|
using .Visualization
|
||||||
|
|
||||||
N = 100
|
N = 128
|
||||||
tspan = (1.0, 1000.0)
|
tspan = (0.0, 2000.0)
|
||||||
|
|
||||||
sol = AnimalFurFHN.run_simulation(tspan, N)
|
sol = AnimalFurFHN.run_simulation(tspan, N)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,10 +45,10 @@ end
|
||||||
function run_simulation(tspan::Tuple{Float64,Float64}, N::Int)
|
function run_simulation(tspan::Tuple{Float64,Float64}, N::Int)
|
||||||
# Initial conditions
|
# Initial conditions
|
||||||
# params, y0 = zebra_conditions(N) # tspan of ~3500 enough
|
# params, y0 = zebra_conditions(N) # tspan of ~3500 enough
|
||||||
params, y0 = cell_conditions(N)
|
params, y0 = coral_conditions(N)
|
||||||
|
|
||||||
prob = ODEProblem(fhn!, y0, tspan, params)
|
prob = ODEProblem(fhn!, y0, tspan, params)
|
||||||
sol = solve(prob, BS3(), saveat=10.0) # You can try `Rosenbrock23()` too
|
sol = solve(prob, BS3(), saveat=50.0) # You can try `Rosenbrock23()` too
|
||||||
|
|
||||||
return sol
|
return sol
|
||||||
end
|
end
|
||||||
|
|
|
||||||
21
src/utils.jl
21
src/utils.jl
|
|
@ -21,14 +21,13 @@ function cheetah_conditions(N)
|
||||||
return params, vcat(vec(u0), vec(v0))
|
return params, vcat(vec(u0), vec(v0))
|
||||||
end
|
end
|
||||||
|
|
||||||
function cell_conditions(N)
|
function coral_conditions(N)
|
||||||
# Turing-spot parameters
|
# Turing-spot parameters
|
||||||
params = FHNParams(N=N, dx=1.0, Du=5e-5, Dv=6e-3, ϵ=0.05, a=0.6, b=0.1)
|
params = FHNParams(N=N, dx=1.0, Du=0.001, Dv=0.06, ϵ=0.05, a=0.0, b=1.2)
|
||||||
|
|
||||||
u0 = 0.534522 .* (2 .* rand(N, N) .- 1) # noise in [-0.05, 0.05]
|
u0, v0 = coral_ic(N)
|
||||||
v0 = 0.381802 .* (2 .* rand(N, N) .- 1)
|
|
||||||
|
|
||||||
return params, vcat(vec(u0), vec(v0))
|
return params, vcat(u0, v0)
|
||||||
end
|
end
|
||||||
|
|
||||||
# helper functions for filling cells in specific places of the matrix
|
# helper functions for filling cells in specific places of the matrix
|
||||||
|
|
@ -185,3 +184,15 @@ function squiggle_ic(N, Lx=400.0, Ly=400.0)
|
||||||
|
|
||||||
return vec(u), vec(v)
|
return vec(u), vec(v)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function coral_ic(N)
|
||||||
|
u = fill(0.534522, N, N)
|
||||||
|
v = fill(0.381802, N, N)
|
||||||
|
|
||||||
|
for _ in 1:40 # place 15 noisy seeds
|
||||||
|
i, j = rand(10:N-10), rand(10:N-10)
|
||||||
|
u[i-2:i+2, j-2:j+2] .= -0.534522 .+ 0.2 * rand(5, 5)
|
||||||
|
end
|
||||||
|
|
||||||
|
return vec(u), vec(v)
|
||||||
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue