I can’t think of another option. I’ve not personally worked with the C code 
generation in MATLAB, so I’m not familiar with the requirements. Do you know 
what specifically is used by MATPOWER that is not supported? If there are easy 
ways to avoid those things, it would certainly make sense to do so.

   Ray


On Apr 13, 2020, at 7:53 AM, Lode De Herdt 
<[email protected]<mailto:[email protected]>> wrote:

Dear Matpower users,

I am trying to run a simulation of a distribution grid on an OPAL-RT real-time 
digital simulator, using Matpower. The simulator requires a Simulink model, 
which it converts to C code in order to run the model on its hardware. Using 
the MATLAB Function block in Simulink, I can integrate a few lines of Matlab 
code into the model that run a power flow with Matpower.

Unfortunately it seems that not all of the code used for Matpower is supported 
for C code generation, so the Simulink model cannot run.

Other than manually re-writing the Matpower code to avoid everything that's 
unsupported for code generation, is there any easier way of running Matpower in 
Simulink? It must be compatible with code generation so using an extrinsic 
coder or something similar is unfortunately not an option.

Thank you for your help!

Best regards,
Lode


Reply via email to