added more docs
parent
fd571169f2
commit
3619fe10be
|
|
@ -7,7 +7,7 @@ using .Visualization
|
||||||
N = 100
|
N = 100
|
||||||
tspan = (0.0, 100.0)
|
tspan = (0.0, 100.0)
|
||||||
|
|
||||||
sol = run_simulation(N, tspan)
|
sol = AnimalFurFHN.run_simulation(tspan, N)
|
||||||
|
|
||||||
|
|
||||||
Visualization.step_through_solution(sol, N)
|
Visualization.step_through_solution(sol, N)
|
||||||
|
|
@ -30,7 +30,19 @@ function fhn!(du, u, p::FHNParams, t = 0)
|
||||||
du .= vcat(vec(fu), vec(fv))
|
du .= vcat(vec(fu), vec(fv))
|
||||||
end
|
end
|
||||||
|
|
||||||
function run_simulation(N::Int, tspan::Tuple{Float64,Float64})
|
"""
|
||||||
|
run_simulation(tspan::Tuple{Float64,Float64}, N::Int)
|
||||||
|
|
||||||
|
solving the ODE and modelling it after FHN
|
||||||
|
|
||||||
|
# Arguments
|
||||||
|
- `tspan`: tuple of two Float64's representing start and end times for simulation
|
||||||
|
- `N`: size of the N×N grid
|
||||||
|
|
||||||
|
# Returns
|
||||||
|
- `sol`: solved differential equation (ODE)
|
||||||
|
"""
|
||||||
|
function run_simulation(tspan::Tuple{Float64,Float64}, N::Int)
|
||||||
# Turing-spot parameters
|
# Turing-spot parameters
|
||||||
p = FHNParams(N, 1.0, 1e-5, 1e-3, 0.01, 0.1, 0.5)
|
p = FHNParams(N, 1.0, 1e-5, 1e-3, 0.01, 0.1, 0.5)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,19 @@
|
||||||
module Visualization
|
module Visualization
|
||||||
|
|
||||||
using GLMakie
|
using GLMakie
|
||||||
|
"""
|
||||||
|
step_through_solution(sol::SolutionType, N::Int)
|
||||||
|
|
||||||
function step_through_solution(sol, N)
|
Function for visualization for the output of run_simulation
|
||||||
|
|
||||||
|
# Arguments
|
||||||
|
- `sol`: computed differential equation by run_simulation
|
||||||
|
- `N`: size of the N×N grid
|
||||||
|
|
||||||
|
# Returns
|
||||||
|
- ``: Displays created figure
|
||||||
|
"""
|
||||||
|
function step_through_solution(sol::SolutionType, N::Int)
|
||||||
fig = Figure(resolution=(600, 600))
|
fig = Figure(resolution=(600, 600))
|
||||||
ax = Axis(fig[1, 1])
|
ax = Axis(fig[1, 1])
|
||||||
slider = Slider(fig[2, 1], range=1:length(sol), startvalue=1)
|
slider = Slider(fig[2, 1], range=1:length(sol), startvalue=1)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue