Project 2 Thermal modeling of battery pack
For a 10-cell lithium-ion battery model, simulate the thermal effects and compare life cycle performance at various temperatures and charge & discharge rates using MATLAB.
Simulating the thermal effects and comparing the life cycle performance of a 10-cell series lithium-ion battery model in MATLAB involves several steps. Below is a high-level overview and a basic MATLAB script to get you started. You may need to adapt the script based on the specific parameters and requirements of your study.
### Steps:
1. Model Initialization: Define battery parameters and initialize the battery model.
2. Thermal Model: Implement the thermal effects in the battery model.
3. Charge/Discharge Profiles: Define various charge and discharge rates.
4. Simulation: Run the simulation for different temperatures and charge/discharge rates.
5. Life Cycle Analysis: Analyze the results to compare life cycle performance.
### Basic MATLAB Script:
First, ensure you have the necessary toolboxes installed, such as Simulink and Simscape.
Battery Parameters
numCells = 10;
cellCapacity = 2.5; % Ah
cellVoltage = 3.7; % V nominal
cellResistance = 0.05; % Ohms
initialSOC = 1.0; % Initial State of Charge (100%)
% Thermal Parameters
ambientTemps = [10, 25, 40]; % Different ambient temperatures in Celsius
thermalResistance = 0.1; % K/W
thermal capacitance = 100; % J/K
Charge/Discharge Profiles
chargeRates = [0.5, 1, 2]; % C-rates
dischargeRates = [0.5, 1, 2]; % C-rates
% Simulation Time
SimTime = 3600; % 1 hour in seconds
Initialize results storage
results = struct();
for T = ambientTemps
for chargeRate = chargeRates
for dischargeRate = dischargeRates
% Initialize SOC
SOC = initialSOC * ones(1, numCells);
% Initialize temperature
temp = T * ones(1, numCells);
% Run simulation
for t = 1:simTime
% Update current based on charge/discharge rate
current = cellCapacity * (chargeRate - dischargeRate);
% Update SOC
SOC = SOC - (current / cellCapacity / 3600);
% Calculate power dissipation (I^2R)
powerDissipation = current^2 * cellResistance;
% Update temperature (simple thermal model)
temp = temp + (powerDissipation * thermalResistance - (temp - T) / thermalCapacitance);
% Store results
results(T).(sprintf('Charge_%g_Discharge_%g', chargeRate, dischargeRate)).SOC(t, :) = SOC;
results(T).(sprintf('Charge_%g_Discharge_%g', chargeRate, dischargeRate)).Temp(t, :) = temp;
end
end
end
end
% Analyze results (plotting example)
figure;
for T = ambientTemps
subplot(3, 1, find(ambientTemps == T));
hold on;
for chargeRate = chargeRates
for dischargeRate = dischargeRates
data = results(T).(sprintf('Charge_%g_Discharge_%g', chargeRate, dischargeRate));
plot(data.SOC(:, 1), 'DisplayName', sprintf('Charge: %gC, Discharge: %gC', chargeRate, dischargeRate));
end
end
hold off;
title(sprintf('SOC at %g°C', T));
xlabel('Time (s)');
ylabel('SOC');
legend show;
end
figure;
for T = ambientTemps
subplot(3, 1, find(ambientTemps == T));
hold on;
for chargeRate = chargeRates
for dischargeRate = dischargeRates
data = results(T).(sprintf('Charge_%g_Discharge_%g', chargeRate, dischargeRate));
plot(data.Temp(:, 1), 'DisplayName', sprintf('Charge: %gC, Discharge: %gC', chargeRate, dischargeRate));
end
end
hold off;
title(sprintf('Temperature at %g°C', T));
xlabel('Time (s)');
ylabel('Temperature (°C)');
legend show;
end
### Explanation:
1. Battery Parameters: Initialize the battery and thermal parameters.
2. Simulation Loop: Loop through different temperatures, charge rates, and discharge rates.
3. SOC and Temperature Update: Update the state of charge and temperature based on power dissipation and the thermal model.
4. Results Storage: Store the SOC and temperature results for each configuration.
5. Plotting: Plot the SOC and temperature profiles for analysis.