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

Modelica_EnergyStorages

Modelica_EnergyStorages

Hi,
I have question about OM EnergyStorages library.

I designed basic discharging circuit atteched below.

batt1.mo

I want to change CC load discharging current during to simulation. I mean ; first 500 second  dicharging 20 amps, then next 500 second discharging current gonna be 40 amps. Is that possible?

Thnaks

Oki

Attachments:

Re: Modelica_EnergyStorages

I think it is better to use MSL components outside the battery.
Try this:

model batt1

  Modelica_EnergyStorages.Batteries.Cells.Basic.StaticResistance statRes(SOCini
      =1, cellParameters=
        Modelica_EnergyStorages.CellRecords.StaticResistance.Test1Parameters())
    annotation (Placement(visible=true, transformation(
        origin={-60,0},
        extent={{-10,-10},{10,10}},
        rotation=0)));
  Modelica.Electrical.Analog.Basic.Ground ground1 annotation (Placement(visible
        =true, transformation(
        origin={-60,-40},
        extent={{-10,-10},{10,10}},
        rotation=0)));
  Modelica.Electrical.Analog.Sensors.CurrentSensor currentsensor1 annotation (
      Placement(visible=true, transformation(
        origin={-40,40},
        extent={{-10,-10},{10,10}},
        rotation=360)));
  Modelica.Electrical.Analog.Sources.StepCurrent stepCurrent(
    I=20,
    offset=20,
    startTime=500) annotation (Placement(transformation(
        extent={{-10,-10},{10,10}},
        rotation=-90,
        origin={-14,-4})));
equation
  connect(statRes.pin_n, ground1.p) annotation (Line(points={{-60,-10},{-59.8662,
          -10},{-59.8662,-30},{-60,-30}}, color={0,0,255}));
  connect(statRes.pin_p, currentsensor1.p) annotation (Line(points={{-60,10},{-60.2007,
          10},{-60.2007,39.4649},{-50,39.4649},{-50,40}}, color={0,0,255}));
  connect(stepCurrent.p, currentsensor1.n) annotation (Line(
      points={{-14,6},{-14,40},{-30,40}},
      color={0,0,255},
      smooth=Smooth.None));
  connect(stepCurrent.n, ground1.p) annotation (Line(
      points={{-14,-14},{-14,-22},{-60,-22},{-59.8662,-30},{-60,-30}},
      color={0,0,255},
      smooth=Smooth.None));
  annotation (
    Diagram(coordinateSystem(
        extent={{-100,-60},{100,60}},
        preserveAspectRatio=false,
        initialScale=0.1,
        grid={2,2}), graphics),
    Icon(coordinateSystem(
        extent={{-100,-60},{100,60}},
        preserveAspectRatio=true,
        initialScale=0.1,
        grid={2,2})),
    uses(Modelica(version="3.2.1")),
    experiment(StopTime=1500, __Dymola_NumberOfIntervals=2000),
    __Dymola_experimentSetupOutput);
end batt1;

Re: Modelica_EnergyStorages

Hi Ceraolo,
Thanks for your answer.
I know stepCurrent component.  But i need  something with more  step like this.
https://openmodelica.org/images/agorapro/attachments/4218/mini_pattern.jpg

For example i can read from table time,current rate e.t.c

Is there ayy way to do this?

Thanks

Oki

Attachments:

Re: Modelica_EnergyStorages

Hi Ceraolo,
There is a component called  tableCurrent. I this what i am looking for. Thanks anyway...
OKi

Re: Modelica_EnergyStorages

Hi Ceraolo,
I use  Analog.Source.TableCurrent. But i got below error.

[C:/OpenModelica1.9.1/lib/omlibrary/Modelica 3.2.1/Blocks/Sources.mo:2080:5-2080:19] Error: Model is structurally singular, error found sorting equations
17: 0.0 = tablecurrent1.signalSource.a * time + tablecurrent1.signalSource.b;
18: algorithm
.....

Here is my test circuit.

batt2.mo

Could you please check device, whats wrong with

Thanks
Oki

Attachments:

Re: Modelica_EnergyStorages

There were a few mistakes in your code.
I've changed it, and changed you current table.
You can change it again at you wish.
Good luck!

Here a working code:

model batt2

  Modelica_EnergyStorages.Batteries.Cells.Basic.StaticResistance statRes(SOCini
      =1, cellParameters=
        Modelica_EnergyStorages.CellRecords.StaticResistance.Test1Parameters())
    annotation (Placement(visible=true, transformation(
        origin={-60,0},
        extent={{-10,-10},{10,10}},
        rotation=0)));
  Modelica.Electrical.Analog.Basic.Ground ground1 annotation (Placement(visible
        =true, transformation(
        origin={-60,-40},
        extent={{-10,-10},{10,10}},
        rotation=0)));
  Modelica.Electrical.Analog.Sensors.CurrentSensor currentsensor1 annotation (
      Placement(visible=true, transformation(
        origin={-40,40},
        extent={{-10,-10},{10,10}},
        rotation=360)));
  Modelica.Electrical.Analog.Sources.TableCurrent tablecurrent1(startTime=100,
      table=[0, 10; 100, 10; 100.1, 20; 200, 20; 200.1, 30; 300, 30])
    annotation (Placement(visible=true, transformation(
        origin={-20,2},
        extent={{-10,-10},{10,10}},
        rotation=-90)));
equation
  connect(tablecurrent1.n, ground1.p) annotation (Line(points={{-20,-8},{-20,-30.1003},
          {-60,-30.1003},{-60,-30}}, color={0,0,255}));
  connect(statRes.pin_n, ground1.p) annotation (Line(points={{-60,-10},{-59.8662,
          -10},{-59.8662,-30},{-60,-30}}, color={0,0,255}));
  connect(statRes.pin_p, currentsensor1.p) annotation (Line(points={{-60,10},{-60.2007,
          10},{-60.2007,39.4649},{-50,39.4649},{-50,40}}, color={0,0,255}));
  connect(tablecurrent1.p, currentsensor1.n) annotation (Line(
      points={{-20,12},{-20,40},{-30,40}},
      color={0,0,255},
      smooth=Smooth.None));
  annotation (
    Diagram(coordinateSystem(
        extent={{-100,-60},{100,60}},
        preserveAspectRatio=false,
        initialScale=0.1,
        grid={2,2}), graphics),
    Icon(coordinateSystem(
        extent={{-100,-60},{100,60}},
        preserveAspectRatio=true,
        initialScale=0.1,
        grid={2,2})),
    uses(Modelica(version="3.2.1")),
    experiment(StopTime=1500, __Dymola_NumberOfIntervals=2000),
    __Dymola_experimentSetupOutput);
end batt2;

Re: Modelica_EnergyStorages

thank you so much, i have a problem, the OMC edit do not enable me a copy of component "test1 parameter"    . My OMC edit do enable to make a copy of ebery component. there is no command copy on Library Window (page 45 of user guide) . why?

Re: Modelica_EnergyStorages

Depends on your version of OMEdit. The new version from nightly builds have the copy command but I strongly recommend to not use it for nested classes unless this ticket is fixed https://trac.openmodelica.org/OpenModelica/ticket/2190

Adeel.

Re: Modelica_EnergyStorages

thank you, i have OME edit version "OpenModelica 1.9.1 (r22929) (RML version)"
Is it not last version? but i don't have copy command,
What is it MSL? so there is not one way to copy an object/class in OMEdit?

Edited by: claudio34 - Jan-05-15 07:46:14

Re: Modelica_EnergyStorages

BTW, Adeel,
did you see that I reopened ticket #2956?
maybe re-fixing it for you is a trivial activity; for me, instead, that is a blocking issue.

I thank you in advance.

Massimo

Re: Modelica_EnergyStorages

Hello Massimo, are you Italian like me? i send you a PM, bye

Re: Modelica_EnergyStorages

Yes, I'm Italian, but in general don't have much free time available.

I'm answering in this forum these days just because of the holiday period.
I hope my answers regarding your issues with Energy_storages were useful.


Re: Modelica_EnergyStorages

You need r23234.

Adeel.

Re: Modelica_EnergyStorages

thank you Adeel, where can i find  r23234  release.?

Edited by: claudio34 - Jan-05-15 15:43:51

Re: Modelica_EnergyStorages

You can download the latest nightly build from here (recommended) https://build.openmodelica.org/omc/buil … ly-builds/
OR
Download the older nightly builds from https://build.openmodelica.org/omc/buil … lds/older/

Adeel.

Re: Modelica_EnergyStorages

thamk you

Re: Modelica_EnergyStorages

i'd like to use LinearDynamicImpedanceMatrix battery stack but don't work. Every other componenti of battery library works good but the  LinearDynamicImpedanceMatrix stack.
Any of you able to operate the LinearDynamicImpedenceMatrix component stack?
The parameters are setting:

UseHeatPort : false
TOperational 293.15 K
useCellTerminals: True
cellParameters:  Modelica_EnergyStorages.CellRecords.LinearDynamicImpedance.LinearDynamicImpedanceParameters()
SOCini[ns,np]:   [10,10]


screnn photo here https://www.facebook.com/photo.php?fbid … mp;theater

Alarm message:
"[10] 13:25:03 Validation of model p1
Error: [:0:0-0:0] Error occurred while flattening model p1
Error: [:0:0-0:0] Function argument capacity was not given by the function call, and does not have a default value.

Validation of model p1 completed with errors."


https://www.facebook.com/photo.php?fbid=10205769328455348&set=a.1815702275237.106055.1320503611&type=1&theater

Edited by: claudio34 - Jan-09-15 16:40:40
There are 0 guests and 0 other users also viewing this topic