%Modified BBarrett 15 Mar 2010 for SO414 Lab 4: Geostrophic Flow %Template for students %filename = geo.m clear all format long %%%%%%%%%% geo.m %%%%%%%%%%%%%%%%%%% load('pressure.mat'); m=size(p,2); % this establishes the density value and coriolis parameter (which we % will assume to be constant) % the dx and dy are used to establish the uniform gridpoint distance in m % student input needed rho= ; f= ; dy= ; dx= ; %%%% This is a loop to deal with our standard issues at the boundaries %%%% of the problem for m=1:51 u(1,m)=-(1/(f*rho))*(p(2,m)-p(1,m))/dy; u(51,m)=-(1/(f*rho))*(p(51,m)-p(50,m))/dy; v(m,1)=(1/(f*rho))*(p(m,2)-p(m,1))/dx; v(m,51)=(1/(f*rho))*(p(m,51)-p(m,50))/dx; end %%% This creates the domain of x and y elements in the form of arrays for i=1:51 for j=1:51 x(i,j)=dx*j; %i.e., we want each point "j" to be dx meters from point "j-1" y(i,j)=dy*i; %i.e., we want each point "i" to be dy meters from point "i-1" end end %%% Here is where your theoretical and computational prowess will shine %%% develop a finite difference code based on the geostrophic equations %%%% that create horizontal velocity components for the given pressure %%% field from the spreadsheet for i=2:50 for j=2:50 end end