Skip to content

Commit 07fe30c

Browse files
committed
add quantization test
1 parent 3f4f9f0 commit 07fe30c

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using ModelingToolkitSampledData
2+
using ModelingToolkit
23
using Documenter
34
using Plots
45
gr(fmt=:png)

docs/src/tutorials/noise.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ A signal may be quantized to a fixed number of levels (e.g., 8-bit) using the [`
102102
```@example QUANT
103103
using ModelingToolkit, ModelingToolkitSampledData, OrdinaryDiffEq, Plots
104104
using ModelingToolkit: t_nounits as t, D_nounits as D
105+
using ModelingToolkitStandardLibrary.Blocks
105106
z = ShiftIndex(Clock(0.1))
106107
@mtkmodel QuantizationModel begin
107108
@components begin

test/test_discrete_blocks.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,8 @@ end
457457
sol = solve(prob, Tsit5(), dtmax=0.01)
458458
y = sol[m.quant.y]
459459
uy = unique(y)
460-
@test length(uy) == 4
460+
@test length(uy) <= 4
461+
@test 0 uy
461462
end
462463

463464

0 commit comments

Comments
 (0)