%Ableitung der dynamischen Radlasten aus der Summe der Aufbau- und
%Radträgerbeschleunigung auf ein Weg-Zeit-Signal 

%Eingabebereich
aAL = aAL; aAR = aAR;                 %Beschleunigung des Aufbaus
aRL = aRL; aRR = aRR;                 %Beschleunigung der Radträger
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Integration der Beschleunigung auf ein Geschwindigkeitssignal
vAL=cumtrapz(t,dyn_aAL);
vAR=cumtrapz(t,dyn_aAR);
vRL=cumtrapz(t,dyn_aRL);
vRR=cumtrapz(t,dyn_aRR);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Integration der Beschleunigung auf ein Geschwindigkeitssignal
sAL=cumtrapz(t,vAL);
sAR=cumtrapz(t,vAR);
sRL=cumtrapz(t,vRL);
sRR=cumtrapz(t,vAL);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Ermittlung des Einfederwegs
sL=-sAL+sRL;
sR=-sAR+sRR;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%Darstellung
figure (2);
subplot (2,2,1);
plot(t,vRL); xlim([0 inf]); ylim([-inf inf]); 
xlabel('t in [s]'); ylabel('v in [m/s]');
title('Radgeschwindigkeit links');
subplot (2,2,2);
plot(t,vRR); xlim([0 inf]); ylim([-inf inf]); 
xlabel('t in [s]'); ylabel('v in [m/s]');
title('Radgeschwindigkeit rechts');
subplot (2,2,3);
plot(t,vAL); xlim([0 inf]); ylim([-inf inf]); 
xlabel('t in [s]'); ylabel('v in [m/s]');
title('Aufbaugeschwindigkeit links');
subplot (2,2,4);
plot(t,vAR); xlim([0 inf]); ylim([-inf inf]); 
xlabel('t in [s]'); ylabel('v in [m/s]');
title('Aufbaugeschwindigkeit rechts');
figure (3);
subplot (2,2,1);
plot(t,sRL); xlim([0 inf]); ylim([-inf inf]); 
xlabel('t in [s]'); ylabel('s in [m]');
title('Radweg links');
subplot (2,2,2);
plot(t,sRR); xlim([0 inf]); ylim([-inf inf]); 
xlabel('t in [s]'); ylabel('s in [m]');
title('Radweg rechts');
subplot (2,2,3);
plot(t,sAL); xlim([0 inf]); ylim([-inf inf]); 
xlabel('t in [s]'); ylabel('s in [m]');
title('Aufbauweg links');
subplot (2,2,4);
plot(t,sAR); xlim([0 inf]); ylim([-inf inf]); 
xlabel('t in [s]'); ylabel('s in [m]');
title('Aufbauweg rechts');
figure (4);
subplot (1,2,1);
plot(t,sL); xlim([0 inf]); ylim([-inf inf]); 
xlabel('t in [s]'); ylabel('s in [m]');
title('dynamischer Federweg links');
subplot (1,2,2);
plot(t,sR); xlim([0 inf]); ylim([-inf inf]); 
xlabel('t in [s]'); ylabel('s in [m]');
title('dynamischer Federweg rechts');
figure (1);
subplot (2,2,1);
plot(t,aRL); xlim([0 inf]); ylim([-inf inf]); 
xlabel('t in [s]'); ylabel('v in [m/s²]');
title('Radbeschleunigung links');
subplot (2,2,2);
plot(t,aRR); xlim([0 inf]); ylim([-inf inf]); 
xlabel('t in [s]'); ylabel('v in [m/s²]');
title('Radbeschleunigung rechts');
subplot (2,2,3);
plot(t,aAL); xlim([0 inf]); ylim([-inf inf]); 
xlabel('t in [s]'); ylabel('v in [m/s²]');
title('Aufbaubeschleunigung links');
subplot (2,2,4);
plot(t,aAR); xlim([0 inf]); ylim([-inf inf]); 
xlabel('t in [s]'); ylabel('v in [m/s²]');
title('Aufbaubeschleunigung rechts');