matlab gen,MATLAB中没有quad2dggen

function vol = gquad2dgen(funxy,limxlow,limxhigh,ylow,yhigh,b1,w1,b2,w2)

%usage: vol = gquad2dgen(funxy,limxlow,limxhigh,ylow,yhigh,bpxv,wfxv,bpyv,wfyv);

%  or

%usage: vol = gquad2dgen(funxy,limxlow,limxhigh,ylow,yhigh,nquadx,nquady);

%

% This function evaluates a general double integral.  The limits of the

% inner integration may be functions of the outer integral's variable of

% integration.  Such as

%              yhigh    ghigh(y)

%      Vol = Int     Int       f(x,y)  dx  dy

%              ylow    glow(y)

% where

%      funxy = f(x,y)

%      limxlow = glow(y)

%      limxhigh = ghigh(y)

% and the base points and weighting functions are found from

%     [bpxv,wfxv,bpyv,wfyv]=grule2dgen(nquadx,nquady);

% where nquadx and nquady are the number of gauss points in the x- and

% y-directions, respectively.

%

% The first form of gquad2dgen is faster when used several times, because

% the points and weights are only calculated once.

%

% The second form of gquad2dgen is usefull if it is only called once (or a

% few times).

%      by Bryce Gardner, Purdue University, Spring 1993

%      extending Howard Wilson's (U. of Alabama, Spring 1990)

%      set of 1-D Gauss quadrature routines to 2-dimensions.

if nargin == 7,

nquadx=b1;

nquady=w1;

[bpxv,wfxv,bpyv,wfyv]=grule2dgen(nquadx,nquady);

elseif nargin == 9,

bpxv = b1;

wfxv = w1;

bpyv = b2;

wfyv = w2;

else

disp('Wrong Number of Input Arguments')

return

end

nquady=length(bpyv);

qy=(yhigh-ylow)/2;

py=(yhigh+ylow)/2;

vol = 0;

for i=1:nquady,

y=qy*bpyv(i)+py;

xhigh=feval(limxhigh,y);

xlow=feval(limxlow,y);

vol = vol + wfyv(i) * gquad(funxy,xlow,xhigh,1,bpxv,wfxv,y);

end

vol = vol * qy;

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值