Clear Filters
Clear Filters

Visualize Real Measured Battery Temperature Data?

6 views (last 30 days)
I am using Simscape Battery to model and simulate a battery pack from a real world application and I am using a real world measured current load for my simulations. I am visualizing the temperatures of the pack using the BatterySimulationChart and exporting the video to a file. I want to also visualize the Measured data which corresponds to the current load that is applied to the simulation so that I can assess the performance of the model. I thought of editing the temperatures in the simlog object but the only way I can get to temperatures in the simlog object is by using values() but it is meant to return the values of temperature of voltage or state of charge and does not give me a way to edit them. I used the example for visualizing a simulation but my workflow for the project is divided into multiple scripts and folders so I don't know if posting any code would be helpful or cause more confusion but I'll post my relevant code for creating the video of the simulation data. My questions is: Is there a way I can visuzlize real measured battery temperature on the BatteryPack object that I have created?
simulation.alldata=load("../0_DATA/SIMULATION_DATA/with_adjusted_params.mat");
%% Plotting the video of temperature change
import simscape.battery.builder.*
battery_object=load("created_library\myBatteries.mat");
battsimlog = BatterySimulationLog(battery_object.UREaccu,simulation.alldata.simlog.cells);
battsimlog.SelectedVariable = "temperatureCell";
battsimlog.SelectedVariableUnit="degC";
f = uifigure("Color","w");
g = uigridlayout(f, [1,1]);
moduleChart = BatterySimulationChart(Parent = g,BatterySimulationLog = battsimlog);
moduleChartColorBar = colorbar(moduleChart);
ylabel( moduleChartColorBar, strcat(battsimlog.SelectedVariable, " (", battsimlog.SelectedVariableUnit,")") );
createVideo(moduleChart,"BatterySimulationChart_Temperature_Video",PlaybackSpeed=30,FrameRate=60);

Answers (1)

Sebastian Arias Alfaro
Sebastian Arias Alfaro on 3 Jul 2024 at 13:19
Hello Ivan,
I dont think this is possible. Currently, the BatterySimulationChart will get the temperature values from the BatterySimulationLog. And the BatterySimulationLog get the values from the simulation simscape log or simlog (simulation.alldata.simlog.cells from your example).
The only way this would be possible is if we are able to edit a simlog object (simulation.alldata.simlog.cells) and overwrite the temperature values with the measured ones, which I think cannot be changed.
Your question is a good enhancement suggestion for a future version of Simscape Battery.
Hope this answer helps!

Products


Release

R2024a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!