Skip to content

Commit

Permalink
Merge pull request #993 from SciML/fix_videe_display
Browse files Browse the repository at this point in the history
Fix spatial sim aniamtions in doc
  • Loading branch information
TorkelE authored Jul 21, 2024
2 parents 96e3fd8 + 878813f commit 683bcb7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
8 changes: 8 additions & 0 deletions docs/src/spatial_modelling/lattice_reaction_systems.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,14 @@ Finally, we can access "$X1$'s value across the simulation using
```@example spatial_intro_basics
lat_getu(sol, :X1, lrs)
```
and plot the simulation using
```@example spatial_intro_basics
import CairoMakie
lattice_animation(sol, :X1, lrs, "lattice_simulation_2d.mp4")
```
```@raw html
<video autoplay loop muted playsinline controls src="../lattice_simulation_2d.mp4" />
```
More information on how to retrieve values from spatial simulations can be found [here](@ref lattice_simulation_structure_interaction_simulation_species), and for plotting them, [here](@ref lattice_simulation_plotting). Finally, a list of functions for querying `LatticeReactionSystems` for various properties can be found [here](@ref api_lattice_simulations).

## [Spatial reactions](@id spatial_lattice_modelling_intro_spatial_reactions)
Expand Down
4 changes: 2 additions & 2 deletions docs/src/spatial_modelling/lattice_simulation_plotting.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ If we instead wish to create an animation of our solution across the entire simu
lattice_animation(sol, :X1, lrs, "lattice_simulation_1d.mp4")
```
```@raw html
<video autoplay loop muted playsinline controls src="./lattice_simulation_1d.mp4" />
<video autoplay loop muted playsinline controls src="../lattice_simulation_1d.mp4" />
```
Since we animate the solution across the entire simulation, we do not need to provide a `t` value. However, there are some additional (optional) arguments we might wish to provide:
- `nframes = 200`: The number of frames in the animation (these are evenly samples across the simulation).
Expand Down Expand Up @@ -91,7 +91,7 @@ An animation of the solution can be created in a similar manner as for [the one-
lattice_animation(sol, :X, lrs, "lattice_simulation_2d.mp4")
```
```@raw html
<video autoplay loop muted playsinline controls src="./lattice_simulation_2d.mp4" />
<video autoplay loop muted playsinline controls src="../lattice_simulation_2d.mp4" />
```

Again, please check the API pages for the [`lattice_plot`](@ref) and [`lattice_animation`](@ref) functions to see more details of their various options.
Expand Down

0 comments on commit 683bcb7

Please sign in to comment.