How to create Data.mat file for Convex.jl to solve optimal power flow using Matpower?

Hi,
I’m a newbie learning Julia for optimal power flow formulation using convex optimization. I came across an example from Convex.jl documentation in here
https://jump.dev/Convex.jl/stable/examples/optimization_with_complex_variables/power_flow_optimization/

In the example code the used “Data.mat” for the system parameters. I want to know how can I create the Data.mat file for any system provided in the Data folder of Matpower?
Thank you.

Checkout Home · PowerModels. It has lots of tools for working with this sort of thing. It also has a lot of model formulations pre-built, so you don’t have to write your own.