made FHNParams constructor more readable
parent
aec9b33b38
commit
88dea7eefb
|
|
@ -8,6 +8,11 @@ struct FHNParams
|
|||
ϵ::Float64
|
||||
a::Float64
|
||||
b::Float64
|
||||
|
||||
# Inner constructor that takes keyword arguments
|
||||
# The semicolon ';' separates positional arguments from keyword arguments
|
||||
FHNParams(; N::Int, dx::Float64, Du::Float64, Dv::Float64, ϵ::Float64, a::Float64, b::Float64) =
|
||||
new(N, dx, Du, Dv, ϵ, a, b)
|
||||
end
|
||||
|
||||
export FHNParams
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ end
|
|||
"""
|
||||
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)
|
||||
p = FHNParams(N = N, dx = 1.0, Du = 1e-5, Dv = 1e-3, ϵ = 0.01, a = 0.1, b = 0.5)
|
||||
|
||||
# Initial conditions (random noise)
|
||||
Random.seed!(1234)
|
||||
|
|
|
|||
Loading…
Reference in New Issue