% autor: Matouš Přikryl
% thesis: HIL testing of BMS
% code purpose: compare output of battery models used for HIL testing

%% clear workspace
clear all;
close all;
clc;

%% load files
batt1 = load('batt_V_1batt.mat');       % 1 článek, 1 RC časové konstanty
batt2 = load('batt_V_2.mat');           % 136 článků, 2 RC časové konstanty

%% plot data
figure('Renderer', 'painters', 'Position', [100 100 770 370])
legend();
grid on
grid minor
xlim([0 batt1.out.tout(end)])
ylim([0 600])
title('Load voltage')
xlabel('time [s]')
ylabel('battery load [V]')
hold on;
plot(batt1.out.tout, squeeze(batt1.out.BatteryVoltage.signals.values), 'DisplayName', '1Batt_1RC', LineWidth=1.5);
plot(batt2.out.tout, squeeze(batt2.out.BatteryVoltage.signals.values), 'DisplayName', '1Batt_1RC', LineWidth=1.5);
hold off;