diff --git a/scripts/run_simulation.jl b/scripts/run_simulation.jl index 842a71a..bc65ee4 100644 --- a/scripts/run_simulation.jl +++ b/scripts/run_simulation.jl @@ -7,7 +7,7 @@ using .Visualization N = 100 tspan = (0.0, 100.0) -sol = run_simulation(N, tspan) +sol = AnimalFurFHN.run_simulation(tspan, N) Visualization.step_through_solution(sol, N) \ No newline at end of file diff --git a/src/solver.jl b/src/solver.jl index b7b9114..95ded8f 100644 --- a/src/solver.jl +++ b/src/solver.jl @@ -30,7 +30,19 @@ function fhn!(du, u, p::FHNParams, t = 0) du .= vcat(vec(fu), vec(fv)) 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 p = FHNParams(N, 1.0, 1e-5, 1e-3, 0.01, 0.1, 0.5) diff --git a/src/visualization.jl b/src/visualization.jl index fb19860..6a1cda5 100644 --- a/src/visualization.jl +++ b/src/visualization.jl @@ -1,8 +1,19 @@ module Visualization 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)) ax = Axis(fig[1, 1]) slider = Slider(fig[2, 1], range=1:length(sol), startvalue=1)