From a313cd7979b5a6e8d0f7cc03c4b82a19f60a5923 Mon Sep 17 00:00:00 2001 From: 2211567 Date: Tue, 17 Jun 2025 18:21:08 +0200 Subject: [PATCH] removed unused function, adjusted color of btn_waves --- src/fhn_solver.jl | 71 -------------------------------------------- src/visualization.jl | 2 +- 2 files changed, 1 insertion(+), 72 deletions(-) diff --git a/src/fhn_solver.jl b/src/fhn_solver.jl index 2f8b7ec..c493932 100644 --- a/src/fhn_solver.jl +++ b/src/fhn_solver.jl @@ -9,77 +9,6 @@ using Observables using ..Constants using .Laplacian -""" - 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. - - # 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 -""" -# function fhn!(du, u, p::CombinedPDEParams, t) -# N = p.N -# u_mat = reshape(u[1:N^2], N, N) -# v_mat = reshape(u[N^2+1:end], N, N) - -# Δu = laplacian(u_mat, p.dx) -# Δv = laplacian(v_mat, p.dx) - -# u_in = u_mat[2:end-1, 2:end-1] -# v_in = v_mat[2:end-1, 2:end-1] - -# fu = p.Du * Δu .+ u_in .- u_in .^ 3 ./ 3 .- v_in -# fv = p.Dv * Δv .+ p.ϵ * (u_in .+ p.a .- p.b .* v_in) - -# # Construct output with zero boundary (padding) -# fu_full = zeros(N, N) -# fv_full = zeros(N, N) -# fu_full[2:end-1, 2:end-1] .= fu -# fv_full[2:end-1, 2:end-1] .= fv - -# du .= vcat(vec(fu_full), vec(fv_full)) -# end - -# function step_fhn!(U, V, params_obs::Observable; dx=1) -# p = params_obs[] - -# # Flatten initial condition (activation u, recovery v) -# u0 = vec(U) -# v0 = vec(V) -# u_init = vcat(u0, v0) - -# # Define one integration step using your fhn! function -# prob = ODEProblem((du, u, p, t) -> fhn!(du, u, p, t), u_init, (0.0, 0.1), p) -# sol = solve(prob, BS3(); save_start=false, saveat=10.0) - -# # Extract solution and reshape -# u_new = reshape(sol[end][1:p.N^2], p.N, p.N) -# v_new = reshape(sol[end][p.N^2+1:end], p.N, p.N) - -# # Update matrices in-place -# U .= u_new -# V .= v_new - -# # Apply periodic boundary conditions -# U[1, :] .= U[end-1, :] -# U[end, :] .= U[2, :] -# U[:, 1] .= U[:, end-1] -# U[:, end] .= U[:, 2] - -# V[1, :] .= V[end-1, :] -# V[end, :] .= V[2, :] -# V[:, 1] .= V[:, end-1] -# V[:, end] .= V[:, 2] - -# return U -# end function step_fhn!(U, V, params_obs::Observable; dx=1, dt=0.01) p = params_obs[] diff --git a/src/visualization.jl b/src/visualization.jl index 5234d5a..adeb0cd 100644 --- a/src/visualization.jl +++ b/src/visualization.jl @@ -174,7 +174,7 @@ function build_ui(U, V, param_obs_map::NamedTuple, params_obs, heat_obs) # add column to center of matrix U, V = Templates.blocks_ic(params_obs[].N) - hm.colormap[] = :viridis + hm.colormap[] = :seismic # change params param_obs_map.Du[] = 0.0008