Project 2 Thermal modeling of battery pack
Overall model-

Battery subsystem-

Configuring:
Battery-
Here we are connected 10 'Table based' battery in series, the maximum positive terminal(1) and maximum negative terminal(2) are given as output terminals from
battery subsystem.
The thermal port and SOC are enabled for each cells as selecting 'Instrumented,Shown thermal port' from Simscape block as shown below.

The battery configurations are set in default conditions in main function.
The vector of SOC are given as 0,0.25,0.75,1.They are representing the percentage of cell.
Temperature parameters are enabled as tabulated parameters over temperature.
Vector of temperatures are given as 273.15,298.15,323.15 in Kelvin.
No-load voltages for 4 stages of SOC conditions corresponding to their 3 temperature values are mentioned as 12 no-load voltage values.
Terminal resistances at their corresponding array no-load voltages are given by 12 resistance values.
Battery capacity defined by three values 2.9Ah,4.1Ah,4.2Ah corresponding to its 3 temperature conditions.

To see the battery life variations we have to configure the fade parameters as shown below,
Here number of N discharge cycles value is given DC variable base workspace.
Percentage change in no-load voltage after N discharge cycles is given as a.
Percentage change in terminal resistance after N discharge sycles given as b.
Percentage change in capacity of cell after N discharge cycle is given as c.

Their values are given as shown below,

Thermal mass of cell is given as 30000J/K.

The variables are given as below,

Initial SOC as 0.1 as 10%.Cell temperature value is given in baseworkspace area.
These cell configurations are same for all series connect cells.
Matlab function-
This block is used to communicate the logics between matlab script and the model using a function command.
Here matlab function block is used to generated controlled charging/discharging current pulses to give as input to controlled current source as shown below,
Inputs are taken as SOC(from feedback),BSOC(previous SOC value),CR(charging current),DSR(Discharging current).

The matlab code is written as,

Here initially we are checking the condition of battery performance as whether charging or discharging.
If current SOC is less than BSOC the condition is discharging (negative CHECK value) gives -DSR value as pulse.
If current SOC is greater than BSOC the condition is charging(positive CHECK value) gives +CR value as pulse.
If SOC reached 90% then it starts dischargeing and if SOC reached 10% again charging operation will occurs.
Convective heat transfer-
This block is used to transfer the thermal heat from source to battery to control the battery temperature.
Area of contact is given as 1m2.Heat transfer coefficient as 20W/(m2*K).

Temperature source-
Temperature to maintain the battery is given by this block and connected to A port of convective heat transfer.

Temperature sensor:
This block is used to find the temperature change in cells with respect to corresponding heat source.The output can be seen through T port of block.
The A port is cinnected between H-B ports to sence the temperature changes and see in scope.

WORKING:
Initially current pulses are given to controlled current source.It produces the current according to the signal and gives to battery treminals,
The battery gets charge and discharge accordingly to the current.
we are producing the current singals as shown below,

Here 45A as charging rate and 30A as discharging rate is given to controlled current source.
The output SOC of battery we get as,

The charging and discharging of current gets stopped when its operating voltage gets below cutoff voltage.
The voltage plot is shown as below,

The above image shows that as the life cycles increases the operating voltages decreases and reaching to its cutoff voltage.
The battery initial temperature is given as 298.15K and the source temperature given as 300K.
Thus the Temperature reaches from 298.15K to 301K as shown below,

From above image we can say that increase in temperature of battery varies its life cycle performance as we seen above.
Changes in life cycle performance with respet to its source temperature:
Case 1:
If we change source temperature to 310K and cell initial temperature as 298.15, the time taken to get reach its below charging/discharging capacity level as shown below,
Its cell temperature plots as,

Voltage waveform was seen as

case 2:
If source temperature is reduced less than the battery temperature as 290K,the time taken to reach its cutoff voltage as shown below,

This happens due to as the temperature of cell reduces from its initial temperature.This can be seen as,

Note: Model file with its Variable files are attached with this submission.