How can this be done? I remember there was a Complex128
syntax or something, but i couldn’t find how to use it in a JuMP variable.
Here’s my problem, assume i already have the values of Rf
, Xlf
and Xcf
:
Nt = 2;
hmax = 5;
@variable(m, y5[i = 1:Nt,h = 3:2:hmax])
@NLconstraint(m , con8[i = 1:Nt, h = 3:2:hmax], y5[i,h] == 1/(Rf[i]+im*(h*Xlf[i]-Xcf[i]/h)))
I got this error:
ERROR: LoadError: InexactError()
Stacktrace:
[1] convert at .\complex.jl:31 [inlined]
[2] push!(::Array{Float64,1}, ::Complex{Bool}) at .\array.jl:646
[3] parseNLExpr_runtime(::JuMP.Model, ::Complex{Bool}, ::Array{ReverseDiffSparse.NodeData,1}, ::Int64, ::Array{Float64,1}) at C:\Users\Muril\.julia\v0.6\JuMP\src\parsenlp.jl:196
[4] macro expansion at C:\Users\Muril\.julia\v0.6\JuMP\src\parsenlp.jl:226 [inlined]
[5] macro expansion at C:\Users\Muril\.julia\v0.6\JuMP\src\macros.jl:1201 [inlined]
[6] anonymous at .\<missing>:?
[7] include_string(::String, ::String) at .\loading.jl:522
[8] include_string(::Module, ::String, ::String) at C:\Users\Muril\.julia\v0.6\Compat\src\Compat.jl:88
[9] (::Atom.##112#116{String,String})() at C:\Users\Muril\.julia\v0.6\Atom\src\eval.jl:109
[10] withpath(::Atom.##112#116{String,String}, ::String) at C:\Users\Muril\.julia\v0.6\CodeTools\src\utils.jl:30
[11] withpath(::Function, ::String) at C:\Users\Muril\.julia\v0.6\Atom\src\eval.jl:38
[12] hideprompt(::Atom.##111#115{String,String}) at C:\Users\Muril\.julia\v0.6\Atom\src\repl.jl:67
[13] macro expansion at C:\Users\Muril\.julia\v0.6\Atom\src\eval.jl:106 [inlined]
[14] (::Atom.##110#114{Dict{String,Any}})() at .\task.jl:80
while loading C:\Users\Muril\Desktop\Murilo\UFPE\Dissertação\Julia\Arquivos Feitos\teste_otimização_matriz_3_dimensões.jl, in expression starting on line 69
Is this related to y5
not being defined as a complex variable?