<div dir="ltr">Many thanks Samuel.<div>Happy New Year!</div><div><br></div><div>Lester</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 5 Jan 2022 at 13:32, <<a href="mailto:sgougeon@free.fr">sgougeon@free.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Lester,<br>
<br>
The integrand is y = exp((z^2))/(z-2), not y = exp((z^2)).<br>
Then, provided that the (undocumented) absolute tolerance is increased wrt the default one,<br>
we get the expected result:<br>
<br>
--> function y=f(z)<br>
  >   y = exp((z.^2))./(z-2)<br>
  > endfunction<br>
<br>
--> fz=intl(0, 2*%pi, 2, 1, f,1e-10) // gives round-off error<br>
 fz  = <br>
   4.199D-13 + 343.05029i<br>
<br>
--> 2*%pi*%i*%e^4<br>
 ans  =<br>
   0. + 343.05029i<br>
<br>
Regards<br>
Samuel<br>
<br>
> ----- Mail d'origine -----<br>
> De: Lester Anderson<br>
> Envoyé: Wed, 05 Jan 2022 09:46:47 +0100 (CET)<br>
><br>
> Hello,<br>
><br>
> I am trying to understand how to work the Cauchy integral inputs and<br>
> replicate the results of a published example:<br>
><br>
> .e.g. Compute the integral of e^(z^2) / (z-2) assumes C is closed<br>
> (anticlockwise) and z=2 is inside C (a simple circle). The solution should<br>
> be 2*pi*i*f(2) = 2*pi*i*e^4<br>
><br>
> In Scilab, the solution is defined from the Cauchy Integral (intl):<br>
> y = intl(a, b, z0, r, f)<br>
> a and b are real and z complex<br>
><br>
> function y=f(z)<br>
>   y = exp((z^2)) // solution uses f(z) =  e^(z^2)<br>
> endfunction<br>
><br>
> fz=intl(0, 2*%pi, 2+0*%i, 1, f) // gives round-off error<br>
> // z position +2(real z), 0(imaginary z)<br>
><br>
_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
</blockquote></div>