Skip to content

Commit eafe44d

Browse files
committed
fix docs example
1 parent a172640 commit eafe44d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/src/tutorials/disturbance_modeling.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ y &= g(x, u, p, t)
119119
\end{aligned}
120120
```
121121

122-
To make use of the model defined above for state estimation, we may want to generate a Julia functions for the dynamics ``f`` and the output equations ``g`` that we can plug into, e.g., a nonlinear version of a Kalman filter or a particle filter, etc. MTK contains utilities to do this, namely, [`generate_control_function`](@ref) and [`build_explicit_observed_function`](@ref) (described in more details in ["Input output"](@ref inputoutput)). These functions take keyword arguments `disturbance_inputs` and `disturbance_argument`, that indicate which variables in the model are considered part of ``w``, and whether or not these variables are to be added as function arguments to ``f``, i.e., whether we have ``f(x, u, p, t)`` or ``f(x, u, p, t, w)``. If we do not include the disturbance inputs as function arguments, MTK will assume that the ``w`` variables are all zero, but any dynamics associated with these variables, such as disturbance models, will be included in the generated function. This allows a state estimator to estimate the state of the disturbance model, provided that this state is [observable](https://en.wikipedia.org/wiki/Observability) from the measured outputs of the system.
122+
To make use of the model defined above for state estimation, we may want to generate a Julia function for the dynamics ``f`` and the output equations ``g`` that we can plug into, e.g., a nonlinear version of a Kalman filter or a particle filter, etc. MTK contains utilities to do this, namely, [`generate_control_function`](@ref) and [`build_explicit_observed_function`](@ref) (described in more details in ["Input output"](@ref inputoutput)). These functions take keyword arguments `disturbance_inputs` and `disturbance_argument`, that indicate which variables in the model are considered part of ``w``, and whether or not these variables are to be added as function arguments to ``f``, i.e., whether we have ``f(x, u, p, t)`` or ``f(x, u, p, t, w)``. If we do not include the disturbance inputs as function arguments, MTK will assume that the ``w`` variables are all zero, but any dynamics associated with these variables, such as disturbance models, will be included in the generated function. This allows a state estimator to estimate the state of the disturbance model, provided that this state is [observable](https://en.wikipedia.org/wiki/Observability) from the measured outputs of the system.
123123

124124
Below, we demonstrate
125125

@@ -196,7 +196,7 @@ p = MTKParameters(io_sys, op)
196196
u = zeros(1) # Control input
197197
w = zeros(length(disturbance_inputs)) # Disturbance input
198198
@test f_oop(x0, u, p, t, w) == zeros(5)
199-
@test g(x, u, p, 0.0) == [0, 0, 0, 0]
199+
@test g(x0, u, p, 0.0) == [0, 0, 0, 0]
200200
201201
# Non-zero disturbance inputs should result in non-zero state derivatives. We call `sort` since we do not generally know the order of the state variables
202202
w = [1.0, 2.0]

0 commit comments

Comments
 (0)