Compare commits

..

No commits in common. "dd3f2d6aab002fab19b91715cd9034c3ae87c7fc" and "8271b23e52831467404707179dd33e89ec9a08ae" have entirely different histories.

4 changed files with 15 additions and 18 deletions

View File

@ -1,5 +1,7 @@
# SCJ_Projekt
# SCJ Projekt
## Installation
1. **Aktiviere das Projekt**:
@ -19,8 +21,4 @@ es steht erstmal nur so ein möglicher Projekt Dateiaufbau
## Nutzung
```bash
include("scripts/main.jl")
```
Wenn der obige Befehl in der REPL ausgeführt wird, öffnet sich mit **Makie** eine GUI, wo unser Produkt zu finden ist!
Wenn ihr `scripts/run_simulation.jl` ausführt, sollte sich mit **Makie** eine GUI öffnen, die einen **Slider** hat, mit dem man ein paar generierte Frames angucken kann.

View File

@ -6,7 +6,7 @@ using GLMakie
using .Visualization
# CombinedPDEParams
# GSParams AND FHNParams
N = 128
dx = 1.0
params = (
@ -23,7 +23,7 @@ params = (
params_obs = Observable{CombinedPDEParams}(CombinedPDEParams(N, dx, params.Du[], params.Dv[], params.F[], params.k[], params.ϵ[], params.a[], params.b[]))
# needed so params in param_boxes are updated
# need so params in param_boxes are updated
lift(params.N, params.dx, params.Du, params.Dv, params.F, params.k, params.ϵ, params.a, params.b) do N, dx, Du, Dv, F, k, ϵ, a, b
params_obs[] = CombinedPDEParams(N, dx, Du, Dv, F, k, ϵ, a, b)
end

View File

@ -1,5 +1,9 @@
# This struct includes all parameters needed for FHN and GrayScott
struct CombinedPDEParams
abstract type PDEParams end
struct CombinedPDEParams <: PDEParams
N::Int
dx::Float64
Du::Float64

View File

@ -79,8 +79,7 @@ end
"""
multi_step!(state, n_steps, heat_obs::Observable, params_obs::Observable; step_method=step_gray_scott!, dx=1)
returns a new matrix for the heatmap for n steps of computing with the corresponding step_method.
The step_methods have different names because switching models via multi-dispatching is too complex.
returns a new matrix for the heatmap for n steps of computing with the corresponding step_method
# Arguments:
- `state`: activator and inhibitor matrices
@ -112,18 +111,14 @@ end
function build_ui(U, V, param_obs_map::NamedTuple, params_obs, heat_obs)
reset!(U, V, heat_obs)
fig = Figure(size=(1500, 950))
fig = Figure(size=(1300, 950))
gh = GridLayout(fig[1, 1])
dropdown = Menu(fig, options=collect(zip(["Gray-Scott", "FHN"], [:gray_scott, :fhn])))
gh[1, 1] = dropdown
plotgrid = GridLayout()
gh[2, 1] = plotgrid
ax = Axis(plotgrid[1, 1])
hm = heatmap!(ax, heat_obs, colormap=:viridis)
plotgrid[1, 2] = Colorbar(fig, hm, label="Inhibitor ⇒ Activator")
ax = Axis(gh[2, 1])
hm = Makie.heatmap!(ax, heat_obs, colormap=:viridis)
deactivate_interaction!(ax, :rectanglezoom)
ax.aspect = DataAspect()