no method matching VariableRef(::GenericAffExpr{Float64,VariableRef})

我想计算一个最优的半定矩阵,但是卡在了定义目标函数的语句
原问题:
minimize log detP^−1
subject to ||Pu+ buro||\2≤ 1,

using JuMP,SCS#,MosekTools
import LinearAlgebra

u=rand(3,1)
M_SDP = Model(SCS.Optimizer)
@variable(M_SDP,buro[1:3])
@variable(M_SDP, P[1:3, 1:3], PSD)
@constraint(M_SDP , P .>= 0)
@constraint(M_SDP, [1, (P*u+buro)[1], (P*u+buro)[2], (P*u+buro)[3]] in SecondOrderCone())
@objective(M_SDP, Min, LinearAlgebra.log(det(inv(P))))
solve(M_SDP)
P_SDP = getvalue(P)
buro_SDP= getvalue(buro)

报错如下:
LoadError: MethodError: no method matching VariableRef(::GenericAffExpr{Float64,VariableRef})
Closest candidates are:
VariableRef(::Any, ::Any) at C:\Users\ipso17.GXU.julia\packages\JuMP\MIPb6\src\variables.jl:157
VariableRef(::Model) at C:\Users\ipso17.GXU.julia\packages\JuMP\MIPb6\src\variables.jl:295
VariableRef(::Model, ::MathOptInterface.VariableIndex) at C:\Users\ipso17.GXU.julia\packages\JuMP\MIPb6\src\variables.jl:157

Stacktrace:
[1] oneunit(::Type{VariableRef}) at .\number.jl:300
[2] lutype(::Type{T} where T) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\lu.jl:196
[3] lu(::LinearAlgebra.Symmetric{VariableRef,Array{VariableRef,2}}, ::Val{true}; check::Bool) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\lu.jl:272
[4] lu(::LinearAlgebra.Symmetric{VariableRef,Array{VariableRef,2}}, ::Val{true}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\lu.jl:272 (repeats 2 times)
[5] _inv(::LinearAlgebra.Symmetric{VariableRef,Array{VariableRef,2}}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\symmetric.jl:655
[6] inv(::LinearAlgebra.Symmetric{VariableRef,Array{VariableRef,2}}) at D:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.5\LinearAlgebra\src\symmetric.jl:670
[7] top-level scope at C:\Users\ipso17.GXU.julia\packages\MutableArithmetics\DcLoq\src\rewrite.jl:279
[8] top-level scope at C:\Users\ipso17.GXU.julia\packages\JuMP\MIPb6\src\macros.jl:1150
[9] top-level scope at untitled-7017fda30be755a6112a5ea5d86a7411:10
[10] include_string(::Function, ::Module, ::String, ::String) at .\loading.jl:1088
in expression starting at untitled-7017fda30be755a6112a5ea5d86a7411:10

@objective(M_SDP, Min, LinearAlgebra.log(det(inv(P))))
请问这句出现什么错误了呢?感谢你的帮助~

不能有太高级的语法,比如你的矩阵操作,这可能导致JuMP不认识。
JuMP官方中有个user define function的说明,针对NLP的,大概意思是要给出显函数才行。不知道SCS优化器有没有这个要求