Hello,
I m basically trying to implement a PRBS or similar signal generator using vector and discrete clock signal. But it does not seem that both can be handled simultaenously. Am I right or is there a way to use both ? Br
using ModelingToolkit: t_nounits as t
dt = 0.1 # Sample interval
clock = Clock(dt) # A periodic clock with tick rate dt
k = ShiftIndex(clock)
@mtkmodel prbs_16 begin
@variables begin
state(t)[1:16] = rand(Bool,16) |> BitArray
out(t)
input(t)
end
@equations begin
state[1](k-1) ~ state[2](k)
end
end
# @named prbs=prbs_16()
@mtkbuild prbs=prbs_16()
ODEProblem(structural_simplify(prbs),tspan = (0.0, 10.0))