Compare commits
4 Commits
8271b23e52
...
dd3f2d6aab
| Author | SHA1 | Date |
|---|---|---|
|
|
dd3f2d6aab | |
|
|
5df5384285 | |
|
|
2ab795ccad | |
|
|
951574e788 |
|
|
@ -1,7 +1,5 @@
|
|||
# SCJ_Projekt
|
||||
|
||||
# SCJ Projekt
|
||||
|
||||
## Installation
|
||||
|
||||
1. **Aktiviere das Projekt**:
|
||||
|
|
@ -21,4 +19,8 @@ es steht erstmal nur so ein möglicher Projekt Dateiaufbau
|
|||
|
||||
## Nutzung
|
||||
|
||||
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.
|
||||
```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!
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ using GLMakie
|
|||
|
||||
using .Visualization
|
||||
|
||||
# GSParams AND FHNParams
|
||||
# CombinedPDEParams
|
||||
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[]))
|
||||
|
||||
# need so params in param_boxes are updated
|
||||
# needed 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
|
||||
|
|
|
|||
|
|
@ -1,9 +1,5 @@
|
|||
|
||||
|
||||
abstract type PDEParams end
|
||||
|
||||
|
||||
struct CombinedPDEParams <: PDEParams
|
||||
# This struct includes all parameters needed for FHN and GrayScott
|
||||
struct CombinedPDEParams
|
||||
N::Int
|
||||
dx::Float64
|
||||
Du::Float64
|
||||
|
|
|
|||
|
|
@ -79,7 +79,8 @@ 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
|
||||
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:
|
||||
- `state`: activator and inhibitor matrices
|
||||
|
|
@ -111,14 +112,18 @@ end
|
|||
function build_ui(U, V, param_obs_map::NamedTuple, params_obs, heat_obs)
|
||||
|
||||
reset!(U, V, heat_obs)
|
||||
fig = Figure(size=(1300, 950))
|
||||
fig = Figure(size=(1500, 950))
|
||||
|
||||
gh = GridLayout(fig[1, 1])
|
||||
dropdown = Menu(fig, options=collect(zip(["Gray-Scott", "FHN"], [:gray_scott, :fhn])))
|
||||
gh[1, 1] = dropdown
|
||||
ax = Axis(gh[2, 1])
|
||||
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")
|
||||
|
||||
hm = Makie.heatmap!(ax, heat_obs, colormap=:viridis)
|
||||
deactivate_interaction!(ax, :rectanglezoom)
|
||||
ax.aspect = DataAspect()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue