Hi fellows!
I got a problem with a PV-module. I wanted to simulate it as a very very simple NxM-array of a single cell. But I wanted to use ONLY ONE instance of a single cell and then multiply voltage by N and current by M (N cells in a line, M lines in parralel).
As this idea didn't work with the complicated cell-model, I reduced it to a constant voltage source. Its voltage is then multiplied by N and the current by M. This is done in the model "TestDummy". It test-environment including a ground and ohmic load is "TEnv_TestDummy". See below for the source code (just copy&paste it):
model TestDummy
/////////////////////////////////////////////////////////////////////////////////////
import Modelica.Electrical.Analog.Interfaces.TwoPin;
extends TwoPin;
// import Modelica.Electrical.Analog.Interfaces.OnePort;
// extends OnePort;
import Modelica.Electrical.Analog.Sources.ConstantVoltage;
import SI = Modelica.SIunits;
/////////////////////////////////////////////////////////////////////////////////////
public
ConstantVoltage U(V=5)
annotation (extent=[-20,-10; 0,10]);
public
SI.Current i;
/////////////////////////////////////////////////////////////////////////////////////
/**/
equation
/////////////////////////////////////////////////////////////////////////////////////
i = p.i;
0 = p.i + n.i;
i = 10*U.p.i;
/////////////////////////////////////////////////////////////////////////////////////
v = 3*(U.p.v-U.n.v);
U.n.v = n.v;
/////////////////////////////////////////////////////////////////////////////////////
annotation (Icon(Ellipse(extent=[-90,90; 90,-90], style(
color=1,
rgbcolor={255,0,0},
thickness=2,
fillPattern=10))));
end TestDummy;
model TEnv_TestDummy "Test environment for model Array_of_Cells"
import PV_RO_components.misc.Icons.iconTEnv;
extends iconTEnv;
/////////////////////////////////////////////////////////////////////////////////////
import Modelica.Electrical.Analog.Basic.VariableResistor;
import Modelica.Electrical.Analog.Basic.Ground;
import Modelica.Blocks.Sources.Constant;
import Modelica.Blocks.Sources.Ramp;
/////////////////////////////////////////////////////////////////////////////////////
VariableResistor R "Variable resistor"
annotation (extent=[54,0; 74,20], rotation=270);
Ground GND "ground"
annotation (extent=[42,-30; 62,-10]);
Ramp Ctrl_R(
height=1000,
duration=10,
startTime=10,
offset=1) annotation (extent=[100,4; 88,16]);
TestDummy TestDummy1 annotation (extent=[20,0; 40,20], rotation=270);
/////////////////////////////////////////////////////////////////////////////////////
/**/
equation
/////////////////////////////////////////////////////////////////////////////////////
connect(R.R, Ctrl_R.y) annotation (points=[75,10; 81.2,10; 81.2,10; 87.4,10],
style(
color=74,
rgbcolor={0,0,127},
pattern=0,
thickness=2,
fillColor=6,
rgbfillColor={255,255,0},
fillPattern=1));
/////////////////////////////////////////////////////////////////////////////////////
annotation (Diagram);
equation
connect(TestDummy1.p, R.p) annotation (points=[30,20; 30,28; 64,28; 64,20],
style(
color=3,
rgbcolor={0,0,255},
thickness=2));
connect(TestDummy1.n, GND.p) annotation (points=[30,-5.55112e-16; 30,-10; 52,
-10], style(
color=3,
rgbcolor={0,0,255},
thickness=2));
connect(R.n, GND.p) annotation (points=[64,-5.55112e-16; 64,-10; 52,-10],
style(
color=3,
rgbcolor={0,0,255},
thickness=2));
end TEnv_TestDummy;
The Checker tells me, that there's one scalar equation too many. But WHY? All equations are necessary ans reasonible in my opinion.
Does anyone see the error?
I'd thank you a lot!!!
Hannes
