Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Jan 24, 2018
2 parents c6c2e5d + 91733f5 commit f50add2
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/src/analysis/bifurcation.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ p = [-60,120,0.0,2,4,20,-1.2,18]
Then we use the following command to build the PyDSTool ODE:

```julia
dsargs = build_ode(f,u0,tspan)
dsargs = build_ode(f,u0,tspan,p)
```

Now we need to build the continuation type. Following the setup of PyDSTool's
Expand Down
8 changes: 8 additions & 0 deletions docs/src/analysis/parameter_estimation.md
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,14 @@ p = [1.5,1.0,3.0,1.0]
prob = ODEProblem(f2,u0,tspan,p)
```

We can build an objective function and solve the multiple parameter version just as before:

```julia
cost_function = build_loss_objective(prob,Tsit5(),CostVData(t,data),
maxiters=10000,verbose=false)
result_bfgs = Optim.optimize(cost_function, [1.3,0.8,2.8,1.2], Optim.BFGS())
```

To solve it using LeastSquaresOptim.jl, we use the `build_lsoptim_objective` function:

```julia
Expand Down
9 changes: 4 additions & 5 deletions docs/src/analysis/sensitivity.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ for the Lotka-Volterra equations by:
```julia
f = @ode_def_nohes LotkaVolterraSensitivity begin
dx = a*x - b*x*y
dy = -c*y + d*x*y
end a b c d
dy = -c*y + x*y
end a b c

p = [1.5,1.0,3.0,1.0]
p = [1.5,1.0,3.0]
prob = ODELocalSensitivityProblem(f,[1.0;1.0],(0.0,10.0),p)
```

Expand Down Expand Up @@ -135,8 +135,7 @@ autodifferentiation and numerical differentiation through the ODE solver:
```julia
using ForwardDiff, Calculus
function test_f(p)
pf = ParameterizedFunction(f,p)
prob = ODEProblem(pf,eltype(p).([1.0,1.0]),eltype(p).((0.0,10.0)))
prob = ODEProblem(f,eltype(p).([1.0,1.0]),eltype(p).((0.0,10.0)),p)
solve(prob,Vern9(),abstol=1e-14,reltol=1e-14,save_everystep=false)[end]
end

Expand Down
9 changes: 0 additions & 9 deletions docs/src/types/bvp_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@ bc!(residual, sol, p)
where `u` is the current solution to the ODE which is used to compute the `residual`.
Note that all features of the `ODESolution` are present in this form.
In both cases, the size of the residual matches the size of the initial condition.
For more general problems, use the
[parameter estimation routines](../../analysis/parameter_estimation.html) and change the signature of `bc!` and `f` to

```julia
bc!(residual, sol, p)
f(t, u, p) # or inplace as f(t, u, p, du)
```

where `p`is the `Vector` of free parameters.

### Fields

Expand Down
4 changes: 2 additions & 2 deletions docs/src/types/dynamical_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ These algorithms require a Partitioned ODE of the form:

```math
\frac{du}{dt} = f_1(v) \\
\frac{dv}{dt} = f_2(u,p,t) \\
\frac{dv}{dt} = f_2(u,t) \\
```
This is a Partitioned ODE partitioned into two groups, so the functions should be
specified as `f1(du,u,v,p,t)` and `f2(dv,u,v,p,t)` (in the inplace form), where `f1`
Expand Down Expand Up @@ -105,7 +105,7 @@ HamiltonianProblem{T}(H,q0,p0,tspan;kwargs...)

### Fields

* `H`: The Hamiltonian `H(q,p)` which returns a scalar.
* `H`: The Hamiltonian `H(q,p,params)` which returns a scalar.
* `q0`: The initial positions.
* `p0`: The initial momentums.
* `tspan`: The timespan for the problem.
Expand Down

0 comments on commit f50add2

Please sign in to comment.