Energy Analysis of Wind
The read in image for analysis save it and call it wind
clc
clear
[x1,map]=imread('wind.png');
figure('Position',[5 5 1500 830])
image(x1)
axis equal
set(gca,'XLim',[0 553],'YLim',[0 174])
dist=9;
height=174;
M=height;
% for j=1:3
% for i=1:M
% xx(i,j)=x(i,dist,j);
% end
% end
x=double(x1);
for dist=1:553;
for i=1:M;
t=x(i,dist,1);
tt=x(i,dist,2);
ttt=x(i,dist,3);
v(i,dist,1:3)=[ t tt ttt ];
a=[v(i,dist,1) v(i,dist,2) v(i,dist,3)];
VVV(i,dist)=0.001*norm(a);
end
end
for dist=1:553;
VV(dist)=max(VVV(:,dist));
end
VX=sort(VV);
jh=max(VX)
for dist=1:553;
V(dist)=VX(dist)/jh;
end
histfit(V(1,1:553));figure(gcf);
grid on
%set(gca,'XLim',[0 553],'YLim',[0 0.5])
xlabel('Velocity (m/Sec)')
ylabel('Number of Cells')
clear
[x1,map]=imread('wind.png');
figure('Position',[5 5 1500 830])
image(x1)
axis equal
set(gca,'XLim',[0 553],'YLim',[0 174])
dist=9;
height=174;
M=height;
% for j=1:3
% for i=1:M
% xx(i,j)=x(i,dist,j);
% end
% end
x=double(x1);
for dist=1:553;
for i=1:M;
t=x(i,dist,1);
tt=x(i,dist,2);
ttt=x(i,dist,3);
v(i,dist,1:3)=[ t tt ttt ];
a=[v(i,dist,1) v(i,dist,2) v(i,dist,3)];
VVV(i,dist)=0.001*norm(a);
end
end
for dist=1:553;
VV(dist)=max(VVV(:,dist));
end
VX=sort(VV);
jh=max(VX)
for dist=1:553;
V(dist)=VX(dist)/jh;
end
histfit(V(1,1:553));figure(gcf);
grid on
%set(gca,'XLim',[0 553],'YLim',[0 0.5])
xlabel('Velocity (m/Sec)')
ylabel('Number of Cells')
Example
Read in the following image into the code by saving it and calling it CFX11.jpg
clc
clear
[x,map]=imread('CFX11.jpg');
figure('Position',[5 5 1500 830])
image(x)
axis equal
set(gca,'XLim',[0 1150],'YLim',[0 210])
dist=600;
height=210;
M=height;
for j=1:3
for i=1:M
xx(i,j)=x(i,dist,j);
end
end
xxx=double(x);
for i=1:M;
t=xxx(i,1);
tt=xxx(i,2);
ttt=xxx(i,3);
v(i,1:3)=[ t tt ttt ];
V(i)=norm(v(i,1:3));
end
VV=V';
y1=(1:1:M);
% save('pqfile.txt', 'VV', '-ASCII' )
%open pqfile.txt
hold on
plot(VV+dist,y1,'-')
hold off
figure(2)
plot(VV,y1)
set(gca,'XLim',[0 450],'YLim',[0 210])
%axis equal
grid on
xlabel('Temperature (K)')
ylabel('Y distance (mm)')
clear
[x,map]=imread('CFX11.jpg');
figure('Position',[5 5 1500 830])
image(x)
axis equal
set(gca,'XLim',[0 1150],'YLim',[0 210])
dist=600;
height=210;
M=height;
for j=1:3
for i=1:M
xx(i,j)=x(i,dist,j);
end
end
xxx=double(x);
for i=1:M;
t=xxx(i,1);
tt=xxx(i,2);
ttt=xxx(i,3);
v(i,1:3)=[ t tt ttt ];
V(i)=norm(v(i,1:3));
end
VV=V';
y1=(1:1:M);
% save('pqfile.txt', 'VV', '-ASCII' )
%open pqfile.txt
hold on
plot(VV+dist,y1,'-')
hold off
figure(2)
plot(VV,y1)
set(gca,'XLim',[0 450],'YLim',[0 210])
%axis equal
grid on
xlabel('Temperature (K)')
ylabel('Y distance (mm)')
Recommended Reading List
Unless otherwise noted, all content on this site is @Copyright by Ahmed Al Makky 2012-2013 - http://cfd2012.com