- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Modelica_EnergyStorages
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
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;
- ceraolo
- 147 Posts
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
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;
- ceraolo
- 147 Posts
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?
- claudio34
- 88 Posts
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.
- adeas
- 454 Posts
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?
- claudio34
- 88 Posts
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
- ceraolo
- 147 Posts
Re: Modelica_EnergyStorages
Hello Massimo, are you Italian like me? i send you a PM, bye
- claudio34
- 88 Posts
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.
- ceraolo
- 147 Posts
Re: Modelica_EnergyStorages
You need r23234.
Adeel.
- adeas
- 454 Posts
Re: Modelica_EnergyStorages
thank you Adeel, where can i find r23234 release.?
- claudio34
- 88 Posts
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.
- adeas
- 454 Posts
Re: Modelica_EnergyStorages
thamk you
- claudio34
- 88 Posts
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."
- claudio34
- 88 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Modelica_EnergyStorages