@@ -67,10 +67,10 @@ functions are defined as:
6767 \m athbf{y}(t) &= \m athbf{h}\B ig( \m athbf{x}(t), \m athbf{d}(t), \m athbf{p} \B ig)
6868\e nd{aligned}
6969```
70- where ``\m athbf{x}``, ``\m athbf{y}, ``\m athbf{u}``, ``\m athbf{d}`` and ``\m athbf{p}`` are
71- respectively the state, output, manipulated input, measured disturbance and parameter vectors,
72- and ``t`` the time in second . If the dynamics is a function of time, simply add a measured
73- disturbance defined as ``d(t)= t``. The functions can be implemented in two possible ways:
70+ where ``\m athbf{x}``, ``\m athbf{y}`` , ``\m athbf{u}``, ``\m athbf{d}`` and ``\m athbf{p}`` are
71+ respectively the state, output, manipulated input, measured disturbance and parameter
72+ vectors . If the dynamics is a function of time, simply add a measured disturbance defined as
73+ ``d(t) = t``. The functions can be implemented in two possible ways:
7474
75751. **Non-mutating functions** (out-of-place): define them as `f(x, u, d, p) -> ẋ` and
7676 `h(x, d, p) -> y`. This syntax is simple and intuitive but it allocates more memory.
@@ -99,11 +99,11 @@ See also [`LinModel`](@ref).
9999
100100# Examples
101101```jldoctest
102- julia> f!(ẋ, x, u, _ , _ ) = (ẋ .= -0.2x .+ u; nothing);
102+ julia> f!(ẋ, x, u, _ , p ) = (ẋ .= p*x .+ u; nothing);
103103
104104julia> h!(y, x, _ , _ ) = (y .= 0.1x; nothing);
105105
106- julia> model1 = NonLinModel(f!, h!, 5.0, 1, 1, 1) # continuous dynamics
106+ julia> model1 = NonLinModel(f!, h!, 5.0, 1, 1, 1, p=-0.2) # continuous dynamics
107107NonLinModel with a sample time Ts = 5.0 s, RungeKutta solver and:
108108 1 manipulated inputs u
109109 1 states x
@@ -127,8 +127,8 @@ NonLinModel with a sample time Ts = 2.0 s, empty solver and:
127127 State-space functions are similar for discrete dynamics:
128128 ```math
129129 \b egin{aligned}
130- \m athbf{x}(k+1) &= \m athbf{f}\B ig( \m athbf{x}(k), \m athbf{u}(k), \m athbf{d}(k), \m athbf{p}(k) \B ig) \\
131- \m athbf{y}(k) &= \m athbf{h}\B ig( \m athbf{x}(k), \m athbf{d}(k), \m athbf{p}(k) \B ig)
130+ \m athbf{x}(k+1) &= \m athbf{f}\B ig( \m athbf{x}(k), \m athbf{u}(k), \m athbf{d}(k), \m athbf{p} \B ig) \\
131+ \m athbf{y}(k) &= \m athbf{h}\B ig( \m athbf{x}(k), \m athbf{d}(k), \m athbf{p} \B ig)
132132 \e nd{aligned}
133133 ```
134134 with two possible implementations as well:
0 commit comments