Skip to content

Commit df1150c

Browse files
committed
[skip ci] docstring spelling
1 parent 8df9511 commit df1150c

22 files changed

+67
-67
lines changed

docs/src/basics/AbstractSystem.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ model manipulation and compilation.
1010
### Subtypes
1111

1212
There are three immediate subtypes of `AbstractSystem`, classified by how many independent variables each type has:
13-
* `AbstractTimeIndependentSystem`: has no independent variable (eg: `NonlinearSystem`)
14-
* `AbstractTimeDependentSystem`: has a single independent variable (eg: `ODESystem`)
15-
* `AbstractMultivariateSystem`: may have multiple independent variables (eg: `PDESystem`)
13+
* `AbstractTimeIndependentSystem`: has no independent variable (e.g.: `NonlinearSystem`)
14+
* `AbstractTimeDependentSystem`: has a single independent variable (e.g.: `ODESystem`)
15+
* `AbstractMultivariateSystem`: may have multiple independent variables (e.g.: `PDESystem`)
1616

1717
## Constructors and Naming
1818

1919
The `AbstractSystem` interface has a consistent method for constructing systems.
20-
Generally it follows the order of:
20+
Generally, it follows the order of:
2121

2222
1. Equations
2323
2. Independent Variables
@@ -28,15 +28,15 @@ All other pieces are handled via keyword arguments. `AbstractSystem`s share the
2828
same keyword arguments, which are:
2929

3030
- `system`: This is used for specifying subsystems for hierarchical modeling with
31-
reusable components. For more information, see the [components page](@ref components)
31+
reusable components. For more information, see the [components page](@ref components).
3232
- Defaults: Keyword arguments like `defaults` are used for specifying default
3333
values which are used. If a value is not given at the `SciMLProblem` construction
3434
time, its numerical value will be the default.
3535

3636
## Composition and Accessor Functions
3737

3838
Each `AbstractSystem` has lists of variables in context, such as distinguishing
39-
parameters vs states. In addition, an `AbstractSystem` also can hold other
39+
parameters vs states. In addition, an `AbstractSystem` can also hold other
4040
`AbstractSystem` types. Direct accessing of the values, such as `sys.states`,
4141
gives the immediate list, while the accessor functions `states(sys)` gives the
4242
total set, which includes that of all systems held inside.
@@ -118,7 +118,7 @@ patterns via an abstract interpretation without requiring differentiation.
118118

119119
At the end, the system types have `DEProblem` constructors, like `ODEProblem`,
120120
which allow for directly generating the problem types required for numerical
121-
methods. The first argument is always the `AbstractSystem`, and the proceeding
121+
methods. The first argument is always the `AbstractSystem`, and the proceding
122122
arguments match the argument order of their original constructors. Whenever an
123123
array would normally be provided, such as `u0` the initial condition of an
124124
`ODEProblem`, it is instead replaced with a variable map, i.e., an array of

docs/src/basics/Composition.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ u0 = [
109109

110110
Note that any default values within the given subcomponent will be
111111
used if no override is provided at construction time. If any values for
112-
initial conditions or parameters are unspecified an error will be thrown.
112+
initial conditions or parameters are unspecified, an error will be thrown.
113113

114114
When the model is numerically solved, the solution can be accessed via
115115
its symbolic values. For example, if `sol` is the `ODESolution`, one
@@ -281,7 +281,7 @@ When modeling, e.g., impacts, saturations or Coulomb friction, the dynamic
281281
equations are discontinuous in either the state or one of its derivatives. This
282282
causes the solver to take very small steps around the discontinuity, and
283283
sometimes leads to early stopping due to `dt <= dt_min`. The correct way to
284-
handle such dynamics is to tell the solver about the discontinuity by means of a
284+
handle such dynamics is to tell the solver about the discontinuity by a
285285
root-finding equation, which can be modeling using [`ODESystem`](@ref)'s event
286286
support. Please see the tutorial on [Callbacks and Events](@ref events) for
287287
details and examples.

docs/src/basics/ContextualVariables.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ the `@variable` which is defined by
1010
@variables x y(x)
1111
```
1212

13-
This is used for the "normal" variable of a given system, like the states of a
14-
differential equation or objective function. All of the macros below support
13+
This is used for the normal variable of a given system, like the states of a
14+
differential equation or objective function. All the macros below support
1515
the same syntax as `@variables`.
1616

1717
## Parameters
@@ -28,11 +28,11 @@ Constants are like parameters that:
2828
- do not show up in the list of parameters of a system.
2929

3030
The intended use-cases for constants are:
31-
- representing literals (eg, π) symbolically, which results in cleaner
31+
- representing literals (e.g., π) symbolically, which results in cleaner
3232
Latexification of equations (avoids turning `d ~ 2π*r` into `d = 6.283185307179586 r`)
3333
- allowing auto-generated unit conversion factors to live outside the list of
3434
parameters
35-
- representing fundamental constants (eg, speed of light `c`) that should never
35+
- representing fundamental constants (e.g., speed of light `c`) that should never
3636
be adjusted inadvertently.
3737

3838
## Wildcard Variable Arguments
@@ -48,7 +48,7 @@ need to be able to write `u(t, 0.0)` to define a boundary condition at `x = 0`.
4848

4949
## Variable metadata [Experimental/TODO]
5050

51-
In many engineering systems some variables act like "flows" while others do not.
51+
In many engineering systems, some variables act like flows while others do not.
5252
For example, in circuit models you have current which flows, and the related
5353
voltage which does not. Or in thermal models you have heat flows. In these cases,
5454
the `connect` statement enforces conservation of flow between all of the connected

docs/src/basics/Events.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ for more detail.
2121
Events involve both a *condition* function (for the zero crossing or truth
2222
test), and an *affect* function (for determining how to update the system when
2323
the event occurs). These can both be specified symbolically, but a more [general
24-
functional affect](@ref func_affects) representation is also allowed as described
24+
functional affect](@ref func_affects) representation is also allowed, as described
2525
below.
2626

2727
## Continuous Events
@@ -35,7 +35,7 @@ In the former, equations that evaluate to 0 will represent conditions that shoul
3535
be detected by the integrator, for example to force stepping to times of
3636
discontinuities. The latter allow modeling of events that have an effect on the
3737
state, where the first entry in the `Pair` is a vector of equations describing
38-
event conditions, and the second vector of equations describe the effect on the
38+
event conditions, and the second vector of equations describes the effect on the
3939
state. Each affect equation must be of the form
4040
```julia
4141
single_state_variable ~ expression_involving_any_variables_or_parameters
@@ -155,7 +155,7 @@ that are provided in the `u` and `p` arguments (implemented as `NamedTuple`s).
155155
The integrator can also be manipulated more generally to control solution
156156
behavior, see the [integrator
157157
interface](https://docs.sciml.ai/DiffEqDocs/stable/basics/integrator/)
158-
documentation. In affect functions we have that
158+
documentation. In affect functions, we have that
159159
```julia
160160
function affect!(integ, u, p, ctx)
161161
# integ.t is the current time
@@ -208,7 +208,7 @@ individual affect should be executed. Here `affect1` and `affect2` are each
208208
either a vector of one or more symbolic equations, or a functional affect, just
209209
as for continuous events. As before, for any *one* event the symbolic affect
210210
equations can either all change states (i.e. variables) or all change
211-
parameters, but one can not currently mix state and parameter changes within one
211+
parameters, but one cannot currently mix state and parameter changes within one
212212
individual event.
213213

214214
### Example: Injecting cells into a population
@@ -234,7 +234,7 @@ plot(sol)
234234

235235
Notice, with generic discrete events that we want to occur at one or more fixed
236236
times, we need to also set the `tstops` keyword argument to `solve` to ensure
237-
the integrator stops at that time. In the next section we show how one can
237+
the integrator stops at that time. In the next section, we show how one can
238238
avoid this by using a preset-time callback.
239239

240240
Note that more general logical expressions can be built, for example, suppose we
@@ -252,7 +252,7 @@ plot(sol)
252252
Since the solution is *not* smaller than half its steady-state value at the
253253
event time, the event condition now returns false. Here we used logical and,
254254
`&`, instead of the short-circuiting logical and, `&&`, as currently the latter
255-
can not be used within symbolic expressions.
255+
cannot be used within symbolic expressions.
256256

257257
Let's now also add a drug at time `tkill` that turns off production of new
258258
cells, modeled by setting `α = 0.0`
@@ -275,7 +275,7 @@ plot(sol)
275275
```
276276

277277
### Periodic and preset-time events
278-
Two important sub-classes of discrete events are periodic and preset-time
278+
Two important subclasses of discrete events are periodic and preset-time
279279
events.
280280

281281
A preset-time event is triggered at specific set times, which can be

docs/src/basics/FAQ.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pnew = varmap_to_vars([β=>3.0, c=>10.0, γ=>2.0],parameters(sys))
2727
For statements that are in the `if then else` form, use `IfElse.ifelse` from the
2828
[IfElse.jl](https://github.com/SciML/IfElse.jl) package to represent the code in a
2929
functional form. For handling direct `if` statements, you can use equivalent boolean
30-
mathematical expressions. For example `if x > 0 ...` can be implemented as just
30+
mathematical expressions. For example, `if x > 0 ...` can be implemented as just
3131
`(x > 0) * `, where if `x <= 0` then the boolean will evaluate to `0` and thus the
3232
term will be excluded from the model.
3333

@@ -47,7 +47,7 @@ such as `@register_symbolic`, are described in detail
4747
## Using ModelingToolkit with Optimization / Automatic Differentiation
4848

4949
If you are using ModelingToolkit inside a loss function and are having issues with
50-
mixing MTK with automatic differentiation, getting performance, etc... don't! Instead, use
50+
mixing MTK with automatic differentiation, getting performance, etc don't! Instead, use
5151
MTK outside the loss function to generate the code, and then use the generated code
5252
inside the loss function.
5353

@@ -64,7 +64,7 @@ end
6464
Since `ODEProblem` on a MTK `sys` will have to generate code, this will be slower than
6565
caching the generated code, and will require automatic differentiation to go through the
6666
code generation process itself. All of this is unnecessary. Instead, generate the problem
67-
once outside the loss function, and remake the prob inside of the loss function:
67+
once outside the loss function, and remake the prob inside the loss function:
6868

6969
```julia
7070
prob = ODEProblem(sys, [], [p1 => p[1], p2 => p[2]])

docs/src/basics/Linearization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ eqs = [u ~ kp * (r - y) # P controller
2828
matrices, simplified_sys = linearize(sys, [r], [y]) # Linearize from r to y
2929
matrices
3030
```
31-
The named tuple `matrices` contains the matrices of the linear statespace representation, while `simplified_sys` is an `ODESystem` that, amongst other things, indicates the state order in the linear system through
31+
The named tuple `matrices` contains the matrices of the linear statespace representation, while `simplified_sys` is an `ODESystem` that, among other things, indicates the state order in the linear system through
3232
```@example LINEARIZE
3333
using ModelingToolkit: inputs, outputs
3434
[states(simplified_sys); inputs(simplified_sys); outputs(simplified_sys)]

docs/src/basics/Validation.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ ModelingToolkit.jl provides extensive functionality for model validation and uni
44

55
## Assigning Units
66

7-
Units may assigned with the following syntax.
7+
Units may be assigned with the following syntax.
88

99
```@example validation
1010
using ModelingToolkit, Unitful
@@ -30,7 +30,7 @@ Do not use `quantities` such as `1u"s"`, `1/u"s"` or `u"1/s"` as these will res
3030

3131
## Unit Validation & Inspection
3232

33-
Unit validation of equations happens automatically when creating a system. However, for debugging purposes one may wish to validate the equations directly using `validate`.
33+
Unit validation of equations happens automatically when creating a system. However, for debugging purposes, one may wish to validate the equations directly using `validate`.
3434

3535
```@docs
3636
ModelingToolkit.validate
@@ -61,7 +61,7 @@ ModelingToolkit.validate(eqs[1])
6161
ModelingToolkit.get_unit(eqs[1].rhs)
6262
```
6363

64-
An example of an inconsistent system: at present, `ModelingToolkit` requires that the units of all terms in an equation or sum to be equal-valued (`ModelingToolkit.equivalent(u1,u2)`), rather that simply dimensionally consistent. In the future, the validation stage may be upgraded to support the insertion of conversion factors into the equations.
64+
An example of an inconsistent system: at present, `ModelingToolkit` requires that the units of all terms in an equation or sum to be equal-valued (`ModelingToolkit.equivalent(u1,u2)`), rather than simply dimensionally consistent. In the future, the validation stage may be upgraded to support the insertion of conversion factors into the equations.
6565

6666
```@example validation
6767
using ModelingToolkit, Unitful

docs/src/basics/Variable_metadata.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ istunable(Kp)
7575

7676
## Probability distributions
7777
A probability distribution may be associated with a parameter to indicate either
78-
uncertainty about it's value, or as a prior distribution for Bayesian optimization.
78+
uncertainty about its value, or as a prior distribution for Bayesian optimization.
7979

8080
```julia
8181
using Distributions
@@ -88,7 +88,7 @@ getdist(m)
8888
```
8989

9090
## Additional functions
91-
For systems that contain parameters with metadata like described above have some additional functions defined for convenience.
91+
For systems that contain parameters with metadata like described above, have some additional functions defined for convenience.
9292
In the example below, we define a system with tunable parameters and extract bounds vectors
9393

9494
```@example metadata

docs/src/systems/PDESystem.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,21 @@ as a finite difference method with constant grid spacing, to something as comple
1111
as a distributed multi-GPU discontinuous Galerkin method.
1212

1313
The key to the common PDE interface is a separation of the symbolic handling from
14-
the numerical world. All of the discretizers should not "solve" the PDE, but
14+
the numerical world. All the discretizers should not solve the PDE, but
1515
instead be a conversion of the mathematical specification to a numerical problem.
1616
Preferably, the transformation should be to another ModelingToolkit.jl `AbstractSystem`,
1717
but in some cases this cannot be done or will not be performant, so a `SciMLProblem` is
1818
the other choice.
1919

2020
These elementary problems, such as solving linear systems `Ax=b`, solving nonlinear
2121
systems `f(x)=0`, ODEs, etc. are all defined by SciMLBase.jl, which then numerical
22-
solvers can all target these common forms. Thus someone who works on linear solvers
22+
solvers can all target these common forms. Thus, someone who works on linear solvers
2323
doesn't necessarily need to be working on a discontinuous Galerkin or finite element
2424
library, but instead "linear solvers that are good for matrices A with
2525
properties ..." which are then accessible by every other discretization method
2626
in the common PDE interface.
2727

28-
Similar to the rest of the `AbstractSystem` types, transformation and analysis
28+
Similar to the rest of the `AbstractSystem` types, transformation, and analysis
2929
functions will allow for simplifying the PDE before solving it, and constructing
3030
block symbolic functions like Jacobians.
3131

src/inputoutput.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ unbound_outputs(sys) = filter(x -> !is_bound(sys, x), outputs(sys))
5858
"""
5959
is_bound(sys, u)
6060
61-
Determine whether or not input/output variable `u` is "bound" within the system, i.e., if it's to be considered internal to `sys`.
61+
Determine whether input/output variable `u` is "bound" within the system, i.e., if it's to be considered internal to `sys`.
6262
A variable/signal is considered bound if it appears in an equation together with variables from other subsystems.
6363
The typical usecase for this function is to determine whether the input to an IO component is connected to another component,
6464
or if it remains an external input that the user has to supply before simulating the system.
@@ -111,7 +111,7 @@ end
111111
"""
112112
same_or_inner_namespace(u, var)
113113
114-
Determine whether or not `var` is in the same namespace as `u`, or a namespace internal to the namespace of `u`.
114+
Determine whether `var` is in the same namespace as `u`, or a namespace internal to the namespace of `u`.
115115
Example: `sys.u ~ sys.inner.u` will bind `sys.inner.u`, but `sys.u` remains an unbound, external signal. The namepsaced signal `sys.inner.u` lives in a namspace internal to `sys`.
116116
"""
117117
function same_or_inner_namespace(u, var)
@@ -149,7 +149,7 @@ end
149149
"""
150150
has_var(eq, x)
151151
152-
Determine whether or not an equation or expression contains variable `x`.
152+
Determine whether an equation or expression contains variable `x`.
153153
"""
154154
function has_var(eq::Equation, x)
155155
has_var(eq.rhs, x) || has_var(eq.lhs, x)

0 commit comments

Comments
 (0)