全面两孩抢生免罚:MATLAB如何计算格林函数

来源:百度文库 编辑:神马品牌网 时间:2024/05/06 03:07:57
举个例子或者给相关参考资料,满意的话再加20分

我手头刚好有个例子,是关于光学传播的,G是个格林函数你参考下吧
%this program is for calculating the Green function under spherical tissue
%model.

clear;clc;

ua=0.02;us=15;g=0.94; %三个参数
a=10; %半径
r1=5; %光源
r2=a^2/r1; %像光源
D=1/(3*(ua+us*(1-g))); %漫射系数
k=sqrt(-ua*D); %k^2=-Q
r = linspace(0,10,50); %x=r
th = linspace(0,2*pi,120);
[th,r] = meshgrid(th,r);

c = -a/r1*exp(i*k*(1-a/r1)*sqrt(a^2+r1^2-2*a*r1.*cos(th)));
G0 = (1/(4*pi) * exp(i*k*sqrt(abs(r.^2 + r1^2-2*r*r1.*cos(th)))))./sqrt(abs((r.^2+r1^2)-(2*r.*r1).*cos(th)));
G1 = ((1/(4*pi) * exp(i*k*sqrt(abs(r.^2 + r2^2-2*r.*r2.*cos(th))))).*c)./sqrt(abs(r.^2+r2^2-(2*r.*r2).*cos(th)));

G = (G0 + G1)/D; %光通量

%极坐标下画截面图
[X,Y] = pol2cart(th,r);
surfc(X,Y,G);

axis([-10,10,-10,10]);
axis equal;
colormap(gray);
shading interp;
%view([0,90]);