poster
2019-11-27, 16:22
<p>I want to numerically integrate the following with Matlab: </p>
<pre><code> fun=@(t) (((1 - (-1)^n*cos(n*pi*t/R)))./t);
hn = integral(fun,0,(sqrt(R^2-x^2)));
</code></pre>
<p>For now, I just avoided to evaluate the integral in 0, are they any way to encounter the singularity at this point.</p>
<p>Thank you.</p>
More answer... (https://stackoverflow.com/questions/59065717/how-to-avoid-singularity-in-numirical-integration)
<pre><code> fun=@(t) (((1 - (-1)^n*cos(n*pi*t/R)))./t);
hn = integral(fun,0,(sqrt(R^2-x^2)));
</code></pre>
<p>For now, I just avoided to evaluate the integral in 0, are they any way to encounter the singularity at this point.</p>
<p>Thank you.</p>
More answer... (https://stackoverflow.com/questions/59065717/how-to-avoid-singularity-in-numirical-integration)