Saarland University
Lehrstuhl für Automatisierungstechnik

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> 1 scalar equation to many... WHY?, Electric circuit doesn't work...
RungeZipperer
post Nov 28 2007, 07:36 AM
Post #1


Advanced Member
***

Group: Members
Posts: 59
Joined: 14-March 06
Member No.: 4



Thanks for posting your solution. Might be interesting for someone else having similar problems. Good luck for the rest of your thesis!
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hannes
post Nov 28 2007, 02:26 AM
Post #2


Member
**

Group: Members
Posts: 29
Joined: 5-September 07
Member No.: 2,176



Okay, I got it! And I'd like to let you know how.

In short: My PV-module is a kind of up-scaled PV-single-cell.

As already mentioned I assume NxM perfectly identical PV-cells. I make a copy of the model of my single PV-cell. Then I just adapt the parameters.

Therefore I need the characteristic curve of the single cell. Written with a pencil on paper (not in source-code) I substitute U by U/N and I by I/M everywhere these variables appear. The photo-current and area and temperature-voltage of the single cell stay as it is.
Next I reshape the equation I got until I may substitute:

R_p := R_p * N/M
R_s := R_s * N/M
I_ph := M * I_ph

The saturation current of the diode becomes:

Ids := Ids * M

The current through the diode then is:

i = Ids * (exp(v/(m*Vtemp*N)) - 1)

Only the N-factor is new here.

In the source-code I only do the substitutions.

That's it. Only to notice if you try the same: Don't change the temperature-voltage itself because it would change Ids in a wrong way.

Thank you all for your help. Special thanks to RungeZipperer!!!

Hannes


Attached thumbnail(s)
Attached Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hannes
post Nov 19 2007, 03:24 PM
Post #3


Member
**

Group: Members
Posts: 29
Joined: 5-September 07
Member No.: 2,176



Okay, I think replacing my PV-cell by an ideal voltage source was a bad idea from me. It's not realistic. Only as soon as I have a resistor in series making the pair be a REAL voltage source I have a senseful relationship between voltage and current. I agree with you in this point.

>> What are the cells? A voltage source or a current source?

I'm using a one-diode-equivalent-circuit (in german: Ein-Dioden-Ersatzschaltbild) which is a REAL current source (that's an ideal current source with a diode (reverse-mode) and a resistor both in parallel and a further resistor in series). So it certainly has a well-defined relationship between voltage and current.
http://upload.wikimedia.org/wikipedia/comm...ent_circuit.png with + on the superior pin and a negative current in the ideal current source.

>> Voltage and current are not independent.

Right!

>> If you connect your cells in a row you can multiply your no-load voltage.

Even with load...?!

>> Connecting cells parallely leads to a higher current but because of a lower
>> inner resistance and not because you multiply the current.

Due due Kirchhoff's (e.g. http://www.physics.uoguelph.ca/tutorials/ohm/Q.ohm.KCL.html) the currents of the different parallel string are added to the resulting current visible to the outer world at the module-pin. If all string are equal then

I1+I2+...+IN=N*I1.

>> So if you want your matrix to be realistic outside the "blackbox"
>> you have to go in detail and think of the behavior of one single cell.

The single cell is completed and works fine in all situations. Changing the details within the single cell would not solve the problem I have when connecting several of them.

>> I canīt see a solution only by multiplying the electrical values voltage and current. That doesnīt make sense to me at all.

My suspicion is the following (maybe you can confirm it by your experience or a good book):

The outer world of my PV-module is linked via connect-statements. The inner world of my PV-cell is linked via connect-statements as well. Only the step from cell to module is done without connect-statement.
When a test-environment for the module is then being translated, only connect-statements are considered for the voltages on the "model-borders" and the currents passing the "model-borders". In contrast to that, manual equations which also have to do with the voltages on the "model-borders" and the currents passing the "model-borders" are irgnored. --- This is at least my suspicion!
If my suspicion is true, this would explain, why currents in interfaces (instances of the connector-class) would be set to zero (namely due to Kirchhoff's current law: only one current comes in and therefore it must be zero). This "set to zero" might be an additional equation which was not intended by the programmer but which results in complaints of the translator......

Do you confirm this?

Hannes
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
RungeZipperer
post Nov 19 2007, 02:45 PM
Post #4


Advanced Member
***

Group: Members
Posts: 59
Joined: 14-March 06
Member No.: 4



QUOTE(Hannes @ Nov 19 2007, 03:09 PM) *

Next I want bigger powers! So multiply voltage and current!


OK, I think there is a problem in your physical considerations:

What are the cells? A voltage source or a current source? Letīs assume you have a voltage source. Voltage and current are not independent. If you connect your cells in a row you can multiply your no-load voltage. Connecting cells parallely leads to a higher current but because of a lower inner resistance and not because you multiply the current. So if you want your matrix to be realistic outside the "blackbox" you have to go in detail and think of the behavior of one single cell. I canīt see a solution only by multiplying the electrical values voltage and current. That doesnīt make sense to me at all.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hannes
post Nov 19 2007, 02:20 PM
Post #5


Member
**

Group: Members
Posts: 29
Joined: 5-September 07
Member No.: 2,176



QUOTE(RungeZipperer @ Nov 19 2007, 01:09 PM) *

Did you try my suggestion?


A parameter defining voltage and another parameter defining current is nice but not what I want to model. Based on an available two-pin-model of a single PV-cell I want to build the whole line starting from irradiance/temperature and (in this context) ending at the voltage-current-pair of the complete module or even of an array of several modules (a solar generator).

I agree with you that this kind of modeling is really strange. But maybe it opens the gate to new concepts... Or do you know the solution for my problem that holds to the "traditional" or common way of modeling?

Hannes
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hannes
post Nov 19 2007, 02:09 PM
Post #6


Member
**

Group: Members
Posts: 29
Joined: 5-September 07
Member No.: 2,176



Okay, the aim and background of my efforts is the following (@RungeZipperer: I write the answer to your message right here, so that more brains get the info you get):

I've got a single PV-cell whose characteristic curve for voltage and current is known (depending on irradiation from the sun, ambient temperature etc). Typically in the MPP (maximum power point) such a single cell gives you round about 0.6Volt and some Amperes as current resulting in approximately 1W power.
I've a model for such a cell here. It has two electrical pins. It works fine. But it has quite a lot of equations (say K=50).

Next I want bigger powers! So multiply voltage and current!

Therefore, PV-modules are built which roughly consist of several (say M=6) parallel identical strings - each containing the same number (say N=6, too) of identical single PV-cells - connected in series. So I have an NxM-array of single PV-cells which form a module altogether.
The parallel connection of M strings results in an overall-current which is M times higher than the one of a single string. The connection in series results in an overall-voltage which is N times higher than the one of a single cell.
(Besides: I assume an always perfect equality of physical properties and irradiance-conditions for ALL NxM cells within the module.)

So, next step is to realize this NxM-array of cells as a model. The easiest and most straight forward way to do this is to create (just by mouse drag&drop) N*M instances of a single cell model. Furthermore you need two pins as interface to the outer world of the module. Then you connect these cells in series and parallel as described above (see PV_module.png). When done as in the picture you have 2811 equations (instead of 50 for the single cell) although you always use an instance of the same cell-model!!!
Of course, the way done in the picture shall not be limited to 4x4 but shall be EASILY expandable to NxM.
In order to avoid an inflammation in my right wrist blink.gif I automize the connection-work with for-loops. Then you don't see the "connection-lines" anymore but they exist (yes, with connect statement) nevertheless. Invisible, if you want so.

Every programmer would like to slap me when watching at the picture below. Clear. Even, the for-loops don't really reduce the enormous redundancy (see the number of equations!). Remember that all PV-cells are identical and the whole problem was just multipllying voltage (by N) and current (by M) !!!

Based on this thought I had the idea to create ONLY ONE instance of a PV-cell-model and then (I still don't know how to teach this to Dymola) multiply its voltage and current within the module-model before passing it to the outer world.

So what I do is:
(0) No connect-statements for the electrical pins. Instead (for the NxM-thing):
(1) Within the PV-module I equate the n-potential of the cell with the n-potential of the module because we calculate with potentials, too (which have to be well-defined), and not only with voltages (that's why we need a GROUND)!
=> module.n.v = cell.n.v
(2) module.p.v-module.n.v = N*(cell.p.v-cell.n.v) --- because cell.v shouldn't be accessible from the outside...
(3) module.p.i = M*cell.p.i
(4) module.p.i+module.n.i=0 (to define the n-current of the module too)

Checking this version with the PV-cells says me: 2 equations too many.

Next, for simplification-reasons for this forum-topic, I replaced the single cell by an IDEAL ConstantVoltage-block. I don't know what happens to the characteristic curve of voltage and current... Should be better to take a REAL ConstantVoltage-block (a resistor in series) in order to have a nice characteristic curve.

Checking this version with the IDEAL ConstantVoltage-block says me:

There are 1 scalar equations too many in the set:
equation
U.n.i = 0;
0 = U.p.i+U.n.i;
U.p.i = 0;
The problem for Real elements is underdetermined.
1 scalar Real equations are missing for the variables or its derivatives:
U.n.v
U.p.v


I hope my problem and the motivation for it is more comprehensible to you know so that you can give me precious hints... rolleyes.gif


Attached thumbnail(s)
Attached Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
RungeZipperer
post Nov 19 2007, 12:09 PM
Post #7


Advanced Member
***

Group: Members
Posts: 59
Joined: 14-March 06
Member No.: 4



QUOTE(Hannes @ Nov 19 2007, 12:06 PM) *

[...] So what's the benefit?



I guess you have too many equations for the voltage. I still donīt understand your way of modeling. If you donīt connect the ConstantVoltage to the outside that seems a bit...letīs say strange. It is IMHO not like you should develop models in Modelica.

Did you try my suggestion?

Another idea is to take the model ConstantVoltage, copy its content and intruduce your changes just to get a clearer structure.


CODE
model ConstantVoltageNew
  parameter SI.Voltage V=1 "Value of constant voltage";
  extends Interfaces.OnePort;
equation
  v = 3*V;
//and so on...
end ConstantVoltageNew;
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hannes
post Nov 19 2007, 11:06 AM
Post #8


Member
**

Group: Members
Posts: 29
Joined: 5-September 07
Member No.: 2,176



QUOTE(RungeZipperer @ Nov 19 2007, 08:38 AM) *

Hello Hannes,

maybe this helps you a little bit. A few hints:

* Why do you include the model ConstantVoltage? You donīt use it "as a model", you only need the value of the constant voltage. So you could also define a parameter.

* Are you sure you need to extend your model from TwoPins? You are trying to model a special source so maybe you can use two single pins instead.

I attach my "5-minute-solution". Itīs not tested and I did not go into detail but maybe it helps you finding a new way.


(1) The reason is that normally I use a quite complex model for a photovoltaic cell at the place of the ConstantVoltage-block. Of course I could make U.v a separate parameter, but as my cell-model is an electrical device (source) with two pins, I want to keep this structure.
(2) Reading the source code of TwoPin tells me that TwoPin is the same as two manually inserted pins except for the definition of v (the voltage). Using two single pins would make me define v as well. So what's the benefit?
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hannes
post Nov 19 2007, 10:52 AM
Post #9


Member
**

Group: Members
Posts: 29
Joined: 5-September 07
Member No.: 2,176



Okay, your check-message is as it is.

QUOTE(wagner @ Nov 19 2007, 09:26 AM) *

I'm using Dymola 6.1. Which version are you using?


Dymola 5.3a though I could use 6.0. --- I was too lazy to stress myself with updating all my models...

But once again, I'd like to ask the question about replacing connect-statements by the equations they stand for. Is there any hidden mechanism for which the two alternatives are NOT equivalent?

Hannes
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
wagner
post Nov 19 2007, 08:26 AM
Post #10


Administrator
***

Group: Root Admin
Posts: 121
Joined: 13-March 06
Member No.: 1



Hello Hannes,

attached to this post you'll find my check result as a screenshot. You can see that the currents to your constantVoltage are set to zero (second text block) and that there are two equations too many (first text block).

I'm using Dymola 6.1. Which version are you using?

Regards

Florian


Attached thumbnail(s)
Attached Image
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
RungeZipperer
post Nov 19 2007, 07:38 AM
Post #11


Advanced Member
***

Group: Members
Posts: 59
Joined: 14-March 06
Member No.: 4



Hello Hannes,

maybe this helps you a little bit. A few hints:

* Why do you include the model ConstantVoltage? You donīt use it "as a model", you only need the value of the constant voltage. So you could also define a parameter.

* Are you sure you need to extend your model from TwoPins? You are trying to model a special source so maybe you can use two single pins instead.

I attach my "5-minute-solution". Itīs not tested and I did not go into detail but maybe it helps you finding a new way.


Attached File(s)
Attached File  dummy.mo ( 3.64k ) Number of downloads: 281
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hannes
post Nov 19 2007, 01:28 AM
Post #12


Member
**

Group: Members
Posts: 29
Joined: 5-September 07
Member No.: 2,176



>> the problem might be, that you do not connect the constantVoltage-block
>> inside the TestDummy model.

Yes, I must keep it disconnected because otherwise I would not have any possibility to insert the factors N and M, don't I?

>> As far as I remember are flow variables set to zero if the corresponding
>> connector is not connected to another component. In your case this means
>> that the variables U.p.i and U.n.i are set to zero.

This astonishs me twice:
(1) Isn't there an exact rule about what happens in this case?
(2) I do connect even the second pin of the voltage source, BUT: I don't do it with the standard connect()-statement. Instead, I strip it down to (ALL) its single equations. In this way, I have the possibility to insert my factors N and M. --- As far as a connect-statement may be replaced by the implicit equations it stands for, I do not see any reason why this manner should not work as well. -- Check my equations for N=M=1 and everything is as if I'd used a standard connect-statement.

>> When I run a check on TEnv_TestDummy model I get the message that
>> there are two equations too many, which would support my assumption.
>> Maybe you should try to write a monolithic cell model and try it again.

Why two? When I'm checking it, there's one set of equations missing one equation and another set that has one equation to many. So the number of equations is right but their structure isn't right.

Do you know, whether connect-statements may be replaced by the equations they stand for? Fritzson's Modelica Guide tells me that the compiler translates the connect-statements into their equations. So what's the difference between what the compiler does and what I do???


Thanks for further arguments and hints!

Best regards, Hannes
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
wagner
post Nov 18 2007, 09:14 PM
Post #13


Administrator
***

Group: Root Admin
Posts: 121
Joined: 13-March 06
Member No.: 1



Hello Hannes,

the problem might be, that you do not connect the constantVoltage-block inside the TestDummy model. As far as I remember are flow variables set to zero if the corresponding connector is not connected to another component. In your case this means that the variables U.p.i and U.n.i are set to zero.

When I run a check on TEnv_TestDummy model I get the message that there are two equations too many, which would support my assumption. Maybe you should try to write a monolithic cell model and try it again.

Regards

Florian
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hannes
post Nov 16 2007, 02:48 PM
Post #14


Member
**

Group: Members
Posts: 29
Joined: 5-September 07
Member No.: 2,176



Yes of course. Check the attached mo-file.
Hannes


Attached File(s)
Attached File  Dummy.mo ( 3.36k ) Number of downloads: 310
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
RungeZipperer
post Nov 15 2007, 03:47 PM
Post #15


Advanced Member
***

Group: Members
Posts: 59
Joined: 14-March 06
Member No.: 4



Can you attach the mod-file (Save Total)? Itīs much easier than reading through the lines.
User is offlineProfile CardPM
Go to the top of the page
+Quote Post
Hannes
post Nov 15 2007, 03:40 PM
Post #16


Member
**

Group: Members
Posts: 29
Joined: 5-September 07
Member No.: 2,176



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
User is offlineProfile CardPM
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 14th November 2019 - 04:34 PM