fixed code
parent
3619fe10be
commit
3fcfa16570
|
|
@ -18,11 +18,11 @@ within a larger numerical solver of partial differential equations.
|
||||||
- `du`: calculated derivatives put back into the du array
|
- `du`: calculated derivatives put back into the du array
|
||||||
"""
|
"""
|
||||||
function fhn!(du, u, p::FHNParams, t = 0)
|
function fhn!(du, u, p::FHNParams, t = 0)
|
||||||
u_mat = reshape(u[1:N^2], N, N) # activation variable
|
u_mat = reshape(u[1:p.N^2], p.N, p.N) # activation variable
|
||||||
v_mat = reshape(u[N^2+1:end], N, N) # deactivation variable
|
v_mat = reshape(u[p.N^2+1:end], p.N, p.N) # deactivation variable
|
||||||
|
|
||||||
Δu = reshape(laplacian(u_mat, N, p.dx), N, N)
|
Δu = reshape(laplacian(u_mat, p.N, p.dx), p.N, p.N)
|
||||||
Δv = reshape(laplacian(v_mat, N, p.dx), N, N)
|
Δv = reshape(laplacian(v_mat, p.N, p.dx), p.N, p.N)
|
||||||
|
|
||||||
fu = p.Du * Δu .+ u_mat .- u_mat .^ 3 ./ 3 .- v_mat
|
fu = p.Du * Δu .+ u_mat .- u_mat .^ 3 ./ 3 .- v_mat
|
||||||
fv = p.Dv * Δv .+ p.ϵ * (u_mat .+ p.a .- p.b .* v_mat)
|
fv = p.Dv * Δv .+ p.ϵ * (u_mat .+ p.a .- p.b .* v_mat)
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ Function for visualization for the output of run_simulation
|
||||||
# Returns
|
# Returns
|
||||||
- ``: Displays created figure
|
- ``: Displays created figure
|
||||||
"""
|
"""
|
||||||
function step_through_solution(sol::SolutionType, N::Int)
|
function step_through_solution(sol, 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