Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use two pins/ports in modelica and Powersytems library

I am new to modelica and I am having difficulty dealing with two pins/ports. For example I am using the class PowerSystems.AC3ph.Inverters.Inverter, and I am not sure how to connect the inverter.DC and inverter.vPhasor pins/ports.

Currently I am connecting pin/port like so:

connect(pVArray.p, inverter.DC) annotation(...); connect(constant1.y, inverter.vPhasor) annotation(...);

The current problem is that PVSystems.Electrical.PVArray has two outputs: the positive electric pin, and the negative electric pin, while the inverter only has a single Two_Pin_P DC. I am not sure how to connect both.

inverter.vPhasor needs two inputs :

Modelica.Blocks.Interfaces.RealInput[2] vPhasor_in if use_vPhasor_in "{abs(v), phase(v)}"

How could I send two real inputs to a single pin? Right now I can only send one as seen above.

I am currently getting an error because of the inverter.vPhasor because of that

[1] 13:31:47 Translation Error [cert_mg: 65:3-66:62]: The type of variables constant1.y and inverter.vPhasor are inconsistent in connect equations.

Thank you all for the help

like image 262
Luis Enriquez-Contreras Avatar asked Nov 27 '25 19:11

Luis Enriquez-Contreras


1 Answers

The fundamental issue is, that the PowerSystems library defines custom interfaces. As an example, the connector DC in PowerSystems.AC3ph.Inverters.Inverter actually contains the same variables like Modelica.Electrical.Analog.Interfaces.Pin but as a vector. A single connection from PowerSystems.AC1ph_DC.Ports.TwoPin_p therefore creates two ideal electrical connections.

This is in contrast to the interfaces used by PVSystems, which reuses the interfaces from the Modelica (Standard) library. If I understood you question correctly, this is the reason why the connection

connect(pVArray.p, inverter.DC) annotation(...)

is actually not a valid connection, because the connectors differ. Basically this means that PowerSystems would connect both pins used in PVSystems.Electrical.PVArray with a single connection, which is why you don't find a possibility to connect the negative pin of the PVArray.

For the inputs of PowerSystems.AC3ph.Inverters.Inverter, did you look at PowerSystems.Examples.AC3ph.Inverters.InverterToLoad? It demonstrates how to connect them...

like image 99
Markus A. Avatar answered Nov 30 '25 17:11

Markus A.