I have written a function, i.e, sdp_opf, to solve the OPF problem via SDP relaxation which exports the build_sdp_opf. However, when I want to run my code via build_sdp_opf(case,model) I get the following error.

build_sdp_opf not defined

I have already written similar functions to and add them to the PowerModelsAnnex in Julia 0.6 to solve the OPF problem and I didn’t get any error. However, recently I upgraded my Julia to 1.3 and I got the above error. I will appreciate it if you let me know about possible actions that I should take to run my code in Julia 1.3. Thanks in advance!

I think the core point here is that a lot changed about how package development works between Julia v0.6 and Julia v1.0. You might start by reviewing those changes. For example,

It’s fairly similar to how it use to work, just make sure that you are working out of the “dev” directory and that your active environment is setup to use that version of the code.

Thanks for your response, it was useful and I really appreciate it. I fixed that error by activating the environment. As you might know I am writing the SDP relaxation for the OPF problem in rectangular coordinate in PowerModelsAnnex.
The core difference between my formulation and yours in PowerMpdels is about how the “W” matrix is defined. In my implementation I have defined a 2n*2n positive semidefinite matrix named “W” and then I extract “w”,”wr”, “wi” out of the “W” matrix to defined all other constraints based on these variables.
I have two questions. First, with the following implementation I get an error (i.e. MethodError: no method matching _get_name(::QuoteNode)) for line “@variable(model,:w)[i] = W[w_idx,w_idx]+W[w_idx+n_bus,w_idx+n_bus]”.

My second question is, even after commenting out that line I get the following error, UndefVarError: nw not defined. I don’t have any “nw” in my code except in the second line. I will appreciate it if you guide me to solve these error. Thanks in advance!

Thanks for your invaluable response! It fixed the error. Can you please give me some insights on how to solve the issue in the second part of my question. I still get the following error, UndefVarError: nw not defined.
I don’t have any “nw” in my code except in the second line. Thanks in advance!