       Re: Strange behaviour of Plot

• To: mathgroup at smc.vnet.net
• Subject: [mg107667] Re: Strange behaviour of Plot
• From: dh <dh at metrohm.com>
• Date: Mon, 22 Feb 2010 08:31:13 -0500 (EST)
• References: <hlj43f\$rt6\$1@smc.vnet.net>

```Hi,
your function contains an If statement. Therefore, you can not expect
the function to be continuous.
Consider e.g. Summand2 for m=0;
If[j == m, 0,
2/((j - m)^2 \[CapitalDelta]^2) (-3 +
Exp[-(((j - m)^2 \[CapitalDelta]^2)/2)] (3 +
2 (j - m)^2 \[CapitalDelta]^2))] /. m -> 0
gives:
If[j == 0, 0, (
2 (-3 + Exp[-(1/2) ((j - 0)^2 \[CapitalDelta]^2)] (3 +
2 (j - 0)^2 \[CapitalDelta]^2)))/((j - 0)^2 \[CapitalDelta]^2)]

clearly this is not continuous at m=0.
Due to finite resolution, the plot routine ignores (does not find) these
singular points.
Daniel

On 18.02.2010 11:17, Very Bad Mother... wrote:
> Hi,
> I've found it quite puzzling. Pls, have a look.
> I define the following functions:
>
> Summand2[j_, m_, \[CapitalDelta]_] :=
>    If[j == m, 0,
>     2/((j - m)^2 \[CapitalDelta]^2) (-3 +
>        Exp[-(((j - m)^2 \[CapitalDelta]^2)/2)] (3 +
>           2 (j - m)^2 \[CapitalDelta]^2))];
>
> sigma[m_, Nm_, \[CapitalDelta]_] := NSum[Summand2[j, m, \
> [CapitalDelta]], {j, 0, Nm - 1}];
>
> where j and m are supposed to be integers and \[CapitalDelta] to be a
> "double" (in C-terms).
> Now, I'd like to plot the sigma function:
> Plot[sigma[m, 4, 6], {m, 0, 3}]
> So, ofcourse, I obtain a plot of a continues function, for all ms
> between 0 and 3. From this plot one can find that the values of sigma
> for integers are positive and about 0.6. However, what is interesting,
> if one evaluates explicitly sigma[m, 4, 6] for m=0, 1, 2, 3, one will
> find that actually the values are negative about -0.3.
> How is that possible? It's really confusing. Any help appreciated.
> --
> Kind regards,
> tinkerbell
>

--

Daniel Huber
Metrohm Ltd.
Oberdorfstr. 68
CH-9100 Herisau
Tel. +41 71 353 8585, Fax +41 71 353 8907
E-Mail:<mailto:dh at metrohm.com>
Internet:<http://www.metrohm.com>

```

• Prev by Date: Re: Error List Plot with Legends
• Next by Date: Re: Import data from an email
• Previous by thread: Re: Strange behaviour of Plot
• Next by thread: NDsolve with a quasi random scource