Path: news.mathworks.com!not-for-mail
From: "Soumendra Datta" <soumendra_13@yahoo.co.in>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Numerical Integration
Date: Thu, 13 Aug 2009 06:51:01 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 58
Message-ID: <h60d4l$g1g$1@fred.mathworks.com>
References: <h1emhh$mok$1@fred.mathworks.com> <h1eq3t$6rb$1@fred.mathworks.com> <32ef8539-b42c-447d-8436-f796643fd085@o20g2000vbh.googlegroups.com> <h1fv14$79u$1@fred.mathworks.com> <h1g5p7$nhp$1@fred.mathworks.com> <h1g6j2$hch$1@fred.mathworks.com>
Reply-To: "Soumendra Datta" <soumendra_13@yahoo.co.in>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1250146261 16432 172.30.248.38 (13 Aug 2009 06:51:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 13 Aug 2009 06:51:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1933159
Xref: news.mathworks.com comp.soft-sys.matlab:562908


"Saed " <dawoudsaed@yahoo.com> wrote in message <h1g6j2$hch$1@fred.mathworks.com>...
> "Steven Lord" <slord@mathworks.com> wrote in message <h1g5p7$nhp$1@fred.mathworks.com>...
> > 
> > "Saed " <dawoudsaed@yahoo.com> wrote in message 
> > news:h1fv14$79u$1@fred.mathworks.com...
> > > vedenev <vedenev.maxim@gmail.com> wrote in message 
> > > <32ef8539-b42c-447d-8436-f796643fd085@o20g2000vbh.googlegroups.com>...
> > >> See, example:
> > >>
> > >> syms a b z t
> > >> Fun=((1./gamma(a)).*exp(-z.*t).*(t.^(a-1)).*((1+t).^(b-a-1)))
> > >> Psi=int(Fun,t,0,5000)
> > >>
> > >> -----------------------------------------
> > >> Maxim Vedenev, MATLAB Custom Programming
> > >> vedenev@ngs.ru
> > >> http://simulations.narod.ru/
> > >
> > > But as I know, using anonymous functions followed by quad command, is the 
> > > quickest way to do integrations. I have a very long expression in term of 
> > > s, and I tried the way you suggested, but the program takes a considerable 
> > > amount of time to be executed. So, I need a suggestion in how to use the 
> > > quad command, or an equivalent fast integration, please.
> > 
> > You have three choices:
> > 
> > 1) Perform the integration symbolically using INT on an expression 
> > containing a symbolic variable.  This will be slower than the second choice.
> > 
> > 2) Perform the integration numerically using QUAD (or even better QUADGK) on 
> > an expression that does NOT contain symbolic variables.  If you use this 
> > approach, you'll want to integrate only over the region where your function 
> > is "significantly different from zero" (for some definition of 
> > "significantly") to make sure that the integration routine can see the 
> > details of your function.  After all, if you look out an airplane window at 
> > 30,000 feet you're not going to be able to distinguish an individual person 
> > on the ground -- specifying a very large integration interval where the 
> > function is mostly zero is similar to that.
> > 
> > 3) Look up your integral in a table of integrals, and replace the 
> > integration with an evaluation of the closed-form solution of that integral. 
> > This won't work for all integrals, but it's probably going to be the fastest 
> > of all the methods.
> > 
> > For this particular integral, if you choose choice 3, you'll probably want 
> > to look for stuff related to the Beta distribution, as the expression you 
> > wrote looks somewhat similar to the Beta CDF (modulo the exponential term.)
> > 
> > -- 
> > Steve Lord
> > slord@mathworks.com 
> > 
> 
> Actually it is the Tricomi's Confluent Hypergeometric function, but I don't think it is a build-in function in MATLAB, so I have to define it by myself.


Can you please specify how to define Tricomi's Confluent Hypergeometric function as it is not available in MATLAB?
Soumendra