<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.nl/matlabcentral/newsreader/view_thread/320595</link>
    <title>MATLAB Central Newsreader - Quad2d accuracy</title>
    <description>Feed for thread: Quad2d accuracy</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2013 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.nl/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Thu, 31 May 2012 07:27:31 +0000</pubDate>
      <title>Quad2d accuracy</title>
      <link>http://www.mathworks.nl/matlabcentral/newsreader/view_thread/320595#878544</link>
      <author>doron bartov</author>
      <description>Hi,&lt;br&gt;
i am using quad2d to calculate a surface integral, so far it apears that my results are around 60%-100% accurate, should i expect something more precise? with another function maybe?</description>
    </item>
    <item>
      <pubDate>Thu, 31 May 2012 07:42:29 +0000</pubDate>
      <title>Re: Quad2d accuracy</title>
      <link>http://www.mathworks.nl/matlabcentral/newsreader/view_thread/320595#878548</link>
      <author>Torsten</author>
      <description>On 31 Mai, 09:27, "doron bartov" &amp;lt;doronbar...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; i am using quad2d to calculate a surface integral, so far it apears that my results are around 60%-100% accurate, should i expect something more precise? with another function maybe?&lt;br&gt;
&lt;br&gt;
By strengthening the tolerances AbsTol and RelTol of quad2d ?&lt;br&gt;
&lt;br&gt;
Best wishes&lt;br&gt;
Torsten.</description>
    </item>
    <item>
      <pubDate>Thu, 31 May 2012 07:53:25 +0000</pubDate>
      <title>Re: Quad2d accuracy</title>
      <link>http://www.mathworks.nl/matlabcentral/newsreader/view_thread/320595#878549</link>
      <author>Roger Stafford</author>
      <description>"doron bartov" &amp;lt;doronbartov@gmail.com&amp;gt; wrote in message &amp;lt;jq76h3$21a$1@newscl01ah.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt; i am using quad2d to calculate a surface integral, so far it apears that my results are around 60%-100% accurate, should i expect something more precise? with another function maybe?&lt;br&gt;
- - - - - - - - - -&lt;br&gt;
&amp;nbsp;&amp;nbsp;That doesn't sound very accurate.  What are your integrand function and limits of integration.  What do you have your error tolerances set at?  How do you know the accuracy?  Is it something you already know the answer to?&lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
    <item>
      <pubDate>Thu, 31 May 2012 08:16:33 +0000</pubDate>
      <title>Re: Quad2d accuracy</title>
      <link>http://www.mathworks.nl/matlabcentral/newsreader/view_thread/320595#878555</link>
      <author>doron bartov</author>
      <description>i am calculating an electro magnetic physical quantity- the cross factor of the electric field and magnetic field emerging from an electric dipole.&lt;br&gt;
my limits are : thetha=[0-pi], phi=[0-2pi].&lt;br&gt;
when  i set tollerance values it did not help the accuracy.&lt;br&gt;
i know (not sure) the answer from the answer of the other side of the equation (dot(E,J))&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
"Roger Stafford" wrote in message &amp;lt;jq781l$7m2$1@newscl01ah.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "doron bartov" &amp;lt;doronbartov@gmail.com&amp;gt; wrote in message &amp;lt;jq76h3$21a$1@newscl01ah.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; Hi,&lt;br&gt;
&amp;gt; &amp;gt; i am using quad2d to calculate a surface integral, so far it apears that my results are around 60%-100% accurate, should i expect something more precise? with another function maybe?&lt;br&gt;
&amp;gt; - - - - - - - - - -&lt;br&gt;
&amp;gt;   That doesn't sound very accurate.  What are your integrand function and limits of integration.  What do you have your error tolerances set at?  How do you know the accuracy?  Is it something you already know the answer to?&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Roger Stafford</description>
    </item>
    <item>
      <pubDate>Thu, 31 May 2012 13:36:27 +0000</pubDate>
      <title>Re: Quad2d accuracy</title>
      <link>http://www.mathworks.nl/matlabcentral/newsreader/view_thread/320595#878593</link>
      <author>Steven_Lord</author>
      <description>&lt;br&gt;
&lt;br&gt;
"doron bartov" &amp;lt;doronbartov@gmail.com&amp;gt; wrote in message &lt;br&gt;
news:jq79d1$cuh$1@newscl01ah.mathworks.com...&lt;br&gt;
&amp;gt; i am calculating an electro magnetic physical quantity- the cross factor &lt;br&gt;
&amp;gt; of the electric field and magnetic field emerging from an electric dipole.&lt;br&gt;
&amp;gt; my limits are : thetha=[0-pi], phi=[0-2pi].&lt;br&gt;
&amp;gt; when  i set tollerance values it did not help the accuracy.&lt;br&gt;
&amp;gt; i know (not sure) the answer from the answer of the other side of the &lt;br&gt;
&amp;gt; equation (dot(E,J))&lt;br&gt;
&lt;br&gt;
Can you show the integral you're trying to compute and the code that you &lt;br&gt;
wrote to compute it? Perhaps one of the readers of the group can detect if &lt;br&gt;
there's a typo or other type of error in the code.&lt;br&gt;
&lt;br&gt;
-- &lt;br&gt;
Steve Lord&lt;br&gt;
slord@mathworks.com&lt;br&gt;
To contact Technical Support use the Contact Us link on &lt;br&gt;
&lt;a href="http://www.mathworks.com"&gt;http://www.mathworks.com&lt;/a&gt; </description>
    </item>
    <item>
      <pubDate>Thu, 31 May 2012 15:34:19 +0000</pubDate>
      <title>Re: Quad2d accuracy</title>
      <link>http://www.mathworks.nl/matlabcentral/newsreader/view_thread/320595#878611</link>
      <author>doron bartov</author>
      <description>the integrand is  ( E cross H* ) dot da d(theha) d(phi)&lt;br&gt;
&lt;br&gt;
the boundaries are thetha=[0 pi], phi=[0 2pi]&lt;br&gt;
&lt;br&gt;
the function that calculates it is below&lt;br&gt;
&lt;br&gt;
function [loss_EM_energy, Electric_Ftotal]= poynting_on_surface(waveVec, Pvector, dipole_array_pos, error)&lt;br&gt;
&lt;br&gt;
r_size=5*10^-8;&lt;br&gt;
dipole_array_pos=dipole_array_pos(:,1:3);&lt;br&gt;
waveVec_size=norm(waveVec);&lt;br&gt;
omega=c*waveVec_size;&lt;br&gt;
loss_EM_energy = quad2d(@fun,0,pi,0,2*pi,'AbsTol', error);&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
function integrand=fun(thetha,phi)&lt;br&gt;
integrand=zeros(size(thetha));&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
for ThethaInd=1:size(thetha,2)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for phiInd=1:size(phi,1)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;[x,y,z] = sph2cart(thetha(phiInd,ThethaInd),phi(phiInd,ThethaInd),r_size);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Einc=incident_field(waveVec, [x y z]);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Electric_Ftotal=Einc;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;HField_total=cross(waveVec,Einc)/(omega*4*pi*10^-7);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;for dipole_part_num=1:size(dipole_array_pos,1)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;dipole_array_vector=Pvector(3*dipole_part_num-2:3*dipole_part_num).';&lt;br&gt;
vec_dip_point=[x,y,z] -dipole_array_pos(dipole_part_num,:);&lt;br&gt;
vec_dip_point_norm=vec_dip_point/norm(vec_dip_point);&lt;br&gt;
dist_dip_point=norm(vec_dip_point);&lt;br&gt;
GreenTerm=exp(-1i*waveVec_size*dist_dip_point)/dist_dip_point;&lt;br&gt;
ElecField=(waveVec_size^2*(cross(cross(vec_dip_point_norm,dipole_array_vector),vec_dip_point_norm))+(3*vec_dip_point_norm*dot(vec_dip_point_norm,dipole_array_vector)-dipole_array_vector)*(1/dist_dip_point^2+1i*waveVec_size/dist_dip_point))*GreenTerm;&lt;br&gt;
ElecField_div_epsilon=ElecField/(4*pi*epsilon_b);&lt;br&gt;
Electric_Ftotal=Electric_Ftotal+ElecField_div_epsilon;&lt;br&gt;
HField=(c*waveVec_size^2/(4*pi))*cross(vec_dip_point_norm,dipole_array_vector)*GreenTerm*(1+1/(1i*waveVec_size*dist_dip_point));&lt;br&gt;
HField_total=HField_total+HField;&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br&gt;
poynting_vector=cross(Electric_Ftotal,conj(HField_total));&lt;br&gt;
da=r_size^2*sin(thetha(phiInd,ThethaInd))*[x y z]/r_size;&lt;br&gt;
integrand(phiInd,ThethaInd)=integrand(phiInd,ThethaInd)+dot(poynting_vector,da);&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;end&lt;br&gt;
end&lt;br&gt;
end&lt;br&gt;
end&lt;br&gt;
&lt;br&gt;
"Steven_Lord" &amp;lt;slord@mathworks.com&amp;gt; wrote in message &amp;lt;jq7s4s$sjn$1@newscl01ah.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; "doron bartov" &amp;lt;doronbartov@gmail.com&amp;gt; wrote in message &lt;br&gt;
&amp;gt; news:jq79d1$cuh$1@newscl01ah.mathworks.com...&lt;br&gt;
&amp;gt; &amp;gt; i am calculating an electro magnetic physical quantity- the cross factor &lt;br&gt;
&amp;gt; &amp;gt; of the electric field and magnetic field emerging from an electric dipole.&lt;br&gt;
&amp;gt; &amp;gt; my limits are : thetha=[0-pi], phi=[0-2pi].&lt;br&gt;
&amp;gt; &amp;gt; when  i set tollerance values it did not help the accuracy.&lt;br&gt;
&amp;gt; &amp;gt; i know (not sure) the answer from the answer of the other side of the &lt;br&gt;
&amp;gt; &amp;gt; equation (dot(E,J))&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Can you show the integral you're trying to compute and the code that you &lt;br&gt;
&amp;gt; wrote to compute it? Perhaps one of the readers of the group can detect if &lt;br&gt;
&amp;gt; there's a typo or other type of error in the code.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; -- &lt;br&gt;
&amp;gt; Steve Lord&lt;br&gt;
&amp;gt; slord@mathworks.com&lt;br&gt;
&amp;gt; To contact Technical Support use the Contact Us link on &lt;br&gt;
&amp;gt; &lt;a href="http://www.mathworks.com"&gt;http://www.mathworks.com&lt;/a&gt; </description>
    </item>
  </channel>
</rss>
