Compare commits
No commits in common. "dd3f2d6aab002fab19b91715cd9034c3ae87c7fc" and "8271b23e52831467404707179dd33e89ec9a08ae" have entirely different histories.
dd3f2d6aab
...
8271b23e52
|
|
@ -1,5 +1,7 @@
|
||||||
# SCJ_Projekt
|
# SCJ_Projekt
|
||||||
|
|
||||||
|
# SCJ Projekt
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
1. **Aktiviere das Projekt**:
|
1. **Aktiviere das Projekt**:
|
||||||
|
|
@ -19,8 +21,4 @@ es steht erstmal nur so ein möglicher Projekt Dateiaufbau
|
||||||
|
|
||||||
## Nutzung
|
## Nutzung
|
||||||
|
|
||||||
```bash
|
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.
|
||||||
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!
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ using GLMakie
|
||||||
|
|
||||||
using .Visualization
|
using .Visualization
|
||||||
|
|
||||||
# CombinedPDEParams
|
# GSParams AND FHNParams
|
||||||
N = 128
|
N = 128
|
||||||
dx = 1.0
|
dx = 1.0
|
||||||
params = (
|
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[]))
|
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
|
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)
|
params_obs[] = CombinedPDEParams(N, dx, Du, Dv, F, k, ϵ, a, b)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -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
|
N::Int
|
||||||
dx::Float64
|
dx::Float64
|
||||||
Du::Float64
|
Du::Float64
|
||||||
|
|
|
||||||
|
|
@ -79,8 +79,7 @@ end
|
||||||
"""
|
"""
|
||||||
multi_step!(state, n_steps, heat_obs::Observable, params_obs::Observable; step_method=step_gray_scott!, dx=1)
|
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.
|
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.
|
|
||||||
|
|
||||||
# Arguments:
|
# Arguments:
|
||||||
- `state`: activator and inhibitor matrices
|
- `state`: activator and inhibitor matrices
|
||||||
|
|
@ -112,18 +111,14 @@ end
|
||||||
function build_ui(U, V, param_obs_map::NamedTuple, params_obs, heat_obs)
|
function build_ui(U, V, param_obs_map::NamedTuple, params_obs, heat_obs)
|
||||||
|
|
||||||
reset!(U, V, heat_obs)
|
reset!(U, V, heat_obs)
|
||||||
fig = Figure(size=(1500, 950))
|
fig = Figure(size=(1300, 950))
|
||||||
|
|
||||||
gh = GridLayout(fig[1, 1])
|
gh = GridLayout(fig[1, 1])
|
||||||
dropdown = Menu(fig, options=collect(zip(["Gray-Scott", "FHN"], [:gray_scott, :fhn])))
|
dropdown = Menu(fig, options=collect(zip(["Gray-Scott", "FHN"], [:gray_scott, :fhn])))
|
||||||
gh[1, 1] = dropdown
|
gh[1, 1] = dropdown
|
||||||
plotgrid = GridLayout()
|
ax = Axis(gh[2, 1])
|
||||||
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")
|
|
||||||
|
|
||||||
|
hm = Makie.heatmap!(ax, heat_obs, colormap=:viridis)
|
||||||
deactivate_interaction!(ax, :rectanglezoom)
|
deactivate_interaction!(ax, :rectanglezoom)
|
||||||
ax.aspect = DataAspect()
|
ax.aspect = DataAspect()
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue