Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sk/update basic examples and docstrings #96

Merged
merged 17 commits into from
Jul 15, 2024
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions docs/src/linear_advection.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,14 @@ nothing #hide
```@example LinearAdvection
using Plots

plot(x,u0)
plot!(x, last(sol.u))
plot(x, u0; label = "u0", xguide = "x", yguide = "u")
plot!(x, last(sol.u); label = "u")
```

### Using sparse matrices

TODO: Some text
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This TODO note is still open?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought we take care of this once the sparse matrices work as expected.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough 👍


```@example LinearAdvection
using SparseArrays
p_prototype = spdiagm(-1 => ones(eltype(u0), N - 1),
Expand All @@ -107,10 +111,15 @@ nothing #hide
```

```@example LinearAdvection
plot(x,u0)
plot!(x, last(sol_sparse.u))
plot(x,u0; label = "u0", xguide = "x", yguide = "u")
plot!(x, last(sol_sparse.u); label = "u")
```

### Performance comparison

Finally, we use [BenchmarkTools.jl](https://github.com/JuliaCI/BenchmarkTools.jl)
to compare the performance of the different implementations.

```@example LinearAdvection
using BenchmarkTools
@benchmark solve(prob, MPRK43I(1.0, 0.5); save_everystep = false)
Expand Down