其中sovle_phi1(i,j,x)是我自己编的个小程序,如下: <BR>function phi=sovle_phi1(i,j,x)<BR>phi=sovle_phi_wave1(i,j,x)+sovle_phi_ave(i,x);<BR><SUB><FONT color=#e3e3e3> </FONT></SUB><BR>function phi_wave=sovle_phi_wave1(i,j,x)<BR>X=[0,20,40,60];L=60;<BR>l(j)=X(j+1)-X(j);<BR>xi(j)=(x-X(j))/l(j);<BR>H(1,j)=1-3*xi(j)^2+2*xi(j)^3;<BR>H(2,j)=l(j)*xi(j)*(1-xi(j))^2;<BR>H(3,j)=3*xi(j)^2-2*xi(j)^3;<BR>H(4,j)=l(j)*xi(j)^2*(xi(j)-1);<BR>y=sovle_y(i);<BR>theta=sovle_theta(i);<BR>phi_wave=H(1,j)*y(j)+H(2,j)*theta(j)+H(3,j)*y(j+1)+H(4,j)*theta(j+1);<BR><BR>function phi_ave=sovle_phi_ave(i,x) <BR>L=60; <BR>phi_ave=sin(i*pi*x/L); <BR><SUB><FONT color=#e3e3e3> </FONT></SUB><BR>function y=sovle_y(i) <BR>X=[0,20,40,60]';L=60; <BR>y=-sin(i*pi*X/L); <BR><SUB><FONT color=#e3e3e3> </FONT></SUB><BR>function theta=sovle_theta(i) <BR>%求解未知theta <BR>a=[2,1,0,0;0.5,2,0.5,0;0,0.5,2,0.5;0,0,1,2]; <BR>b=[-3*sin(i*pi/3)/20;-3*sin(2*i*pi/3)/40;3*sin(i*pi/3)/40;3*sin(2*i*pi/3)/20]; <BR>theta=a\b; <BR><BR>上面是与sovle_phi1(i,j,x)有关的几个小函数,我不会把它们组合在一个大函数里,只能是分开的!<BR> |