Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #10484
| From | "Brambilla Roberto Luigi (RSE)" <Roberto.Brambilla@rse-web.it> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | I: Bug in NIntegrate[]? |
| Date | 2012-06-15 19:33 +0000 |
| Organization | Steven M. Christensen and Associates, Inc and MathTensor, Inc. |
| Message-ID | <jrg2mr$sls$1@smc.vnet.net> (permalink) |
-----Messaggio originale-----
Da: Brambilla Roberto Luigi (RSE)
Inviato: venerd=EC 15 giugno 2012 10.18
A: 'GS'
Oggetto: R: Bug in NIntegrate[]?
Weak formulation. This works:
f[x_] := If[0 <= x <= 1, 1, 0]
Integrate[f[x], {x, -13, 13}]
1
Bye Rob
-----Messaggio originale-----
Da: GS [mailto:vokaputs@gmail.com]
Inviato: venerd=EC 15 giugno 2012 9.41
A: mathgroup@smc.vnet.net
Oggetto: Bug in NIntegrate[]?
I define the function f[x] as follows:
f[x_] := 0 /; x < 0 || x > 1;
f[x_] := 1
It is zero outside of the interval [0,1]. This can be verified by plotting
Plot[f[x], {x, -1, 2}]
Now I integrate it from -1 to 2:
In[270]:= NIntegrate[f[x], {x, -1, 2}]
Out[270]= 3.
The result should be 1, but it is 3. Clearly Mathematica ignores the fact that f[x] is zero outside of [0,1].
This caused a lot of headache for me recently when I encountered such behavior in one of my research code.
GS
RSE SpA ha adottato il Modello Organizzativo ai sensi del D.Lgs.231/2001, in=
forza del quale l'assunzione di obbligazioni da parte della Societ=E0 avvie=
ne con firma di un procuratore, munito di idonei poteri.
RSE adopts a Compliance Programme under the Italian Law (D.Lgs.231/2001). Ac=
cording to this RSE Compliance Programme, any commitment of RSE is taken by=
the signature of one Representative granted by a proper Power of Attorney.=
Le informazioni contenute in questo messaggio di posta elettronica sono ris=
ervate e confidenziali e ne e' vietata la diffusione in qualsiasi modo o for=
ma. Qualora Lei non fosse la persona destinataria del presente messaggio, La=
invitiamo a non diffonderlo e ad eliminarlo, dandone gentilmente comunicazi=
one al mittente. The information included in this e-mail and any attachments=
are confidential and may also be privileged. If you are not the correct rec=
ipient, you are kindly requested to notify the sender immediately, to cancel=
it and not to disclose the contents to any other person.
Back to comp.soft-sys.math.mathematica | Previous | Next | Find similar | Unroll thread
I: Bug in NIntegrate[]? "Brambilla Roberto Luigi (RSE)" <Roberto.Brambilla@rse-web.it> - 2012-06-15 19:33 +0000
csiph-web