I tried to extract the mass out for each time interval, like 36.138-36.148s.
it works.
First: this code seems clumsy. is there any better way to do the same thing?
Next step: I would like to show an animation of particle mass. I need to check first whether there are particles appearing at the same locations (same y, z coordinates). I didn't figure that out.
Do I need to divide this table into table sets based on time points? kind of making a database, which I am not familiar with? I have found some materials dealing with only 2 variables ie mass vs time; what I would like to show is particle parcel Mass vs ( y, z) changing with time, after summing particle parcel mass up at same (y,z).
I have done part of the work by using this code:
Could you please give me some suggestions to deal with the data (8GB) more efficiently, and manipute it more conveniently?
----------------
x_5cm = readtable("D:\SPOC\tulip-shape-burner-combustor-v2\particle-tracking\particle_number\dpm_output_2s\x=0.05m.dpm", opts);
B_5cm = table2array(x_5cm);
C_5cm = sortrows(B_5cm,13);
%sample(C_5cm(:,2))
%Y_5cm = sortrows(B_5cm,2);
%histogram(C_5cm(:,13));
[N_5cm,edges_5cm] = histcounts(C_5cm(:,13));
figure(1)
t = 0:pi/500:2*pi;
xt1 = 0.0275.*sin(t);
yt1 = 0.0275.*cos(t);
zt1 = 0.*(sin(t).*sin(t)+cos(t).^2);
stem3(C_5cm(1:22880,2), C_5cm(1:22880,3), C_5cm(1:22880,9));
grid on
hold on;
plot3(xt1, yt1, zt1);
xlabel('Y','FontSize',18,'FontName','times New Roman');
ylabel('Z','FontSize',18,'FontName','times New Roman');
zlabel('particle mass','FontSize',18,'FontName','times New Roman');
----------------------------------
This code is to get the total particle parcel mass at certain time.
x_5cm = readtable("x=0.05m.dpm", opts);
B_5cm = table2array(x_5cm);
C_5cm = sortrows(B_5cm,13);
histogram(C_5cm(:,13))
[N_5cm,edges_5cm] = histcounts(C_5cm(:,13));
%nbins_5cm = round((C_5cm(end,13)-C_5cm(1,13))/0.001+1);
%histogram(C_5cm(:,13),nbins_5cm)
%[N_5cm,edges_5cm] = histcounts(C_5cm(:,13),nbins_5cm);
j=1;
for i = 1:length(N_5cm)-1
if i==1
P_5cm_M(j,1) = edges_5cm(i);
P_5cm_M(j,2) = sum(C_5cm(1:N_5cm(i),9));
else
j=j+1;
P_5cm_M(j,1) = edges_5cm(i);
P_5cm_M(j,2) = sum(C_5cm(sum(N_5cm(1:i-1)):sum(N_5cm(1:i)),9));
end
end