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

EnergyStorageBattery

EnergyStorageBattery

Hi,
I want to change some cell parameter such as internalResistance , chargingCapacity   e.t.c  from Model.

I define parameter like this:

parameter Real newRo=0.003;

and change cellParameter like this;
Rs = ED_EES.CellRecords.Components.Resistance(R0 = newR0);

When i made this change i got below error.

Error: Component cp11.Rs of variability PARAM has binding ED_EES.CellRecords.Components.Resistance(cp11.newR0,  ....

What's wrong with this?

Thanks
Oki

Re: EnergyStorageBattery

Rs is a parameter record, which means you need to create a record where all its elements are parameters.

Re: EnergyStorageBattery

Here is my record. But still i got  error

record cp1
  parameter Real newR0 = 0.0022;
  extends ED_EES.CellRecords.StaticResistance.StaticResistanceParameters(SOCOCV = ED_EES.CellRecords.Components.SOCOCV(OCVtableOnFile = true, OCVtableName = "soclist", OCVfileName = "C:/oki/soc.txt"), capacity = ED_EES.CellRecords.Components.ChargeCapacity(C0 = 40 * 3600), Rs = ED_EES.CellRecords.Components.Resistance(R0 = newR0));
  annotation(defaultComponentPrefixes = "parameter");
end cp1;


ERROR:
[C:/ED_EES_Files/temp/d.mo:6:64-6:85] Error: Type mismatch in binding cellParameters = cp11, expected subtype of record ED_EES.CellRecords.StaticResistance.StaticResistanceParameters
  record ED_EES.CellRecords.Components.SOCOCV
  Boolean OCVtableOnFile;
  Real[0, 2] OCVtable;
  String OCVtableName;
  String OCVfileName;
end ED_EES.CellRecords.Components.SOCOCV; SOCOCV;
  record ED_EES.CellRecords.Components.ChargeCapacity
  Real(quantity = "ElectricCharge", unit = "C") C0;
  record ED_EES.CellRecords.Components.Aging
  Real(quantity = "ElectricCharge", unit = "C") Qini;
  Real(quantity = "1/Modelica.SIunits.ElectricCharge", unit = "1/(A.s)") kQabs;
  Real(quantity = "1/Modelica.SIunits.Time", unit = "1/s") kt;
end ED_EES.CellRecords.Components.Aging; aging;
  record ED_EES.CellRecords.Components.TemperatureDependency
  Real(quantity = "ThermodynamicTemperature", unit = "K", min = 0.0, start = 288.15, nominal = 300.0, displayUnit = "degC") Tref;
  Real(quantity = "LinearTemperatureCoefficient", unit = "1/K") alpha;
end ED_EES.CellRecords.Components.TemperatureDependency; temperature;
end ED_EES.CellRecords.Components.ChargeCapacity; capacity;
  record ED_EES.CellRecords.Components.Resistance
  Real(quantity = "Resistance", unit = "Ohm") R0;
  record ED_EES.CellRecords.Components.SOCDependency
  Real kSOC;
end ED_EES.CellRecords.Components.SOCDependency; SOC;
  record ED_EES.CellRecords.Components.Aging
  Real(quantity = "ElectricCharge", unit = "C") Qini;
  Real(quantity = "1/Modelica.SIunits.ElectricCharge", unit = "1/(A.s)") kQabs;
  Real(quantity = "1/Modelica.SIunits.Time", unit = "1/s") kt;
end ED_EES.CellRecords.Components.Aging; aging;
  record ED_EES.CellRecords.Components.TemperatureDependency
  Real(quantity = "ThermodynamicTemperature", unit = "K", min = 0.0, start = 288.15, nominal = 300.0, displayUnit = "degC") Tref;
  Real(quantity = "LinearTemperatureCoefficient", unit = "1/K") alpha;
end ED_EES.CellRecords.Components.TemperatureDependency; temperature;
end ED_EES.CellRecords.Components.Resistance; Rs;
  record ED_EES.CellRecords.Components.SOH
  Real(min = 0.0, max = 1.0) xc;
  Real(min = 1.0) xz;
end ED_EES.CellRecords.Components.SOH; SoH;
end ED_EES.CellRecords.StaticResistance.StaticResistanceParameters;, got type record cp1
  record ED_EES.CellRecords.Components.SOCOCV
  Boolean OCVtableOnFile;
  Real[0, 2] OCVtable;
  String OCVtableName;
  String OCVfileName;
end ED_EES.CellRecords.Components.SOCOCV; SOCOCV;
  record ED_EES.CellRecords.Components.ChargeCapacity
  Real(quantity = "ElectricCharge", unit = "C") C0;
  record ED_EES.CellRecords.Components.Aging
  Real(quantity = "ElectricCharge", unit = "C") Qini;
  Real(quantity = "1/Modelica.SIunits.ElectricCharge", unit = "1/(A.s)") kQabs;
  Real(quantity = "1/Modelica.SIunits.Time", unit = "1/s") kt;
end ED_EES.CellRecords.Components.Aging; aging;
  record ED_EES.CellRecords.Components.TemperatureDependency
  Real(quantity = "ThermodynamicTemperature", unit = "K", min = 0.0, start = 288.15, nominal = 300.0, displayUnit = "degC") Tref;
  Real(quantity = "LinearTemperatureCoefficient", unit = "1/K") alpha;
end ED_EES.CellRecords.Components.TemperatureDependency; temperature;
end ED_EES.CellRecords.Components.ChargeCapacity; capacity;
  record ED_EES.CellRecords.Components.SOH
  Real(min = 0.0, max = 1.0) xc;
  Real(min = 1.0) xz;
end ED_EES.CellRecords.Components.SOH; SoH;
  Real newR0;
  record ED_EES.CellRecords.Components.Resistance
  Real(quantity = "Resistance", unit = "Ohm") R0;
  record ED_EES.CellRecords.Components.SOCDependency
  Real kSOC;
end ED_EES.CellRecords.Components.SOCDependency; SOC;
  record ED_EES.CellRecords.Components.Aging
  Real(quantity = "ElectricCharge", unit = "C") Qini;
  Real(quantity = "1/Modelica.SIunits.ElectricCharge", unit = "1/(A.s)") kQabs;
  Real(quantity = "1/Modelica.SIunits.Time", unit = "1/s") kt;
end ED_EES.CellRecords.Components.Aging; aging;
  record ED_EES.CellRecords.Components.TemperatureDependency
  Real(quantity = "ThermodynamicTemperature", unit = "K", min = 0.0, start = 288.15, nominal = 300.0, displayUnit = "degC") Tref;
  Real(quantity = "LinearTemperatureCoefficient", unit = "1/K") alpha;
end ED_EES.CellRecords.Components.TemperatureDependency; temperature;
end ED_EES.CellRecords.Components.Resistance; Rs;
end cp1;.

Re: EnergyStorageBattery

Hi, do you have a good working battery model? If you can send me?

Edited by: claudio34 - Jul-03-15 07:12:01

Re: EnergyStorageBattery

Hi,
You have any idea whether I can directly import battery design to open modelica? Or I have to write the code? Whetehr I can make my geometry in this software or only connectors can be used?

There are 0 guests and 0 other users also viewing this topic