Path: news.mathworks.com!not-for-mail From: <HIDDEN> Newsgroups: comp.soft-sys.matlab Subject: Re: Integrating f(x,y) on a certain line in XY plane Date: Sun, 8 May 2011 23:29:04 +0000 (UTC) Organization: The MathWorks, Inc. Lines: 20 Message-ID: <iq7900$jj3$1@newscl01ah.mathworks.com> References: <iq5tkg$j6e$1@newscl01ah.mathworks.com> <iq5vo1$nch$1@newscl01ah.mathworks.com> <iq6390$17d$1@newscl01ah.mathworks.com> <iq6t1h$ocu$1@newscl01ah.mathworks.com> <iq704t$1av$1@newscl01ah.mathworks.com> <iq740k$9e4$1@newscl01ah.mathworks.com> Reply-To: <HIDDEN> NNTP-Posting-Host: www-05-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: newscl01ah.mathworks.com 1304897344 20067 172.30.248.37 (8 May 2011 23:29:04 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Sun, 8 May 2011 23:29:04 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 2733406 Xref: news.mathworks.com comp.soft-sys.matlab:725772 "Roger Stafford" wrote in message <iq740k$9e4$1@newscl01ah.mathworks.com>... > "Mohamed Nasr" wrote in message <iq704t$1av$1@newscl01ah.mathworks.com>... > > .......... > > f(x,y)=log(abs(sqrt((XM-X).^2+(YM-Y).^2))). > > > > and XMID1 and YMID1 are known functions while X,Y are the variables to be integrated on the line connecting 2 points (X1,Y1) and (X2,Y2)...this line has the infinitesmal element dl. > > Waiting your reply > - - - - - - - - - - > In the case of the function you have defined, Mohamed, there is an easily expressed analytic function which is the solution to your integral. You don't need matlab's numerical integration at all to solve this problem, (except perhaps the symbolic toolbox for obtaining this integral solution.) > > I will give an indefinite integral formula from my integral table textbook which could be used to derive the above solution in case you don't have the symbolic toolbox: > > int(log(x^2+a^2)) = x*log(x^2+a^2) - 2*x + 2*a*atan(x/a) + C > > In your case the variable x here would represent the distance, l, measured along the line segment. If you want help in this latter endeavor, please let us know. > > Roger Stafford How will you tell matlab the coordinates of the line l in order to integrate on it? Note that in this 2D problem I cannot just consider the length of the line of integration regardless of its position in space due to physics of problem. It is getting charge distribution on a contour which I already know its voltage so position of one part of body w.r.t. other part can totally change charge distribution...