Skip to content

Commit

Permalink
connect output
Browse files Browse the repository at this point in the history
  • Loading branch information
baggepinnen committed Sep 2, 2024
1 parent 1ab9deb commit 64ee27f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion src/discrete_blocks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ A discrete-time noise source that returns a normally-distributed value at each c
end
@equations begin
y(z) ~ mu + sigma*Symbolics.term(randn, rng; type=Real)
output.u ~ y
end
end

Expand Down Expand Up @@ -205,7 +206,8 @@ A discrete-time noise source that returns a uniformly distributed value at each
rng = Random.Xoshiro()
end
@equations begin
y(z) ~ l + (u-l)*Symbolics.term(randn, rng; type=Real)
y(z) ~ l + (u-l)*Symbolics.term(rand, rng; type=Real)
output.u ~ y
end
end

Expand Down
9 changes: 4 additions & 5 deletions test/test_discrete_blocks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,10 @@ using ModelingToolkitStandardLibrary.Blocks

@named m = NoiseModel()
m = complete(m)
@test_skip begin # https://github.com/JuliaComputing/JuliaSimCompiler.jl/issues/397
ssys = structural_simplify(IRSystem(m))
prob = ODEProblem(ssys, [], (0.0, 10.0))
sol = solve(prob, Tsit5())
end
ssys = structural_simplify(IRSystem(m))
prob = ODEProblem(ssys, [], (0.0, 10.0))
sol = solve(prob, Tsit5())
@test !all(iszero, sol.u)
# TODO: add tests
end

Expand Down

0 comments on commit 64ee27f

Please sign in to comment.