Professional Documents
Culture Documents
2
1 + ()2
We set out integration limit so the value of this function becomes very small (10-9).
2
= 109 = 44,721
1 + ()2
Because we have a significant high upper integration bound, our step also needs to be refined, thus:
= 0.000001
2
( )
For this velocity profile, we need to set the upper bound of integration following the same procedure
used in the lecture notes (page 61), thus:
() =
=
2
)
2
= 109
9.1
MATLAB code:
y=[0:0.05:10];
%Integration limit
Omega=sqrt((2*T-(1e-9))/(1e-9)*T^2);
%Omega increment
domega=0.000001*Omega; % since we increased integration limits by a factor of
10,
%Resulting omega vector
omega=[0:domega:Omega];
%Plotting velocity profile
%================ Start Time and Y loops ==============
for i=1:length(t)
for j=1:length(y)
%Fourier transform: integration versus omega
u(i,j)=0;
for k=1:length(omega)
beta=sqrt(0.5*omega(k)/nu);
uo = 2*T/(1+(omega(k).*T).^2);
exp1=exp(-beta*y(j));
oscillation=cos(omega(k)*t(i)-beta*y(j));
u(i,j)=u(i,j)+domega*uo*exp1*oscillation;
end
end
end
%================ End time and Y loops ==============
%Scale the answer
u=u*T/(pi);
%Legend text
for i=1:length(t)
legtext{i}=['t / T = ', num2str(t(i)/T)];
end
%Plot colors
c(1,:)=[0.0 ,0.0 ,0.0];
c(2,:)=[0.0 ,0.0 ,1.0];
c(3,:)=[0.0 ,0.7 ,0.0];
c(4,:)=[1.0 ,0.0 ,1.0];
c(5,:)=[1.0 ,0.0 ,0.0];
c(6,:)=[1.0 ,0.5, 0.0];
c(7,:)=[0.5, 1.0, 1.0];
c(8,:)=[1.0 ,0.5, 0.5];
c(9,:)=[0.5 ,1.0, 0.5];
%Line plots for different times
close
figure('Position',[150,150,400,500],'Color','w')
subplot('Position', [0.14,0.11,0.81,0.85])
for i=1:length(t)
shear stress
for i=1:length(t)
uo(i) = exp(-abs(t(i))/T);
end
%Line plots for different times
close
figure
plot(t,uo)
xlabel('{\it t}','FontName', 'Times','FontAngle', 'normal','fontsize',18);
ylabel('{\it u_o and \tau_w}','FontName', 'Times','FontAngle',
'normal','fontsize',18);
hold on
plot(t,tau)
axis 'auto'
set(gca,'fontsize',14)
xlabel('{\it t}','FontName', 'Times','FontAngle', 'normal','fontsize',18);
ylabel('{\it \tau_w}','FontName', 'Times','FontAngle',
'normal','fontsize',18);
legend('u_o','\tau_w')
%legend(legtext, 1)
text(0.1, 9.5, ['{\it T} = ', num2str(T)], 'FontName', 'Times',
'fontsize',20)
%% PROBLEM 3
clc
clear all
close all
%Solves for the velocity distribution of a semi-infinite Newtonian fluid
%over an infinite plate with velocity u0(t)=exp[-(abs(t)*T]
%Kinematic viscosity
T=1;
nu=1;
h=3;
%Time and Y vectors
t=T*[0:1:10];
y=[0:0.05:10];
%Integration limit
Omega=9.1/T;
%Omega increment
domega=0.01*Omega;
%Resulting omega vector
omega=[0:domega:Omega];
%Plotting velocity profile
%================ Start Time and Y loops ==============
for n=1:length(t)
for j=1:length(y)