1 scalar equation to many... WHY?, Electric circuit doesn't work...
 RungeZipperer 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!
 Hannes 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/MR_s := R_s * N/MI_ph := M * I_phThe saturation current of the diode becomes:Ids := Ids * MThe 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)
 RungeZipperer 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.
 Hannes 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
 Hannes 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 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.vI hope my problem and the motivation for it is more comprehensible to you know so that you can give me precious hints... Attached thumbnail(s)
 RungeZipperer 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.CODEmodel ConstantVoltageNew  parameter SI.Voltage V=1 "Value of constant voltage";  extends Interfaces.OnePort;equation   v = 3*V;//and so on...end ConstantVoltageNew;
 Hannes 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?
 Hannes 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
 wagner 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?RegardsFlorian Attached thumbnail(s)
 RungeZipperer 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)  dummy.mo ( 3.64k ) Number of downloads: 281
 Hannes 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
 wagner 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.RegardsFlorian
 Hannes 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)  Dummy.mo ( 3.36k ) Number of downloads: 310
 RungeZipperer 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.
 Hannes 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

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

 Lo-Fi Version Time is now: 7th December 2019 - 11:53 PM