PowerModels in MAC OS

When I try to use build_model to see the optimization model, it shows
‘UndefVarError: build_model not defined’.
The code is
pm = build_model("~/PowerModels.jl-master/test/data/matpower/case5_tnep.m", ACPPowerModel, PowerModels.post_tnep, ref_extensions=[ref_add_on_off_va_bounds!,ref_add_ne_branch!])
This only happens in MAC OS. When I try this code in Windows, it works fine.
Is there anything I need to change in MAC OS for PowerModels?

Thank you.

can you show a minimal working example that works on Windows but not on MacOS?

It sounds like you have a more recent version of PowerModels on OS X than Windows. As of v0.14, build_model became instantiate_model and post_tnep became build_tnep.

I tested this on the latest release of PowerModels (v0.15.2) and it seemed to work as expected.

using PowerModels
pm = instantiate_model("test/data/matpower/case5_tnep.m", ACPPowerModel, PowerModels.build_tnep, ref_extensions=[ref_add_on_off_va_bounds!,ref_add_ne_branch!])

It is the same code I use in Windows and Mac OS. I already got the answer and it is the PowerModels in two OS are different so the previous method doesn’t fit the latest version.

Thank you

Thank you! This is working. So for the V0.15.2, if I want to check the optimization model, I will use ‘instantiate_model’ and ‘build_tnep/opf/ost…’, right?
For each version, do you have any document to emphasize the updates? I check the PowerModel website, but I couldn’t find ‘instantiate_model’ or ‘build_tnep’.

Thank you

That is correct.

The documentation of PowerModels is up to date with the new names as far as as I can tell. If you find inconsistencies there please post an issue and they will be resolved.


The change log has a summary of what updates where made in each version,

In some cases when many renames happen at once there is usually an issue to document it. For example see,