%This m-file solves the two layer ground water problem and stores the % data in a .mat file called framedata.mat % This m-file was written at the University of Wyoming in the Electrical % and Computer Engineering Department and is to be distributed without % cost. % Working in meters and days here are the parameters clear all bprime=5;Kprime=1.728;S=5e-5; K=60.48;b=10; T=K*b B=sqrt(T*bprime/Kprime) Bsq4=B*B*4; % looks like the upper limit for t should be 200 days SoverT=S/T; r=(B/10)*linspace(1, 40,40); r=[B/40 r]; roverB=r/B; framedata=zeros(400,41); t=linspace(.5,200,400); Sover4T=S/(4*T); for j=1:400% time loop for i=1:41 % space loop u=(r(1,i)*r(1,i)*Sover4T)/(t(1,j)); x=linspace(u,1e10*u,10001); arg=-x-((r(1,i)*r(1,i)*ones(1,10001))./(Bsq4*x)); f=exp(arg)./x; dx=x(1,2)-x(1,1); I=(1/(4*pi))*(sum(f)-((f(1,1)+f(1,10001))/2))*dx; framedata(j,i)=I; end end save framedata