If i type in the above code I’m getting the following error, what would be change i need to do or can anyone suggest me a different notation
Thank you
ERROR: LoadError: Repeated index 4.0. Index sets must have unique elements.
Stacktrace:
[1] build_lookup(::Array{Float64,1}) at C:\Users\yaramasv.juliapro\JuliaPro_v1.3.1-1\packages\JuMP\MsUSY\src\Containers\DenseAxisArray.jl:23
[2] _broadcast_getindex_evalf at .\broadcast.jl:630 [inlined]
[3] _broadcast_getindex at .\broadcast.jl:603 [inlined]
[4] #19 at .\broadcast.jl:1023 [inlined]
[5] ntuple at .\ntuple.jl:42 [inlined]
[6] copy at .\broadcast.jl:1023 [inlined]
[7] materialize at .\broadcast.jl:819 [inlined]
[8] DenseAxisArray at C:\Users\yaramasv.juliapro\JuliaPro_v1.3.1-1\packages\JuMP\MsUSY\src\Containers\DenseAxisArray.jl:54 [inlined]
[9] construct_undef_array(::Type{VariableRef}, ::Tuple{Array{Float64,1},Array{Float64,1}}) at C:\Users\yaramasv.juliapro\JuliaPro_v1.3.1-1\packages\JuMP\MsUSY\src\Containers\DenseAxisArray.jl:96
[10] JuMP.Containers.DenseAxisArray{VariableRef,N,Ax,L} where L<:Tuple{Vararg{Dict,N}} where Ax where N(::UndefInitializer, ::Array{Float64,1}, ::Vararg{Array{Float64,1},N} where N) at C:\Users\yaramasv.juliapro\JuliaPro_v1.3.1-1\packages\JuMP\MsUSY\src\Containers\DenseAxisArray.jl:91
[11] top-level scope at C:\Users\yaramasv.juliapro\JuliaPro_v1.3.1-1\packages\JuMP\MsUSY\src\macros.jl:189
in expression starting at C:\Users\yaramasv\OneDrive - The University of Colorado Denver\Conference paper\Report\julia\powerflow34.jl:138
If we want only the first column of the branch, what we have to do ?
I mean , if I write like this this
S=[(branch[r,1]) for r= 1:size(branch,1)]
@variable(m,v[S])
I’m getting the same error.
Like this
ERROR: LoadError: Repeated index 4.0. Index sets must have unique elements.
Stacktrace:
[1] build_lookup(::Array{Float64,1}) at C:\Users\yaramasv\.juliapro\JuliaPro_v1.3.1-1\packages\JuMP\MsUSY\src\Containers\DenseAxisArray.jl:23
[2] _broadcast_getindex_evalf at .\broadcast.jl:630 [inlined]
[3] _broadcast_getindex at .\broadcast.jl:603 [inlined]
[4] #19 at .\broadcast.jl:1023 [inlined]
[5] ntuple at .\ntuple.jl:41 [inlined]
[6] copy at .\broadcast.jl:1023 [inlined]
[7] materialize at .\broadcast.jl:819 [inlined]
[8] DenseAxisArray at C:\Users\yaramasv\.juliapro\JuliaPro_v1.3.1-1\packages\JuMP\MsUSY\src\Containers\DenseAxisArray.jl:54 [inlined]
[9] construct_undef_array at C:\Users\yaramasv\.juliapro\JuliaPro_v1.3.1-1\packages\JuMP\MsUSY\src\Containers\DenseAxisArray.jl:96 [inlined]
[10] JuMP.Containers.DenseAxisArray{VariableRef,N,Ax,L} where L<:Tuple{Vararg{Dict,N}} where Ax where N(::UndefInitializer, ::Array{Float64,1}) at C:\Users\yaramasv\.juliapro\JuliaPro_v1.3.1-1\packages\JuMP\MsUSY\src\Containers\DenseAxisArray.jl:91
[11] top-level scope at C:\Users\yaramasv\.juliapro\JuliaPro_v1.3.1-1\packages\JuMP\MsUSY\src\macros.jl:189
in expression starting at C:\Users\yaramasv\OneDrive - The University of Colorado Denver\Conference paper\Report\julia\powerflow34.jl:149te code here
And I don’t want to use unique function also because I want all the elements from first column.