Oh okay, but I have a small issue now.
@variable(m, delta0)
amort = delta0/T
bal = Vector{JuMP.VariableRef}(undef, 100)
bal[1] = delta0
for i = 2:100
bal[i] = bal[i-1] - amort
end
I can now assign a decision variable to the first array position bal[1]
, but for the following positions from [2] onwards, I need to deduct a certain value amort
. But I get an error MethodError: Cannot convert an object of type GenericAffExpr{Float64,VariableRef} to an object of type VariableRef
So I asked about this in a previous post and someone advised to use regular zeros
array, and that allowed me to subtract amort
from bal[1]
. So I have this dilemma, where I need a JuMP array for decision variable storage, but also need the properties of a zeros array, and am not sure what to do.
If someone can please help, it would be greatly appreciated. This is the link to my other related question: https://discourse.julialang.org/t/for-loop-error/26210/7
Thanks!