For Programmers: Free Programming Magazines  


Home > Archive > Matlab > April 2005 > velocity vectors plot









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author velocity vectors plot
dj

2005-04-21, 9:00 am

I've extracted coordinates of flame contours between subsequent flame
images obtained from the experiments using other program. I have
already calculated the velocities for all the subsequent images using
other tool. The data obtained already from contours are coordinates,
velocities, distances and time, and I want to make those below

1) Plotting of the velocities from several contours in the same
figure.
2) Colormap of different colors corresponding to different velocities
vectors

I did plot the data whereas there are errors becuase the matrices of
data are not on a regular gird.

Colume 1 : x1
Colume 2 : y1
Colume 3 : x2
Colume 4 : y2
Colume 5 : distance estimated along normal line of subsequent
contours
Colume 6 : Ex1 (x coordinate estimeated by normal line along the x1
by time)
Colume 7 : Ey1 (y coordinate estimeated by normal line along the y1
by time)
Couume 8 : U (= Ex1 - x1)
Colume 9 : V (= Ey1 - y1)

the m file made are:
cd D:\park
%[daljaepark,pathout] = uigetfile('*.txt','Data') ;
%fid = fopen([pathout,ss2665,'r')
clc ; clear all ;
data = dlmread('ss2665.txt');
figure('numbertitle','on',...
'name','Flame front displacement',...
'color',[1 1 1],...
'units','normalized',...
'position',[0.01,0.4,0.45,0.5],...
'tag','fig1') ;
x1 = data(:,1);
y1 = data(:,2);
x2 = data(:,3);
y2 = data(:,4);
d = data(:,5);
epx = data(:,6);
epy = data(:,7);
u = data(:,8);
v = data(:,9);
[XI YI] = meshgrid(50:70:350,50:50:250);
plot(x1,y1,'black-');
axis equal ;
axis([50,350,50,250]);
hold on;
plot(x2,y2,'black-');
c = colormap ;
c2 = c(40:64,:) ;
colormap (c2) ;
colorbar('horiz') ;
caxis auto ;
for i=2:size(data)-1
C1prim(i) = data(i-1,2)-data(i+1,2)/data(i-1,1)-data(i+1,1) ;
norm_C1prim(i) = norm(C1prim(i)) ;
hold on ;
h = quiver(x1,y1,u,v,0) ;
end
print -djpeg10 ex

the txt file are:

169.76 231.43 165.86 231.35 4.064 165.76 232.14 -4 0.71
169.59 230.42 165.89 230.7 3.715 165.9 229.95 -3.69 -0.47
169.46 229.57 165.9 229.95 3.649 165.89 230.32 -3.57 0.75
169.33 228.63 165.88 229.1 3.555 165.89 229.52 -3.44 0.89
169.19 227.61 165.81 227.78 3.448 165.84 228.44 -3.35 0.83
169.05 226.54 165.69 226.35 3.348 165.75 227.06 -3.3 0.52
168.92 225.43 165.58 225.3 3.315 165.63 225.82 -3.29 0.39
168.8 224.3 165.45 224.23 3.321 165.51 224.77 -3.29 0.47
168.69 223.16 165.32 223.16 3.353 165.38 223.7 -3.31 0.54
168.6 222.04 165.12 221.67 3.405 165.22 222.41 -3.38 0.37
168.53 220.94 164.98 220.63 3.483 165.05 221.15 -3.48 0.21
168.47 219.88 164.86 219.63 3.561 164.92 220.13 -3.55 0.25
168.43 218.43 164.75 218.66 3.684 164.67 217.73 -3.76 -0.7
168.42 217.46 164.67 217.73 3.809 164.63 217.09 -3.79 -0.37
168.44 216.53 164.6 216.46 3.881 164.6 216.03 -3.84 -0.5
168.48 215.64 164.59 215.6 3.906 164.61 215.19 -3.87 -0.45
168.55 214.78 164.62 214.77 3.919 164.65 214.36 -3.9 -0.42
168.68 213.6 164.68 213.96 3.914 164.84 212.83 -3.84 -0.77
168.8 212.79 164.84 212.83 3.875 165 212.03 -3.8 -0.76
168.94 211.99 165 212.03 3.827 165.19 211.24 -3.75 -0.75
169.1 211.18 165.19 211.24 3.759 165.51 210.09 -3.59 -1.09
169.3 210.37 165.51 210.09 3.696 165.77 209.27 -3.53 -1.1
169.61 209.2 165.77 209.27 3.619 166.27 207.81 -3.34 -1.39
169.87 208.35 166.05 208.42 3.573 166.49 207.19 -3.38 -1.16
170.29 207.12 166.49 207.19 3.533 166.99 205.85 -3.3 -1.27
170.62 206.23 166.82 206.3 3.534 167.42 204.73 -3.2 -1.5
170.99 205.33 167.16 205.39 3.543 167.67 204.08 -3.32 -1.25
171.39 204.42 167.67 204.08 3.628 168.33 202.48 -3.06 -1.94
172.02 203.14 168.05 203.14 3.666 168.6 201.82 -3.42 -1.32
172.51 202.24 168.6 201.82 3.751 169.23 200.44 -3.28 -1.8
173.27 201 169.01 200.89 3.88 169.76 199.35 -3.51 -1.65
174.1 199.82 169.44 199.98 4.05 170.92 197.31 -3.18 -2.51
174.99 198.71 170.08 198.73 4.15 171.68 196.21 -3.31 -2.5
175.95 197.68 170.56 197.88 4.259 173.4 194.27 -2.55 -3.41
176.96 196.75 171.29 196.74 4.206 174.37 193.44 -2.59 -3.31
177.71 196.15 172.0
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com