Skip to content

Commit 54a13cc

Browse files
committed
up
1 parent 83d2470 commit 54a13cc

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

docs/src/introduction_to_catalyst/catalyst_for_new_julia_users.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ typeof(1)
3737

3838
Finally, we note that the first time some code is run in Julia, it has to be *compiled*. However, this is only required once per Julia session. Hence, the second time the same code is run, it runs much faster. E.g. try running this line of code first one time, and then one additional time. You will note that the second run is much faster.
3939
```@example ex1
40-
rand(100, 100)^3.5;
40+
rand(100, 100)^3.5
41+
nothing # hide
4142
```
4243
(This code creates a random 100x100 matrix, and takes it to the power of 3.5)
4344

docs/src/inverse_problems/petab_ode_param_fitting.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ nothing # hide
103103
### Fitting parameters
104104
We are now able to fit our model to the data. First, we create a `PEtabODEProblem`. Here, we use `petab_model` as the only input, but it is also possible to set various [numeric solver and automatic differentiation options](@ref petab_simulation_options) (such as method or tolerance).
105105
```@example petab1
106+
petab_problem = PEtabODEProblem(petab_model; verbose=false); nothing # hide
107+
```
108+
```julia
106109
petab_problem = PEtabODEProblem(petab_model)
107-
nothing # hide
108110
```
109111
Since no additional input is given, default options are selected by PEtab.jl (and generally, its choices are good).
110112

@@ -380,11 +382,16 @@ While in our basic example, we do not provide any additional information to our
380382

381383
Here is an example, taken from the [more detailed PEtab.jl documentation](https://sebapersson.github.io/PEtab.jl/dev/Boehm/#Creating-a-PEtabODEProblem)
382384
```@example petab1
385+
PEtabODEProblem(petab_model,
386+
ode_solver=ODESolver(Rodas5P(), abstol=1e-8, reltol=1e-8),
387+
gradient_method=:ForwardDiff,
388+
hessian_method=:ForwardDiff, verbose=false); nothing # hide
389+
```
390+
```julia
383391
PEtabODEProblem(petab_model,
384392
ode_solver=ODESolver(Rodas5P(), abstol=1e-8, reltol=1e-8),
385393
gradient_method=:ForwardDiff,
386394
hessian_method=:ForwardDiff)
387-
nothing # hide
388395
```
389396
where we simulate our ODE model using the `Rodas5p` method (with absolute and relative tolerance both equal `1e-8`) and use [forward automatic differentiation](https://github.com/JuliaDiff/ForwardDiff.jl) for both gradient and hessian computation. More details on available ODE solver options can be found in [the PEtab.jl documentation](https://sebapersson.github.io/PEtab.jl/dev/API_choosen/#PEtab.ODESolver).
390397

@@ -411,8 +418,10 @@ This is required for the various [optimisation evaluation plots](@ref petab_plot
411418
## Objective function extraction
412419
While PEtab.jl provides various tools for analysing the objective function generated by `PEtabODEProblem`, it is also possible to extract this function for customised analysis. Given a `PEtabODEProblem`
413420
```@example petab1
421+
petab_problem = PEtabODEProblem(petab_model; verbose=false); nothing # hide
422+
```
423+
```julia
414424
petab_problem = PEtabODEProblem(petab_model)
415-
nothing # hide
416425
```
417426
We can find the:
418427
1. Objective function as the `petab_problem.compute_cost`. It takes a single argument (`p`) and returns the objective value.

0 commit comments

Comments
 (0)