Array variable - matrix multplication in JuMP

Hi,

Thanks @odow, I will remember about the screenshots in future.

Re:

@constraint(model, [t = 1:30], x * y[:, t] .== y[:, t + 1])

I think I get the idea. Shouldn’t y be the same size as x on the first two dimensions and 1:31 on the third dimension?

I will try the following:

model = Model()
@variable(model, 0 <= x[1:8, 1:8] <= 1)
@variable(model, y[1:8, 1:8, 1:31])
@constraint(model, first_t, y[:, :, 1] .== x[:, :])  # I think this is needed
@constraint(model, [t = 1:30], x * y[:, :, t] .== y[:, :, t + 1])

Then, I can set my objective to be based on y.

Let me try this out. Thanks!