9
1. u (t, x) (t , x ) . .1 .
.1.
(utt - a 2 uxx = 0, u (t,0) = u (t, L) = 0, u (0, x) = u 0(x), ut (0 ,x) = 0) :
.
. m-, :
global Cn numfun a L x0
hF=figure(¢NumberTitle¢,¢off¢,¢Name¢,
¢The oscillations of string¢,¢Color¢,[0 1 0]);
hA=axes(¢Parent¢,hF,¢Units¢,¢pixels¢,¢Position¢,[25 25 500 325]);
r=2; L=5; h=1; x0=1; a=1;
numfun=30; numx=20; dx=L/numx;
Cn=2*h*L^2/(pi^2*x0*(L-x0));
axis([0,L,h,h]); X=[];
for i=1:(numx+1)
xn=dx*(i-1); X=[X,xn];
end
for t=1:300
Y=zeros(1,numx+1);
for i=1:(numx+1)
x=X(i); Y(i)=u(t,x);
end
line(X,Y,¢Color¢,¢black¢,¢EraseMode¢,¢none¢,¢LineWidth¢,r);
pause(0.1);
line(X,Y,¢Color¢,¢white¢,¢EraseMode¢,¢none¢,¢LineWidth¢,r);
end
m-, u (t,x):
function Y=u(t,x)
global Cn numfun a L x0
s=0;
for n=1:numfun
m1=sin(pi*x0*n/L);
m2=sin(pi*x*n/L);
m3=cos(pi*a*t*n/L);
s=s+m1*m2*m3/(n*n);
end
Y=Cn*s;
2. MATLAB .
:
hF=figure(¢NumberTitle¢,¢off¢,¢Name¢,
¢The Arrow Clock¢, ¢Color¢,[0 1 0]);
hA=axes(¢Parent¢,hF,¢Units¢,¢pixels¢,¢Position¢,[25 25 125 125]);
axis([-1,1,-1,1]);
r=3; x0=0; y0=0;
LS=0.9; LM=0.7; LH=0.5;
asec=-pi/30;
fis=0; fim=0; fih=0;
for t=1:300
, :
xs=x0+LS*cos(fis);
ys=y0-LS*sin(fis);
XS=[x0,xs]; YS=[y0,ys];
xm=x0+LM*cos(fim);
ym=y0-LM*sin(fim);
XM=[x0,xm]; YM=[y0,ym];
xh=x0+LH*cos(fih);
yh=y0-LH*sin(fih);
XH=[x0,xh]; YH=[y0,yh];
line(XS,YS,¢Color¢,¢black¢,¢EraseMode¢,¢none¢,¢LineWidth¢,1);
line(XM,YM,¢Color¢,¢black¢,¢EraseMode¢,¢none¢,¢LineWidth¢,2);
line(XH,YH,¢Color¢,¢black¢,¢EraseMode¢,¢none¢,¢LineWidth¢,3);
pause(0.1);
line(XS,YS,¢Color¢,¢white¢,¢EraseMode¢,¢none¢,¢LineWidth¢,1);
line(XM,YM,¢Color¢,¢white¢,¢EraseMode¢,¢none¢,¢LineWidth¢,2);
line(XH,YH,¢Color¢,¢white¢,¢EraseMode¢,¢none¢,¢LineWidth¢,3);
fis=fis-asec;
fim=fim-asec/12;
|
|
fih=fih-asec/144;
end
3. ( ) , . A, B, C , D . .2 .
.2.
.
:
hF=figure(¢NumberTitle¢,¢off¢,¢Name¢,
¢Stereo Effect of Plain Images¢,¢Color¢,[0 1 0]);
hA=axes(¢Parent¢,hF,¢Units¢,¢pixels¢,¢Position¢,[25 25 325 325]);
axis([-1,1,-1,1]);
r=3; LS=0.1; asec=-pi/30; fis=0;
:
x=[-0.5,0,0.6,0]; y=[-0.5,0.8,-0.4,0];
xb=-0.3; yb=-0.3;
for t=1:300
xs=LS*cos(fis); ys=LS*sin(fis);
xh=1.5*LS*cos(fis); yh=-1.5*LS*sin(fis);
XS=[x(1)+xs,x(2)++xs,x(3)+xs,x(1)+xs,
x(4)+xh,x(2)+xs,x(3)+xs,x(4)+xh];
YS=[y(1)+ys,y(2)++ys,y(3)+ys,y(1)+ys,
y(4)+yh,y(2)+ys,y(3)+ys,y(4)+yh];
line(XS,YS,¢Color¢,¢black¢,¢EraseMode¢,¢none¢,¢LineWidth¢,r);
pause(0.1);
line(XS,YS,¢Color¢,¢white¢,¢EraseMode¢,¢none¢,¢LineWidth¢,r);
fis=fis+asec;
end;