Code development platform for open source projects from the European Union institutions

Skip to content
Snippets Groups Projects
Commit 84f5d177 authored by Markus Quaritsch's avatar Markus Quaritsch
Browse files

Pull request #179: Bugfix/VECTO-1559 battery internal resistance curve

Merge in VECTO/vecto-dev from VECTO/mq_vecto-dev:bugfix/VECTO-1559-battery-internal-resistance-curve to develop

* commit '44c35f76':
  bugfix reading internal resistance curve with 5 columns
  adding testcase reading internal resistance with 5 columns (R_i 120s)
parents 89cb354c 44c35f76
No related branches found
No related tags found
No related merge requests found
......@@ -15,7 +15,7 @@ namespace TUGraz.VectoCore.InputData.Reader.ComponentData
{
public static InternalResistanceMap Create(DataTable data, bool inmOhm)
{
if (!(data.Columns.Count == 2 || data.Columns.Count == 4 || data.Columns.Count != 5)) {
if (!(data.Columns.Count == 2 || data.Columns.Count == 4 || data.Columns.Count == 5)) {
throw new VectoException(
"Internal Resistance Map data must contain either two, four or five columns: {0}, {1}",
Fields.StateOfCharge, Fields.InternalResistance);
......
......@@ -296,6 +296,34 @@ namespace TUGraz.VectoCore.Tests.Models.SimulationComponent
}
}
[TestCase(0.5, 0.5, 5000)]
public void BatteryTimeDependentInternalResistanceTest_120s(double initialSoC, double dt,
double powerDemand)
{
var r1 = 0.02;
var r2 = 0.04;
var r3 = 0.1;
var r4 = 0.15;
var batteryData = new BatterySystemData() {
Batteries = new List<Tuple<int, BatteryData>>() {
Tuple.Create(0, new BatteryData() {
Capacity = REESS_Capacity.SI(Unit.SI.Ampere.Hour).Cast<AmpereSecond>(),
MinSOC = REESS_MinSoC,
MaxSOC = REESS_MaxSoC,
SOCMap = BatterySOCReader.Create("SOC,V\n0,590\n100,658".ToStream()),
InternalResistance =
BatteryInternalResistanceReader.Create(
$"SoC, Ri-2, Ri-10, Ri-20, Ri-120\n0, {r1}, {r2}, {r3},{r4}\n100, {r1}, {r2}, {r3}, {r4}".ToStream(),
false),
MaxCurrent = BatteryMaxCurrentReader.Create(
"SOC, I_charge, I_discharge\n0, 375, 573\n100, 375, 375".ToStream()),
})
}
};
}
[TestCase(0.5, 0.5, 5000),
TestCase(0.5, 0.5, -5000)]
public void BatteryTimeDependentInternalResistanceTest_LoadChanges(double initialSoC, double dt, double powerDemand)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment