I have plotted a graph of load and displacment shown below:
enter image description here
The area enclosed within this graph is energy dissipated. I want to know what the area is inside each loop the graph makes. For example, I want the code to return loop 1: area in loop 1, loop 2: area in loop 2, …
So far I have managed to plot the graph and use cumtrapz to work out the total area enclosed within all the loops. This total area was 2167.25 (J). But I am not sure how I can work out what the area is within each individual loop. If anyone could work out what the area is within each individual loop I would highly appreciate it. Thanks in advance.
data = xlsread('results.xlsx');
x = xlsread('results.xlsx', 'results', 'AK:AK');
y = xlsread('results.xlsx', 'results', 'AJ:AJ');
figure;
plot(x, y, 'k-');
xlabel('Displacement (m)', 'FontSize', 14);
ylabel('Load (N)', 'FontSize', 14);
% Calculate area under all loops
area_under_curves = cumtrapz(x, y);
% Total area under all loops
total_area = area_under_curves(end);
% Display the total area under all loops
fprintf('Total area under all loops: %.2fn', total_area);