亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? quadg.m

?? Numerical quadrature using open methods.
?? M
?? 第 1 頁 / 共 2 頁
字號:
function [Result, Output] = quadg (fun,a,b,opts,varargin)
%QUADG  Numerical quadrature using open methods.
%   Q = QUADG(fun,a,b) approximates the integral of fun
%   from a to b using some type of Gaussian quadrature.
%
%   The default type is a Gauss-Kronrod, 7(15) order.
%
%   Q = QUADG(fun,a,b,options) allows integrations option to
%   be specified.  
%
%   Q = QUADG(fun,a,b,options,p1,p2,...) will pass the extra 
%   parameters p1, p2, ... to fun.
%
%   Options is a structure specifying any of the following options:
%
%       Field name              Parameter           Possibilites and {Default}
%
%       options.tol             Tolerance           [{1e-6}, any fractional number]
%       options.diplay          Display on/off      [{'off'}, 'on']
%       options.nodes           nodes               [vector, {Gauss-Kronrod nodes}]
%       options.weights         weights             [matrix, {Gauss-Kronrod weights}]
%
%   Using options=[] will use the default options.
%
%   Tolerance is based on the relative error.  With double-precision  
%   arithmetic, feasible values for this parameter range 
%   from 1e-15 to 1.  The default is 1e-6.  
%
%   Setting the display on shows the integrand samples and a histogram
%   of their distribution, as well as a table reporting the progress of 
%   the integration as it proceeds.  Note that the display will slow down 
%   the performance of the quadrature.
%
%   The nodes and weights parameters are discussed in the 
%   "Advanced Features" section in the source code just after
%   the help entry.  Type 'edit quadg' to see this note.  There's 
%   no need to use this option unless you like playing with other 
%   people's source code and know what you're doing (and can 
%   figure out what I was doing).
%
%   Example:
%
%      f = inline('cos(x).*sin(x.*x)');
%      options.display = 'on';
%      quadg(f,-2*pi,2*pi,options)
%    
%      Increasing the range of this quadrature will cause most recursive 
%      to slow dramatically and run out of stack space.
%
%   See the source code for additional comments.  
%
%   See also QUADL, QUAD, DBLQUAD, INLINE, @.

%   ========================================================
%   ADVANCED FEATURES -- DEFINING YOUR OWN WEIGHTS AND NODES
%   --------------------------------------------------------
%   You can also provide your own nodes and weights to this
%   function, allowing you to use this code as a harness for
%   any integration method you like.  Your weights and nodes 
%   should be defined for an integration over [-1,+1]
%
%   This is an advanced feature.  Unless you're really interested
%   in using your own quadrature, there's no need to worry about this.
%
%   The QUADG function has two alternate algorithms which you can 
%   access in this way.  For example:
%
%       [options.nodes options.weights] = quadg('gausskronrod')
%
%   returns values for a Gauss-Kronrod 7(15) order quadrature,
%
%       [options.nodes options.weights] = quadg('gausslegendre',p)
%
%   returns values for a p-th order Gauss-Legendre quadrature.  Then:
%
%       quadg(f,a,b,options)
%
%   will integrate f using the algorithm specified.
%
%   options.nodes and options.weights should be defined as a one
%   column vector and a two row matrix, respectively, so that:
%
%       2*options.weights*feval(fun,a)
%
%   returns a 2 by 1 vector of the lower and higher order estimates 
%   for an integration over [-1,+1].  For example:
%
%       >> [opts.nodes opts.weights] = quadg('gausslegendre',2);
%
%       >> opts.nodes
%        ans =
%           -0.5774
%            0.5774
%           -0.7746
%                 0
%            0.7746
%
%       >> opts.weights
%        ans =
%            0.5000    0.5000         0         0         0
%                 0         0    0.2778    0.4444    0.2778
% 
%       >> 2*opts.weights*cos(opts.nodes)
%        ans =
%           1.6758
%           1.6830
%     
%   These are the 2-nd and 3-rd order estimates for the integral of cosine
%   taken over the range [-1,+1]

%   =============================================
%   MISCELLANEOUS COMMENTS
%   ---------------------------------------------
%   IMO, the iterative imlementation here is interesting to see; it's what 
%   makes this code fast.  
%
%   One way to test the accuracy of this code is to use the Symbolic Toolbox
%   to compute analytical results for some representative test integrands, 
%   and compare those to the results this code produces.
%
%   Pros of this code:
%       - fast and accurate (esp the default Gauss-Kronrod algorithm)
%       - nice graphical display
%       - can use your own nodes and weights 
%       - interesting iterative implementation (contrasts with the
%         typical recursive implementations often used)
%
%   Cons:
%       - though they works well in practice, the stopping criteria 
%         are simple (see QUADL for better ideas)
%
%   I have not compared this to the quadrature functions in MATLAB, but the more tools
%   you have in your quadrature collection the better off you'll be.  
%
%   If someone wants to clean up this code, please feel free to do so and
%   let me know; I'll gladly accept any useful modifications and incorporate them
%   into this file.  It's sloppy in some places, and there are other places where I'm
%   using KRON and SPDIAGS when I shouldn't.
%
%   Another more sophisticated enhancement would be to add code calculating 
%   the Kronrod extension nodes for any order quadrature.  I'm not sure if 
%   these extended nodes can be derived in a straightforward way, however. 
%
%   This function hasn't been extensively tested, and I haven't put in any "tweaks"
%   to account for bad inputs or any type of error checking.  
%
%   Please note that this file is *not* officially supported by The MathWorks. 
%
%   Nabeel Azar
%   nabeel@mathworks.com
%   nabeel@ieee.org
%
%   $Revision: 0.1 $  $Date: 1998 $

%______________________________________________________________
%  Input checking:

%   Are they calling it to just obtain nodes and weights?
%   If so, calculate them and then return
if isa(fun,'char')
    switch(lower(fun))
    case 'gausslegendre'
        if nargin>1; order = a; else; order = 7; end
        [Result Output] = gausslegendre(order);
        return
    case 'gausskronrod'
        [Result Output] = gausskronrod(7);
        return
    otherwise
        %   Do nothing and keep going
        msg = sprintf(['Assuming your first input is the name of\n',...
                'the function you want to integrate.  If you are\n',...
                'using MATLAB 6.0 or later, you should use\n',...
                'function handles to specify the function.']);
        warning(msg)
    end
end

%   If we're here, we're performing a quadrature.
%   We need at least 3 inputs
msg = nargchk(3,Inf,nargin);
if msg
    error(msg)
end

switch nargin
case 3; 
    %  Only 3 inputs, no options, no params
    Options = optionscheck([]); 
otherwise
    %   Options given, 
    Options = optionscheck(opts);
end
ExtraParameters = varargin;

%  End input checking
%--------------------------------------------------------------

%   Dynamically set MaxIter so no interval can 
%   be narrower than EPS.  The algorithm
%   typically stops well below MaxIter,
%   and throws a warning if it hits it.  
MaxIter = floor(log2(abs(b-a)/eps));
MaxIter = min(MaxIter,1024);

%   Set loop parameters and orient a and b as columns
Iter = 0;
Result = 0;
Tol = abs(Options.tol);
OutputOn = (nargout>=2);
a = a(:); b = b(:);

%  If verbosity is on, setup the figure window
if strcmp(Options.display,'on')
   %  Using verbose display also stored the information
   %  found in the second output argument.
   OutputOn = 1;
   %  Predefine storage for the data sets
   AllNodes = [];  AllIntegrand = [];  
   verbosity = 1;
   [Fig Axis Listbox HistogramAxis Spaces] = initializefigure(Options,fun,a,b);
   %  Start runtime counter
   t0 = cputime;
elseif OutputOn==1
   %  Predefine storage for the data sets
   AllNodes = [];  AllIntegrand = [];  
   verbosity = 0;
   t0 = cputime;
else
   verbosity = 0;
end


%______________________________________________________________
%  3)  Get the integration nodes and weights
%      for the first level and the second level
%      of checks.
X = Options.nodes;
W = Options.weights;
%--------------------------------------------------------------

%______________________________________________________________
%  4)  Begin the WHILE loop over which the integrand
%      is estimated.
%
%      This is where the real work takes place.  The code in this
%      loop isn't too difficult to follow.  Everything
%      up to the "if OutputOn" part is the actual quadrature;
%      the rest of the loop is just for options.
while ~isempty(a) & Iter<=MaxIter
   %  Increment iteration
   Iter = Iter + 1;

   %  Obtain nodes for the integration
   Nodes = scalex(X,a,b);
               
   %  Evaluate the integrand
   Integrand = feval(fun,Nodes,ExtraParameters{:});

   %  Scale integrand and compute the estimates.
   Estimates = W*Integrand*spdiags((b-a).',0,length(a),length(a));

   %  Find where the estimates are close and 
   %  remove the regions that had good estimates.
   %  This tolerance checking is simple, but works ok in practice.
   GoodRegions = abs((Estimates(1,:) - Estimates(2,:))./Estimates(2,:)) <=Tol;
   a(GoodRegions) = []; b(GoodRegions) = [];

   %  Update the integral to include the good regions.
   Result = Result + Estimates(2,:)*GoodRegions(:);

   %  Halve the remaining intervals
   %  Keep the a and b as row vectors.
   Middle_Terms = (a+b)/2;
   a = [a Middle_Terms].'; a = a(:).';
   b = [Middle_Terms b].'; b = b(:).';

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产99精品国产| 一区二区三区欧美视频| 久久99精品久久久| 日韩你懂的在线观看| 精品在线免费观看| 国产亚洲精品aa| 成人黄页毛片网站| 亚洲精品国产无天堂网2021| 欧美午夜视频网站| 午夜精品久久一牛影视| 精品国免费一区二区三区| 国产精品自拍一区| 国产精品美女久久福利网站| 一本色道久久综合亚洲91| 一区二区久久久久久| 欧美一区二区三区四区在线观看| 精东粉嫩av免费一区二区三区| 中文字幕欧美激情一区| 在线亚洲人成电影网站色www| 丝袜美腿亚洲一区二区图片| 精品国产伦一区二区三区观看体验 | 91免费视频观看| 午夜精品影院在线观看| 久久亚洲精品小早川怜子| 97久久超碰国产精品| 日本在线不卡视频| 国产日韩欧美高清| 在线不卡免费欧美| 东方欧美亚洲色图在线| 亚洲第一综合色| 国产精品天干天干在线综合| 欧美日韩一区 二区 三区 久久精品| 国内国产精品久久| 亚洲6080在线| 国产精品女同一区二区三区| 6080午夜不卡| 99re这里只有精品首页| 国模冰冰炮一区二区| 一区二区三区四区视频精品免费 | 亚洲三级电影网站| 日韩片之四级片| 一本久久a久久精品亚洲| 激情六月婷婷综合| 亚洲国产sm捆绑调教视频 | 色婷婷av久久久久久久| 国产在线视频精品一区| 天天综合色天天综合色h| 国产精品私人自拍| 日韩欧美国产麻豆| 在线视频国内一区二区| 成人国产精品视频| 久久不见久久见免费视频1| 有坂深雪av一区二区精品| 久久精品在这里| 欧美一级日韩免费不卡| 91高清在线观看| av亚洲精华国产精华| 国产做a爰片久久毛片| 日韩高清欧美激情| 一区二区三区在线免费| 国产精品久久久久久亚洲伦| 国产欧美精品一区二区三区四区| 日韩欧美国产高清| 日韩一二三四区| 91精品国产色综合久久不卡蜜臀| 91久久精品一区二区| eeuss鲁一区二区三区| 国产91丝袜在线观看| 国产精品香蕉一区二区三区| 精一区二区三区| 极品美女销魂一区二区三区免费 | 亚洲在线中文字幕| 亚洲欧美偷拍三级| 成人欧美一区二区三区黑人麻豆 | 亚洲综合一区在线| 亚洲免费大片在线观看| 亚洲精品中文字幕在线观看| 自拍偷拍亚洲激情| 亚洲精品乱码久久久久久| 国产精品18久久久久久vr| 日本va欧美va精品| 蜜桃精品在线观看| 麻豆精品国产传媒mv男同| 麻豆精品一区二区综合av| 美女一区二区在线观看| 国内精品伊人久久久久av影院 | 成人毛片老司机大片| 成人美女视频在线看| 99久久伊人精品| 91久久一区二区| 欧美三日本三级三级在线播放| 欧美色中文字幕| 欧美日韩1234| 欧美大白屁股肥臀xxxxxx| 2020日本不卡一区二区视频| 中文字幕精品—区二区四季| 亚洲另类中文字| 日韩经典中文字幕一区| 久久99国内精品| 国产成人精品免费看| 色婷婷狠狠综合| 91精品国产综合久久精品性色 | 久久亚洲精精品中文字幕早川悠里 | 日本aⅴ精品一区二区三区| 美女视频一区二区三区| 国产精品亚洲第一区在线暖暖韩国| 不卡视频在线观看| 欧美日韩国产另类不卡| 久久免费看少妇高潮| 中文字幕一区二区三| 亚洲bt欧美bt精品| 国产精品自拍一区| 欧美系列在线观看| 2023国产精品自拍| 亚洲在线观看免费| 国产电影一区二区三区| 日本韩国精品在线| 欧美精品一区二区不卡| 亚洲丝袜另类动漫二区| 免播放器亚洲一区| 99精品视频在线播放观看| 91精品免费在线观看| 欧美国产精品久久| 天天综合网 天天综合色| 成人黄色av网站在线| 777色狠狠一区二区三区| 欧美国产日韩a欧美在线观看| 亚洲成人自拍一区| 成人va在线观看| 日韩精品资源二区在线| 亚洲六月丁香色婷婷综合久久 | 日日欢夜夜爽一区| 成人av午夜电影| 精品福利在线导航| 午夜精彩视频在线观看不卡| 成人动漫一区二区| 精品裸体舞一区二区三区| 一区二区三区四区在线播放| 成人丝袜高跟foot| 日韩午夜中文字幕| 性欧美疯狂xxxxbbbb| 99久久久免费精品国产一区二区| 精品成人佐山爱一区二区| 亚洲第一搞黄网站| 色综合色综合色综合色综合色综合| 久久一日本道色综合| 日韩高清电影一区| 欧美亚洲一区二区三区四区| 国产精品久久久久久久蜜臀| 激情综合色综合久久综合| 91.xcao| 亚洲成人动漫在线免费观看| 色哟哟精品一区| 国产精品久久久久久亚洲毛片| 国产美女一区二区| 精品国产乱码久久久久久老虎| 日韩精品久久久久久| 欧美三电影在线| 亚洲国产综合人成综合网站| 色噜噜久久综合| 亚洲欧美日本在线| 色狠狠av一区二区三区| 亚洲欧美激情在线| 91年精品国产| 亚洲欧美另类在线| 日本道免费精品一区二区三区| 亚洲免费av观看| 在线免费不卡电影| 亚洲精品国产一区二区三区四区在线| 91免费视频网址| 亚洲一区二区高清| 欧美午夜精品一区| 婷婷综合另类小说色区| 7777精品伊人久久久大香线蕉经典版下载 | 日韩一区二区视频| 久久精品国产亚洲a| 欧美一级高清片在线观看| 免费在线观看一区| 精品乱码亚洲一区二区不卡| 毛片一区二区三区| 26uuu久久天堂性欧美| 国产一区二区三区免费观看| 国产色婷婷亚洲99精品小说| 国产99一区视频免费| 国产精品麻豆久久久| 色88888久久久久久影院按摩 | 91女人视频在线观看| 亚洲一区二区三区影院| 欧美久久高跟鞋激| 黄页网站大全一区二区| 国产精品美女久久久久久| 在线视频你懂得一区| 免费高清在线视频一区·| 久久久美女毛片| 91久久精品一区二区| 蜜臀久久99精品久久久久宅男| 久久久亚洲综合| 色综合久久99| 精品一区二区三区欧美| 国产精品久久久久久妇女6080|