Skip to content

Commit 25eadc5

Browse files
authored
Display elided benchmark macro output for Documenter
1 parent b8ce435 commit 25eadc5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

docs/src/calibrate/calibration.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ info = DocInfo.Info()
77

88
Let's see how to calibrate a glacial flow Decapode model's parameters to fit some data. We want to solve the inverse problem, i.e. given a model and some data, find a set of parameters that causes the output of the model to match the given data as closely as possible.
99

10-
We'll be using a 2D version of the Halfar glacial flow model, for more explanation see the [glacial flow docs page.](../ice_dynamics/ice_dynamics.md).
10+
We'll be using a 2D version of the Halfar glacial flow model, for more explanation see the [glacial flow docs page](../ice_dynamics/ice_dynamics.md).
1111

1212
In order to set up the inverse problem, we first need our model and some reference data. So, we'll set up the 2D glacial flow model and get some data from it. In this case we'll be fitting our model parameters to data from the model itself. In general the data we want to fit to will not be from the model, but for demonstration purposes this works well.
1313

@@ -187,14 +187,16 @@ First, let's solve the ODE with sparsity not used.
187187

188188
```@example Calibration
189189
no_sparse_prob_2D = ODEProblem(f_2D, u02D, (0, tₑ), constants_and_parameters)
190-
@btime no_sparse_soln_2D = solve(no_sparse_prob_2D, Rodas5P(autodiff = AutoForwardDiff()))
190+
no_sparse_soln_2D, exec_time_seconds, _, _, _ = @btimed = solve(no_sparse_prob_2D, Rodas5P(autodiff = AutoForwardDiff()))
191+
no_sparse_soln_2D.retcode, exec_time_seconds
191192
```
192193

193194
Now the same problem but with the sparsity pattern and Jacobian coloring taken in to account.
194195
```@example Calibration
195196
sparse_f_2D = ODEFunction(f_2D, sparsity = jac_sparsity_2D, colorvec = column_colors(jac_colors_2D))
196197
sparse_prob_2D = ODEProblem(sparse_f_2D,u02D,(0,tₑ), constants_and_parameters)
197-
@btime sparse_soln_2D = solve(sparse_prob_2D, Rodas5P(autodiff = AutoForwardDiff()))
198+
sparse_soln_2D, exec_time_seconds, _, _, _ = @btimed solve(sparse_prob_2D, Rodas5P(autodiff = AutoForwardDiff()))
199+
sparse_soln_2D.retcode, exec_time_seconds
198200
```
199201

200202
We can see quite a performance increase!

0 commit comments

Comments
 (0)