Skip to content

Commit 4674b2b

Browse files
Fix linear problem documentation page
1 parent a163be6 commit 4674b2b

File tree

1 file changed

+28
-22
lines changed

1 file changed

+28
-22
lines changed

docs/src/basics/LinearProblem.md

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,50 @@
1-
# Nonlinear Problems
1+
# Linear Problems
22

33
## Mathematical Specification of a Nonlinear Problem
44

5-
To define a Nonlinear Problem, you simply need to give the function ``f``
6-
which defines the nonlinear system:
5+
### Concrete LinearProblem
6+
7+
To define a `LinearProblem`, you simply need to give the `AbstractMatrix` ``A``
8+
and an `AbstractVector` ``b`` which defines the linear system:
79

810
```math
9-
f(u,p) = 0
11+
A*u = b
1012
```
1113

12-
and an initial guess ``u₀`` of where `f(u,p)=0`. `f` should be specified as `f(u,p)`
13-
(or in-place as `f(du,u,p)`), and `u₀` should be an AbstractArray (or number)
14-
whose geometry matches the desired geometry of `u`. Note that we are not limited
15-
to numbers or vectors for `u₀`; one is allowed to provide `u₀` as arbitrary
16-
matrices / higher-dimension tensors as well.
14+
### Matrix-Free LinearProblem
15+
16+
For matrix-free versions, the specification of the problem is given by an
17+
operator `A(u,p,t)` which computes `A*u`, or in-place as `A(du,u,p,t)`. These
18+
are specified via the `AbstractSciMLOperator` interface. For more details, see
19+
the [SciMLBase Documentation](https://scimlbase.sciml.ai/dev/).
20+
21+
Note that matrix-free versions of LinearProblem definitions are not compatible
22+
with all solvers. To check a solver for compatibility, use the function xxxxx.
1723

1824
## Problem Type
1925

2026
### Constructors
2127

28+
Optionally, an initial guess ``u₀`` can be supplied which is used for iterative
29+
methods.
30+
2231
```julia
23-
NonlinearProblem(f::NonlinearFunction,u0,p=NullParameters();kwargs...)
24-
NonlinearProblem{isinplace}(f,u0,p=NullParameters();kwargs...)
32+
LinearProblem{isinplace}(A,x,p=NullParameters();u0=nothing,kwargs...)
33+
LinearProblem(f::AbstractDiffEqOperator,u0,p=NullParameters();u0=nothing,kwargs...)
2534
```
2635

27-
`isinplace` optionally sets whether the function is in-place or not. This is
28-
determined automatically, but not inferred.
36+
`isinplace` optionally sets whether the function is in-place or not, i.e. whether
37+
the solvers are allowed to mutate. By default this is true for `AbstractMatrix`,
38+
and for `AbstractSciMLOperator`s it matches the choice of the operator definition.
2939

3040
Parameters are optional, and if not given, then a `NullParameters()` singleton
3141
will be used, which will throw nice errors if you try to index non-existent
32-
parameters. Any extra keyword arguments are passed on to the solvers. For example,
33-
if you set a `callback` in the problem, then that `callback` will be added in
34-
every solve call.
35-
36-
For specifying Jacobians and mass matrices, see the [NonlinearFunctions](@ref nonlinearfunctions)
37-
page.
42+
parameters. Any extra keyword arguments are passed on to the solvers.
3843

3944
### Fields
4045

41-
* `f`: The function in the ODE.
42-
* `u0`: The initial guess for the steady state.
43-
* `p`: The parameters for the problem. Defaults to `NullParameters`.
46+
* `A`: The representation of the linear operator.
47+
* `b`: The right-hand side of the linear system.
48+
* `p`: The parameters for the problem. Defaults to `NullParameters`. Currently unused.
49+
* `u0`: The initial condition used by iterative solvers.
4450
* `kwargs`: The keyword arguments passed on to the solvers.

0 commit comments

Comments
 (0)