Hi there!
Please read Please read: make it easier to help you and provide a minimal working example that reproduces the same error.
However, that looks like a bug because you should probably get a nicer error message. It might be because of the prod2.get
. What happens if you try:
prod2_get = [prod2.get([m-1, m-1]) for m in 1:num_basis]
@NLexpression(model, [i = 1:num_buses], sum(
prod2_get[m] * (vre_coeffs[i, m]^2 + vim_coeffs[i, m]^2)
for m = 1:num_basis)
)