names = {'shallow_oil' 'deep_oil' 'shallow_water'};
limits = {0.015 0.100 0.070};

for i = 1:3
    simulation = load(['rolling_tank_' names{i} '_simulation.dat']);
    experiment = load(['rolling_tank_' names{i} '_experiment.dat']);
    
    figure;
    plot(simulation(:,1),simulation(:,2),'k-');
    hold on;
    plot(experiment(:,1),experiment(:,2),'b-');
    hold off;
    xlim([0 5]);
    ylim([-limits{i} limits{i}]);
    xlabel('Time [s]');
    ylabel('Displacement [m]');
    legend('Simulation','Experiment');
end;

composite = load('falling_composite_cylinder_simulation.dat');
rigid = load('falling_rigid_cylinder_simulation.dat');

figure;
plot(composite(:,1),0.3-composite(:,3)+composite(:,2),'k-');
xlim([0 0.025]);
ylim([-0.02 0.02]);
xlabel('Time [s]');
ylabel('Deformation [m]');
legend('Composite');

figure;
time = composite(1:end-1,1);
velocity = (composite(2:end,2)-composite(1:end-1,2))/0.000005;
plot(time,velocity,'k-');
time = rigid(1:end-1,1);
velocity = (rigid(2:end,2)-rigid(1:end-1,2))/0.000010;
hold on;
plot(time,velocity,'b-');
hold off;
xlim([0.004 0.0125]);
ylim([-5.5 0]);
xlabel('Time [s]');
ylabel('Velocity [m/s]');
legend('Composite','Rigid');

figure;
time = composite(1:end,1);
force = composite(1:end,4);
plot(time,force,'k-');
time = rigid(1:end,1);
force = rigid(1:end,4);
hold on;
plot(time,force,'b-');
hold off;
xlim([0.004 0.0125]);
ylim([0 6500]);
xlabel('Time [s]');
ylabel('Force [N]');
legend('Composite','Rigid');