Skip to content

Commit

Permalink
LanguageTool
Browse files Browse the repository at this point in the history
  • Loading branch information
ArnoStrouwen committed Dec 29, 2023
1 parent d80b0d5 commit 0cf1623
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
14 changes: 7 additions & 7 deletions docs/src/tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ symbolic_container(sys::MySolutionWrapper) = sys.sol
Since `symbolic_container` will return the wrapped solution, all method calls such as
`is_parameter(sys::MySolutionWrapper, sym)` will be forwarded to `is_parameter(sys.sol, sym)`.

In case some methods need to function differently than those of the wrapped type, they can selectively
be defined. For example, suppose `MySolutionWrapper` does not support observed quantities. The following
In cases where some methods need to function differently than those of the wrapped type, they can be selectively
defined. For example, suppose `MySolutionWrapper` does not support observed quantities. The following
method can be defined (in addition to the one above):

```julia
Expand All @@ -33,8 +33,8 @@ is_observed(sys::MySolutionWrapper, sym) = false

## Defining the interface in its entirety

Not all of the methods in the interface are required. Some only need to be implemented if a type
supports specific functionality. Consider the following struct which needs to implement the interface:
Not all the methods in the interface are required. Some only need to be implemented if a type
supports specific functionality. Consider the following struct, which needs to implement the interface:

```julia
struct ExampleSolution
Expand Down Expand Up @@ -150,10 +150,10 @@ on a type that wraps this type. An example is `ModelingToolkit.AbstractSystem`,
can identify whether a value is observed, but cannot implement `observed` itself.

Other optional methods relate to parameter indexing. If a type contains the values of
parameter variables, it must implement [`parameter_values`](@ref). This will allow the
parameter variables, it must implement [`parameter_values`](@ref). This allows the
default definitions of [`getp`](@ref) and [`setp`](@ref) to work. While `setp` is
not typically useful for solution objects, it may be useful for integrators. Typically
the default implementations for `getp` and `setp` will suffice and manually defining
not typically useful for solution objects, it may be useful for integrators. Typically,
the default implementations for `getp` and `setp` will suffice, and manually defining
them is not necessary.

```julia
Expand Down
4 changes: 2 additions & 2 deletions docs/src/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ eqs = [D(D(x)) ~ σ * (y - x),
sys = structural_simplify(sys)
```

The system has 4 state variables, 3 parameters and one observed variable:
The system has 4 state variables, 3 parameters, and one observed variable:
```@example Usage
ModelingToolkit.observed(sys)
```
Expand Down Expand Up @@ -126,7 +126,7 @@ The updated parameter values can be checked using [`parameter_values`](@ref).
parameter_values(prob)
```

Solving the new system, note that the parameter getter functions still work on the new
When solving the new system, note that the parameter getter functions still work on the new
solution object.

```@example Usage
Expand Down
12 changes: 6 additions & 6 deletions src/interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Return a vector of the symbolic variables being solved for in the system `sys`.
the current time index. The returned vector should not be mutated.
For types that implement `Base.getindex` with symbolic indices using this interface,
The shorthand `sys[solvedvariables]` can be used as shorthand for
the shorthand `sys[solvedvariables]` can be used as shorthand for
`sys[variable_symbols(sys)]`. See: [`solvedvariables`](@ref).
"""
variable_symbols(sys) = variable_symbols(symbolic_container(sys))
Expand Down Expand Up @@ -88,10 +88,10 @@ is_observed(sys, sym) = is_observed(symbolic_container(sys), sym)
Return the observed function of the given `sym` in `sys`. The returned function should
have the signature `(u, p) -> [values...]` where `u` and `p` is the current state and
parameter vector. If `istimedependent(sys) == true`, the function should accept
parameter vector, respectively. If `istimedependent(sys) == true`, the function should accept
the current time `t` as its third parameter. If `constant_structure(sys) == false`,
accept a third parameter which can either be a vector of symbols indicating the order
of states or a time index which identifies the order of states.
accept a third parameter, which can either be a vector of symbols indicating the order
of states or a time index, which identifies the order of states.
See also: [`is_time_dependent`](@ref), [`constant_structure`](@ref)
"""
Expand Down Expand Up @@ -137,7 +137,7 @@ struct SolvedVariables end
"""
const solvedvariables = SolvedVariables()
This singleton is used as a shortcut to allow indexing all solution variables
This singleton is used as a shortcut to allow indexing of all solution variables
(excluding observed quantities). It has a [`symbolic_type`](@ref) of
[`ScalarSymbolic`](@ref). See: [`variable_symbols`](@ref).
"""
Expand All @@ -149,7 +149,7 @@ struct AllVariables end
"""
const allvariables = AllVariables()
This singleton is used as a shortcut to allow indexing all solution variables
This singleton is used as a shortcut to allow indexing of all solution variables
(including observed quantities). It has a [`symbolic_type`](@ref) of
[`ScalarSymbolic`](@ref). See [`all_variable_symbols`](@ref).
"""
Expand Down
2 changes: 1 addition & 1 deletion src/parameter_indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ end
"""
setp(sys, p)
Return a function that takes an integrator of `sys` and a value, and sets the
Return a function that takes an integrator of `sys` and a value, and sets
the parameter `p` to that value. Note that `p` can be a direct numerical index or a
symbolic value. Requires that the integrator implement [`parameter_values`](@ref) and the
returned collection be a mutable reference to the parameter vector in the integrator. In
Expand Down
4 changes: 2 additions & 2 deletions src/symbol_cache.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
function SymbolCache(vars, [params, [indepvars]])
A struct implementing the symbolic indexing interface for the trivial case
of having a vector of variables, parameters and independent variables. This
of having a vector of variables, parameters, and independent variables. This
struct does not implement `observed`, and `is_observed` returns `false` for
all input symbols. It is considered to be time dependent if it contains
all input symbols. It is considered time dependent if it contains
at least one independent variable.
The independent variable may be specified as a single symbolic variable instead of an
Expand Down

0 comments on commit 0cf1623

Please sign in to comment.