Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register
  • Index
  • » Users
  • » s-anderson
  • » Profile

Posts

Posts

Oct-06-15 18:04:40
Repeated calls to the table within an algorithm

Hi,
I have a simple model that has an algorithm section. Using the same look-up table, I am trying to find losses that correspond to 2 different inputs and I want to get the total loss in the end.
model test1_alg
  parameter Real rating(start = 40000);
  Real loss1;
  Real loss;
  Real P1=-40000 ;
  Real  P2 =-10000;
  Modelica.Blocks.Tables.CombiTable1D Loss_inputP(tableOnFile = true, tableName = "table_input_loss", fileName = "..../input_loss.txt") ;
algorithm
  Loss_inputP.u[1] := abs(P1) * 100 / rating;
  loss1 := rating * Loss_inputP.y[1] / 100;
  Loss_inputP.u[1] := abs(P2) * 100 / rating;
  loss := rating * Loss_inputP.y[1] / 100;
  loss1 := loss + loss1;
end test1_alg;

When I test this model, I observe that the very first output of the look-up table is lost. This is what I expect:
Loss_inputP.u[1]=100
loss1= 8000 (from the table)
Loss_inputP.u[1]=25
loss= 1000 (from the table)
so loss1 should be 9000 in the end.

HOWEVER, simulation result has loss=1000 and loss1=2000 indicating that the first look-up is kind of overwritten.

Can anybody give me some explanations? (The model above is a very simplified one with  respect to the original model I am working on.)

Thank you very much in advance.


For some reason I was not able to attach the txt file. Here's the table used:
#1
double table_input_loss(15,2)
0    0
2.55    2.5
3    2.5
7.5    2.5
12.5    2.5
17.5    2.5
22.5    2.5
32.5    2.5
42.5    2.5
54    4
67.5    7.5
82.5    12.5
100    20
120    30
142.5    42.5

Apr-29-15 00:21:39
Errors when running library examples

Hi,
I am trying to understand the electrical package of the Buildings library. I realized that I am not able to run all the examples. I would appreciate if anybody knows and shares how to fix these errors.
I am using OMEdit OpenModelica 1.9.1 (r22929) (RML version).

Here are the errors under AC-one phase:
Example: Buildings.Electrical.AC.OnePhase.Conversion.Examples.ACACTransformer (I got the same error when I tried using this transformer object in a simple model)
Errors displayed:
[:0:0-0:0] Error: Internal error Transformation Module PFPlusExt index Reduction Method Pantelides failed!
[:0:0-0:0] Error: Internal error - IndexReduction.pantelidesIndexReduction failed!
[:0:0-0:0] Error: Internal error - IndexReduction.pantelidesIndexReduction1 failed! Use +d=bltdump to get more information.
[:0:0-0:0] Warning: Alias set with several free start values
* candidate: shortCircuit.v[1](start = 1.0)
* candidate: tra_cc.V2[1](start = tra_cc.VLow * cos(0.0))
=> select value from tra_cc.V2[1](start = tra_cc.VLow * cos(0.0))
   because its component reference (or its binding component reference) is closer to the top level scope with depth: 2.
   If we have equal component reference depth for several components choose the one with non zero binding.
……./modelica-buildings-2.0.0-rc.1/Buildings 2.0.0/Electrical/AC/OnePhase/Loads/Inductive.mo:37:9-37:88] Error: Internal error
Differentiate.differentiateEquationTime failed for -tra_load.terminal_p.i[1] = -homotopy((load.v[2] * load.Q + load.v[1] * load.Pow) / (load.v[1] ^ 2.0 + load.v[2] ^ 2.0), 0.0)

Example: Buildings.Electrical.AC.OnePhase.Storage.Examples.AcBattery  (I got the same error when I created a simple model involving one storage unit)
Errors displayed:
[……./modelica-buildings-2.0.0-rc.1/Buildings 2.0.0/Electrical/Interfaces/Terminal.mo:7:1-7:54] Error: Could not evaluate structural parameter (or constant): PhaseSystem.n which gives dimensions of array: v[PhaseSystem.n]. Array dimensions must be known at compile time.
[:0:0-0:0] Error: Error occurred while flattening model Buildings.Electrical.AC.OnePhase.Storage.Examples.AcBattery

Example: Buildings.Electrical.AC.OnePhase.Examples.GridDCLoad  (Same error as in battery)
[:0:0-0:0] Error: Error occurred while flattening model Buildings.Electrical.AC.OnePhase.Examples.GridDCLoad
[……./modelica-buildings-2.0.0-rc.1/Buildings 2.0.0/Electrical/Interfaces/Terminal.mo:7:1-7:54] Error: Could not evaluate structural parameter (or constant): PhaseSystem.n which gives dimensions of array: v[PhaseSystem.n]. Array dimensions must be known at compile time.
[……/modelica-buildings-2.0.0-rc.1/Buildings 2.0.0/Electrical/AC/OnePhase/Conversion/ACDCConverter.mo:41:5-41:39] Warning: Ignoring overconstrained operator applied to array components having size zero: Connections.root(terminal_p.theta);.

Thank you very much in advance,

Hi,
I'm trying to understand the power systems library. I am coming from an optimization background and familiar with some power grid simulation software tools. However, I am having difficulties in understanding/interpreting the models within this library. I read the user's guide and went over the examples. Especially AC3ph is of interest to me.

I'd appreciate if anyone could give suggestions. Here are a couple of my questions (see the simple model attached):
1-How do I observe the natural coordinate (abc phase system) outputs?
2-How do I plot the sinusoidal of the  voltage source?
3-How do I observe neutral related information (especially for line components)?
4-Is there documentation somewhere explaining how to relate the real parameters/measurements  to the parameters of the library models (how can the info/test sheet obtained from a transformer manufacturer be used to set parameter values of a transformer model )?

Thank you very much in advance.

PSL-basic-test1.mo

Mar-15-14 00:32:43
Errors in instantiation of the model

Hi, I am all new to OpenModelica. I am trying to run the examples provided under Energy Storage Library. The first example "impedance" runs without problems. But for the others (SimpleCellDrivingCycle, AdvancedCellPulseCurrent, AdvancedCellCycling, SimpleStackCycling, AdvancedStackCycling), when I try to instantiate the model, I get a message saying instantiation failed. How can I fix this problem? Are there any documents explaining these examples?

Thank you very much in advance.



Here are the errors:



Translation    15:19:59        0:0-0:0    Error occurred while flattening model Modelica_EnergyStorages.Examples.AdvancedStackCycling
Translation    15:19:59    C:\OpenModelica1.9.0\lib\omlibrary\Modelica_EnergyStorages 3.2.1.mo    754:7-759:75    Looking for a function CellRecords.LinearDynamicImpedance.Test1Parameters but found a RECORD.
Translation    15:19:59    C:\OpenModelica1.9.0\lib\omlibrary\Modelica_EnergyStorages 3.2.1.mo    3515:11-3517:80    Looking for a function Modelica_EnergyStorages.CellRecords.Components.SOCOCV but found a RECORD.
Translation    15:19:59    C:\OpenModelica1.9.0\lib\omlibrary\Modelica_EnergyStorages 3.2.1.mo    3541:9-3543:59    Array constructor may not be empty.
Translation    15:19:59    C:\OpenModelica1.9.0\lib\omlibrary\Modelica_EnergyStorages 3.2.1.mo    3515:11-3517:80    Looking for a function Modelica_EnergyStorages.CellRecords.Components.SOCOCV but found a RECORD.
Translation    15:19:59    C:\OpenModelica1.9.0\lib\omlibrary\Modelica_EnergyStorages 3.2.1.mo    3541:9-3543:59    Array constructor may not be empty.
Translation    15:19:59    C:\OpenModelica1.9.0\lib\omlibrary\Modelica_EnergyStorages 3.2.1.mo    3515:11-3517:80    Looking for a function Modelica_EnergyStorages.CellRecords.Components.SOCOCV but found a RECORD.
Translation    15:19:59    C:\OpenModelica1.9.0\lib\omlibrary\Modelica_EnergyStorages 3.2.1.mo    3541:9-3543:59    Array constructor may not be empty.
Translation    15:19:59    C:\OpenModelica1.9.0\lib\omlibrary\Modelica_EnergyStorages 3.2.1.mo    3515:11-3517:80    Looking for a function Modelica_EnergyStorages.CellRecords.Components.SOCOCV but found a RECORD.
Translation    15:19:59    C:\OpenModelica1.9.0\lib\omlibrary\Modelica_EnergyStorages 3.2.1.mo    3541:9-3543:59    Array constructor may not be empty.
Translation    15:20:00    C:\OpenModelica1.9.0\lib\omlibrary\Modelica_EnergyStorages 3.2.1.mo    3541:9-3543:59    Array constructor may not be empty.
Translation    15:20:00    C:\OpenModelica1.9.0\lib\omlibrary\Modelica_EnergyStorages 3.2.1.mo    3515:11-3517:80    Looking for a function Modelica_EnergyStorages.CellRecords.Components.SOCOCV but found a RECORD.
Translation    15:20:00    C:\OpenModelica1.9.0\lib\omlibrary\Modelica_EnergyStorages 3.2.1.mo    3515:11-3517:80    Looking for a function Modelica_EnergyStorages.CellRecords.Components.SOCOCV but found a RECORD.
Translation    15:20:00    C:\OpenModelica1.9.0\lib\omlibrary\Modelica_EnergyStorages 3.2.1.mo    3541:9-3543:59    Array constructor may not be empty.
Translation    15:20:00    C:\OpenModelica1.9.0\lib\omlibrary\Modelica_EnergyStorages 3.2.1.mo    3515:11-3517:80    Looking for a function Modelica_EnergyStorages.CellRecords.Components.SOCOCV but found a RECORD.
Scripting    15:20:00        0:0-0:0    Instantiation of AdvancedStackCycling failed.
Translation    15:20:00    C:\OpenModelica1.9.0\lib\omlibrary\Modelica_EnergyStorages 3.2.1.mo    3541:9-3543:59    Array constructor may not be empty.

  • Index
  • » Users
  • » s-anderson
  • » Profile
You are here: