% calculate total variation for input usage
clc;clear 
%% SRC
load('ResultsSRC')
TV_SP_SRC = sum(abs(diff(qSPSRC)));
TV_D_SRC = sum(abs(diff(qDSRC)));
TV_TP_SRC = sum(abs(diff(qTPSRC)));
TV_EP_SRC = sum(abs(diff(qEPSRC)));

%% 3C
load('Results3C_05')
TV_SP_3C = sum(abs(diff(qSP3C)));
TV_D_3C = sum(abs(diff(qD3C)));
TV_TP_3C = sum(abs(diff(qTP3C)));
TV_EP_3C = sum(abs(diff(qEP3C)));

%% MPC
load('ResultsMPC_Ph10')
for i=1:4
TV_MPC(i,1) = sum(abs(diff(u_vec(:,i))));
end

%% Compile results

TV_SP = [TV_SP_SRC, TV_SP_3C, TV_MPC(1)]
TV_D  = [TV_D_SRC,  TV_D_3C,  TV_MPC(2)]
TV_TP = [TV_TP_SRC, TV_TP_3C, TV_MPC(3)]
TV_EP = [TV_EP_SRC, TV_EP_3C, TV_MPC(4)]

