ME G200
Assumptions/simplifications:
The main unit of calculation is degrees of latitude or longitude, which are assumed equal= 60 miles (although theres an average difference of 20 miles between them in the general area covered by hurricane) The hurricane is invisid like normal air, to get circulation is constant for all points in the velocity field (map) at a one-time instant. Radius of the core=5 degrees (whether latitude or longitude). An alteration is offered to change it to km, but currently the velocity gradient across the radius is clearer. In the calculation of the position of the pathline particles, the new position is calculated by multiplying the velocity of the point the particle is currently in with the time step(6h), and rounding that new destination to fit on the grid of longitudes and latitudes so that the new location would correspond to a point we have the velocity for (exists on the velocity field, to use it to find distance crossed in the next time step).
Yussef Rikli
ME G200
68
Erase %.
71
Erase %
74-77
Change the rotation direction of the hurricane and produce VERY different results. Change the radius of the core from 5 degrees=5*1.6*60 km, To 5km Affects pathlines and streamlines. The location and size of the computed velocity field on the map.
84
87
The margin added to the edges of the velocity field when displaying the map. In other words, zooming in or out. See how the stream and pathlines at these cities.
Points have to be in north and western hemispheres. Points shouldnt be close to the edge of the velocity field, for pathline calculation.
Erase ;% Add ;% before +vcx(t); and +vcy(t); Change the 10 to increase or decrease the font size of the cities Replace off with on Change the number of pause(in seconds) between the consecutive time iterations Add % at beginning of line
The velocity of points will be affected by the velocity of center based on their distance from it, and not indiscriminately
Yussef Rikli
ME G200
Possible improvements:
Calculate error between velocities at cities with actual measured velocities available. Fixing the streaklines code. using matlabs plotm, which is much easier for geospatial applications.
Yussef Rikli
0.0260 0.0260 0.0260 0.0270 0.0270 0.0270 0.0270 0.0280 0.0280 0.0280 0.0280 0.0290 0.0290 0.0290 0.0290 0.0290 0.0290 0.0300 ^days
ME G200
% speed(kt)
T(1,:)=(L(:,1).*24)+(L(:,2)/100); %linearizing the time line at which the velocities are give in units of hours. xc(1,:)=L(:,3); yc(1,:)=L(:,4); %are the coordinates of the hurricane center. umax(1,:)=L(:,6)%.*-1 %add the multiplication by -1 for clockwise hurricane rotation.(currently counter clockwise) rmax=5 %/(1.6*60) %the assumed radius of the hurricane core(unit is degrees) xl=50 xs=1 %can't=0 or be negative yl=120 ys=50 %can't=0 or be negative %these are the largest and smallest lat/long lines, or edges of the %computed velocity field (grid 1 degree apart). the (0,0) origin for this field is %lat=long=0. this field should be large enough to calculate the velocities %in the vicinity of the desired cities. and the lines should never=0 or %become -ive. margin=10 %map plot margin in length of degrees CITY={{40,74,'<NYC'},{32,65,'<Bermuda'},{30,80,'<Florida'},{37,76,'<Virginia' },{40,86,'<Indiana'}} %NOTE: cities near the equator may cause errors, as their particles may get %carried below the equator, which would cause an error. also the negative
Yussef Rikli
ME G200
%VELOCITY OF CENTER AT ALL TIMES for t=2:size(T,2) vc(t)=sqrt((xc(t)-xc(t-1))^2+(yc(t)-yc(t-1))^2)/(T(t)-T(t-1)); vcx(t)=(xc(t)-xc(t-1))/(T(t)-T(t-1)); vcy(t)=(yc(t)-yc(t-1))/(T(t)-T(t-1)); end
%VELOCITY COMPONENTS FIELD FOR ALL PARTICLES AT ALL TIMES for t=1:size(T,2) for x=xs:xl for y=ys:yl G(t)=umax(t)*2*pi*rmax; r(x,y,t)=sqrt((x-xc(t))^2+(y-yc(t))^2); if r(x,y,t)>rmax u(x,y,t)=(G(t)/(2*pi*r(x,y,t)));% +(vc(t) (vc(t)/(max(r(:,:,t)))*r(x,y,t))); else u(x,y,t)=((umax(t)/rmax)*r(x,y,t));% +(vc(t) (vc(t)/(max(r(:,:,t)))*r(x,y,t))); %for an effect of center velocity that dwindles with distance, and is not constant for all points in the field. end theta(x,y,t)=atan2((x-xc(t)),(y-yc(t))); ux(x,y,t)=u(x,y,t)*sin(theta(x,y,t)+90);%this should be wrong because i'm using 90 with sin here and not sind, but it works uy(x,y,t)=u(x,y,t)*cos(theta(x,y,t)+90); U(x,y,t)=ux(x,y,t)+vcx(t); V(x,y,t)=uy(x,y,t)+vcy(t); end end end
%PARTICLES FOR STREAKLINES AND PATHLINES %PROBLEM FOR STREAKLINES: P=3 DDDOOEESSN'TT EXXIISSSTTT; xp(3,:) is zero or %doesn't exist.(although it should!!) for p=1:t for t=2:size(T,2) for city=1:size(CITY,2) dx(p,1)=0; dy(p,1)=0; xp(p,1,city)=CITY{city}{1};
Yussef Rikli
ME G200
up(p,t,city)=U(round(xp(p,t,city)),round(yp(p,t,city)),t-1); vp(p,t,city)=V(round(xp(p,t,city)),round(yp(p,t,city)),t-1);
%PLOT OF VELOCITY FIELD OVER TIME WITH STREAMLINES for t=1:size(T,2) map = imread('equidistancecropped.jpg'); imshow(map) image([180,-180],[80,-80],map) set(gca,'YDir','normal') hold on for b=1:size(CITY,2) quiver(V(:,:,t),U(:,:,t)) plot(yc(1,1:t),xc(1,1:t),'-y.','markersize',12) streamline(V(:,:,t),U(:,:,t),CITY{b}{2},CITY{b}{1}) %plot(yp(1,1:t,b),xp(1,1:t,b),'-r ^','markersize',5) text(CITY{b}{2},CITY{b}{1},CITY{b}(3), 'fontsize', 10,'HorizontalAlignment','left') xlabel('Degrees longitude W(-ive)') ylabel('Degrees latitude N') axis equal %tight axis([ys-margin,yl+margin,xs-margin,xl+margin]) set(gca,'XDir','reverse') hold on end hold off %grid on
Yussef Rikli
pause(.3) end
ME G200
%PLOT OF STREAMLINES AND PATHLINES FOR INDIVIDUAL CITIES for b=1:size(CITY,2) map = imread('equidistancecropped.jpg'); imshow(map) image([180,-180],[80,-80],map) set(gca,'YDir','normal') hold on for t=1:size(T,2) plot(yp(1,1:t,b),xp(1,1:t,b),'- g*') streamline(V(:,:,t),U(:,:,t),CITY{b}{2},CITY{b}{1}) text(CITY{b}{2},CITY{b}{1},CITY{b}(3), 'fontsize', 10,'HorizontalAlignment','left') xlabel('Degrees longitude W') ylabel('Degrees latitude N') axis equal %tight axis([ys-margin,yl+margin,xs-margin,xl+margin]) set(gca,'XDir','reverse') pause(.3) end hold off end