made docs foldable
parent
3fcfa16570
commit
aec9b33b38
|
|
@ -5,7 +5,7 @@ include("../src/visualization.jl")
|
|||
using .Visualization
|
||||
|
||||
N = 100
|
||||
tspan = (0.0, 100.0)
|
||||
tspan = (0.0, 1000.0)
|
||||
|
||||
sol = AnimalFurFHN.run_simulation(tspan, N)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,16 +1,16 @@
|
|||
"""
|
||||
laplacian(U::Matrix{Float64}, N::Int, h::Float64)
|
||||
|
||||
Computes the discrete 2D Laplacian of a matrix `U` using a 5-point stencil
|
||||
and circular boundary conditions.
|
||||
Computes the discrete 2D Laplacian of a matrix `U` using a 5-point stencil
|
||||
and circular boundary conditions.
|
||||
|
||||
# Arguments
|
||||
- `U::Matrix{Float64}`: The input 2D matrix representing the field or image.
|
||||
- `N::Int`: Integer
|
||||
- `h::Float64`: The spatial step size or grid spacing between points in the discretization.
|
||||
# Arguments
|
||||
- `U::Matrix{Float64}`: The input 2D matrix representing the field or image.
|
||||
- `N::Int`: Integer
|
||||
- `h::Float64`: The spatial step size or grid spacing between points in the discretization.
|
||||
|
||||
# Returns
|
||||
- `Vector{Float64}`: A flattened (vectorized) representation of the approximated Laplacian values for each element in `U`. The boundary conditions are handled circularly.
|
||||
# Returns
|
||||
- `Vector{Float64}`: A flattened (vectorized) representation of the approximated Laplacian values for each element in `U`. The boundary conditions are handled circularly.
|
||||
"""
|
||||
function laplacian(U::Matrix{Float64}, N::Int, h::Float64)
|
||||
# shifts matrices and sums them up
|
||||
|
|
|
|||
|
|
@ -5,17 +5,17 @@ using .Constants
|
|||
"""
|
||||
fhn(du, u, p:FHNParams, t:)
|
||||
|
||||
Implements the spatial dynamics of FitzHugh-Nagumo (fhn). Designed to be
|
||||
within a larger numerical solver of partial differential equations.
|
||||
Implements the spatial dynamics of FitzHugh-Nagumo (fhn). Designed to be
|
||||
within a larger numerical solver of partial differential equations.
|
||||
|
||||
# Arguments
|
||||
- `du`: output argument which stores the calculated derivatives
|
||||
- `u`: input vector containing the current state of the system at time t
|
||||
- `p`: holds all the fixed parameters of the FHN model
|
||||
- `t`: current time
|
||||
# Arguments
|
||||
- `du`: output argument which stores the calculated derivatives
|
||||
- `u`: input vector containing the current state of the system at time t
|
||||
- `p`: holds all the fixed parameters of the FHN model
|
||||
- `t`: current time
|
||||
|
||||
# Returns
|
||||
- `du`: calculated derivatives put back into the du array
|
||||
# Returns
|
||||
- `du`: calculated derivatives put back into the du array
|
||||
"""
|
||||
function fhn!(du, u, p::FHNParams, t = 0)
|
||||
u_mat = reshape(u[1:p.N^2], p.N, p.N) # activation variable
|
||||
|
|
@ -33,14 +33,14 @@ end
|
|||
"""
|
||||
run_simulation(tspan::Tuple{Float64,Float64}, N::Int)
|
||||
|
||||
solving the ODE and modelling it after FHN
|
||||
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
|
||||
# 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)
|
||||
# Returns
|
||||
- `sol`: solved differential equation (ODE)
|
||||
"""
|
||||
function run_simulation(tspan::Tuple{Float64,Float64}, N::Int)
|
||||
# Turing-spot parameters
|
||||
|
|
|
|||
|
|
@ -4,14 +4,14 @@ using GLMakie
|
|||
"""
|
||||
step_through_solution(sol::SolutionType, N::Int)
|
||||
|
||||
Function for visualization for the output of run_simulation
|
||||
Function for visualization for the output of run_simulation
|
||||
|
||||
# Arguments
|
||||
- `sol`: computed differential equation by run_simulation
|
||||
- `N`: size of the N×N grid
|
||||
# Arguments
|
||||
- `sol`: computed differential equation by run_simulation
|
||||
- `N`: size of the N×N grid
|
||||
|
||||
# Returns
|
||||
- ``: Displays created figure
|
||||
# Returns
|
||||
- ``: Displays created figure
|
||||
"""
|
||||
function step_through_solution(sol, N::Int)
|
||||
fig = Figure(resolution=(600, 600))
|
||||
|
|
|
|||
Loading…
Reference in New Issue