Skip to content

Commit

Permalink
improve docs (#146)
Browse files Browse the repository at this point in the history
* make output of build_function tutorial more readable

* bump version

* mention AverageVectorFieldMethod in docs

* fix printing of benchmarks

* update commend on Requires.jl

* fix docstring of energy_preserving_order
  • Loading branch information
ranocha authored Jun 28, 2023
1 parent 19a17e8 commit eab5783
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "BSeries"
uuid = "ebb8d67c-85b4-416c-b05f-5f409e808f32"
authors = ["Hendrik Ranocha <[email protected]> and contributors"]
version = "0.1.54"
version = "0.1.55"

[deps]
Combinatorics = "861a8166-3701-5b0c-9a16-15d98fcdc6aa"
Expand Down
3 changes: 2 additions & 1 deletion docs/src/benchmark_python_orderconditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@
print("", end_time - start_time, "seconds", file=io)


print("\nModifying integrator")
with open(io_file, 'a') as io:
print("\nModifying integrator", file=io)

start_time = time.time()
BSeries.set_order(up_to_order)
Expand Down
8 changes: 8 additions & 0 deletions docs/src/tutorials/bseries_creation.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,14 @@ series = bseries(5) do t, series
end
```

[BSeries.jl](https://github.com/ranocha/BSeries.jl) also offers a
convenience constructor using the type [`AverageVectorFieldMethod`](@ref)
as follows.

```@example ex:AVF
series == bseries(AverageVectorFieldMethod(), 5)
```

We can check that this method is second-order accurate by comparing it to
the B-series of the exact solution, truncated at the same order.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/tutorials/code_generation.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Finally, we generate a C function that evaluates the expressions above.


```@example code-generation
build_function(du, α, p, q, h, target = Symbolics.CTarget())
println(build_function(du, α, p, q, h, target = Symbolics.CTarget()))
```

The [Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl) function `build_function`
Expand Down
11 changes: 6 additions & 5 deletions src/BSeries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1394,7 +1394,8 @@ Internal function specialized on symbolic variables and expressions from
- [SymPy.jl](https://github.com/JuliaPy/SymPy.jl), and
- [Symbolics.jl](https://github.com/JuliaSymbolics/Symbolics.jl)
if these packages are loaded (via Requires.jl).
if these packages are loaded (via Requires.jl or weak dependencies on
Julia v1.9 and newer).
"""
function compute_derivative end

Expand Down Expand Up @@ -1546,12 +1547,12 @@ function renormalize!(series)
end

"""
energy_preserving(rk::RungeKuttaMethod, max_order)
energy_preserving_order(rk::RungeKuttaMethod, max_order)
This function checks up to which order a Runge-Kitta method 'rk' is
This function checks up to which order a Runge-Kutta method `rk` is
energy-preserving for Hamiltonian problems.
It requires a 'max_order' so that it does not run forever if the order up to
which the method is energy_preserving is too big or infinite.
It requires a `max_order` so that it does not run forever if the order up to
which the method is energy-preserving is too big or infinite.
See also [`is_energy_preserving`](@ref)
"""
Expand Down

2 comments on commit eab5783

@ranocha
Copy link
Owner Author

Choose a reason for hiding this comment

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

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

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

Registration pull request created: JuliaRegistries/General/86435

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.1.55 -m "<description of version>" eab578348695cf074f8c19e62d5932f305db6c68
git push origin v0.1.55

Please sign in to comment.