Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: integration explicit solution could not be found
Date: Sat, 17 Jan 2009 17:45:04 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 20
Message-ID: <gkt5f0$6qf$1@fred.mathworks.com>
References: <gkra97$24k$1@fred.mathworks.com>
Reply-To: <HIDDEN>
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 1232214304 6991 172.30.248.38 (17 Jan 2009 17:45:04 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 17 Jan 2009 17:45:04 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:512233

"Dhritiman " <dhritiman-bhattacharya@uiowa.edu> wrote in message <gkra97$24k$1@fred.mathworks.com>...
> i had an earlier post about this with a typo. My problem is that matlab cannot solve the following equation where some function of z multiplied by the pdf of gamma dist is integrated over the range [.3 .9]. I need the answer as a function of w(wage). Infact I did get a scalar answer after i used double(int(f,z,.3,.9)) but this is only working when i substitute w for a number. Is there a way out of this...i.e. I need the soultion as a function of w (to be used later inside a fzero)
> 
> syms z w
> f=138.2528*84.626*z*((1-0.99*z)^1.32)*((1/w)^3.68)*((1/((2)*.06^3))*(z^(3-1))*(2.718^(-z/.06)))
> intfs=int(f,z,.3,.9)

  Dhritiman, I call to your attention again the fact that the factor involving w in your expression need not be included in the integrand here but can be factored outside.  What you have can be expressed as

 a/w^3.68 * int(z^3*(1-b*z)^c*exp(-z/d,z,e,f)

where a = 138.2528*84.626/(2*.06^3), b = 0.99, c = 1.32, d = .06, and where e and f are the lower and upper limits of integration.  The value of the integral part depends only on constants b, c, d and the limits of integration, not on a or w.  You can multiply these latter in after the integration is performed.

  As for the integral, the introduction of the power c = 1.32 apparently renders this integral incapable of an explicit solution, but this is a mathematical difficulty and not one that can be blamed on matlab.  Consequently it will be necessary for you to do numerical integration to evaluate it for each different set of constants b, c, d and limits of integration.

  About the only saving I can see in this will come from cases where the integration range is taken over various (e,f) intervals that overlap.  The overlap portions need be integrated only once (provided b, c, and d remain fixed.)

Roger Stafford