3

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

1 Answers1

1

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...

Markus A.
  • 6,300
  • 10
  • 26
  • Do you know of any photovoltaic arrays or solar panel/systems that are compatible with powersystems. I found many PV libraries in modelica but none seem to inverter but none seem to have all the power components I need for my microgrid. Thank you for the help. – Luis Enriquez-Contreras Mar 16 '23 at 18:31
  • Yes I did, but I could not find a solar panel in pvsystems. – Luis Enriquez-Contreras Mar 16 '23 at 18:32
  • I don't know any PV-model with interfaces compatible to the `PowerSystems` library. As an alternative, It should be possible to use `PowerSystems.AC3ph.Sources.PQsource` with `use_pq_in = true` and computing the power input as a signal from some other PV-library. This could make sense if you need to use `PowerSystems` for a certain reason... – Markus A. Mar 20 '23 at 06:17
  • Is there any other library that you know of in openmodelica that has 3 phase modeling tools, solar PV, and battery storage? Thanks – Luis Enriquez-Contreras Mar 21 '23 at 17:07
  • There is a number of libraries for photovoltaics, `PVSystems` or `PhotoVolatics`. For three-phase modeling you could use `Modelica.Electrical.Polyphase` or `Modelica.Electrical.QuasiStatic`. An inverter is included in `Modelica.Electrical.PowerConverters` but it is switched and therefore comparably slow. The question is what the use-case actual is... – Markus A. Mar 21 '23 at 20:01