Skip to content

Commit 9ddf8b3

Browse files
committed
debug test SimResult constructor
1 parent 7dcf78e commit 9ddf8b3

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

docs/src/public/generic_func.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,14 @@ setstate!
3333

3434
## Quick Simulation
3535

36+
### Simulate
37+
3638
```@docs
3739
sim!
40+
```
41+
42+
### Simulation Results
43+
44+
```@docs
3845
SimResult
3946
```

src/plot_sim.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,16 @@ Simply call `plot` from [`Plots.jl`](https://github.com/JuliaPlots/Plots.jl) on
3232
3333
# Examples
3434
```julia-repl
35-
julia> a = 1;
35+
julia> plant = LinModel(tf(1, [1, 1]), 1.0); N = 5; U_data = fill(1.0, 1, N);
36+
37+
julia> Y_data = reduce(hcat, (updatestate!(plant, U_data[:, i]); plant()) for i=1:N)
38+
1×5 Matrix{Float64}:
39+
0.632121 0.864665 0.950213 0.981684 0.993262
40+
41+
julia> res = SimResult(plant, U_data, Y_data)
42+
Simulation results of LinModel with 5 time steps.
43+
44+
julia> using Plots; plot(res)
3645
```
3746
"""
3847
function SimResult(

test/test_plot_sim.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ end
109109
@test res.X̂_data[:, 1] zeros(mpc2.estim.nx̂)
110110

111111
res_man = SimResult(
112-
mpc, res.U_data, res.Y_data, res.D_data;
112+
mpc1, res.U_data, res.Y_data, res.D_data;
113113
X_data=res.X_data, X̂_data=res.X̂_data,
114114
Ry_data=res.Ry_data
115115
)

0 commit comments

Comments
 (0)