0
|
2313 Views
|
2 Replies
|
2 Total Likes
View groups...
Share
GROUPS:

# Integration results appear inconsistent

Posted 10 years ago
 certain multiple integrals should give the same result but do not . It is a problem in statistical mechanics. Attachments:
2 Replies
Sort By:
Posted 10 years ago
 A couple of things to note. In the case of your 2nd integral, your x3 limits of integration are between -6 and 6 rather than -2 and 2. Changing the limits to all be between -2 and 2 results in identical results in your first two integrals.One thing that you may be doing which makes it seem that you are getting inconsistent results is choosing your limits of integration to be between -2 and 2. In the convolutions that you are computing the actual expressions in the argument of the integral may have non-zero support outside of those limits. My guess is that the actual integrals should be between -Infinity and Infinity. In that case you will always integrate over the full support of the function. If you do that, your integration results are the same in your two cases.  In:= f[x_] := Piecewise[{ {0, x < -2}, {a, -2 < x < -1}, {-1, -1 < x < 1}, {a, 1 < x < 2}, {0, x > 2} }] In:= \[Beta]31 = Integrate[ f[x1] f[x2 - x1] f[x3 - x2] f[ x3], {x1, -\[Infinity], \[Infinity]}, {x2, -\[Infinity], \ \[Infinity]}, {x3, -\[Infinity], \[Infinity]}] Out= 4/3 (4 - 7 a + 15 a^2 - 3 a^3 + 3 a^4) In:= \[Beta]31 = Integrate[ f[x1] f[x3 - x1] f[x2] f[ x3 - x2], {x1, -\[Infinity], \[Infinity]}, {x2, -\[Infinity], \ \[Infinity]}, {x3, -\[Infinity], \[Infinity]}] Out= 4/3 (4 - 7 a + 15 a^2 - 3 a^3 + 3 a^4) In:= \[Beta]32 = Integrate[ f[x1] f[x2 - x1] f[x3 - x1] f[x3 - x2] f[ x3], {x1, -\[Infinity], \[Infinity]}, {x2, -\[Infinity], \ \[Infinity]}, {x3, -\[Infinity], \[Infinity]}] Out= -(2/3) (7 - 9 a + 20 a^2 - 16 a^3 + 4 a^4) In:= \[Beta]32 = Integrate[ f[x1] f[x2 - x1] f[x2] f[x3 - x2] f[ x3], {x1, -\[Infinity], \[Infinity]}, {x2, -\[Infinity], \ \[Infinity]}, {x3, -\[Infinity], \[Infinity]}] Out= -(2/3) (7 - 9 a + 20 a^2 - 16 a^3 + 4 a^4) 
Posted 10 years ago
 (1) There is no reason to not have the explicit code in the post. It's simple code.(2) Integrate gives results consistent with NIntegrate. That's a fairly strong indication that the two should in fact not give the same result.Here is the function, rewritten to use Piecewise (which is better suited for use in Integrate and NIntegrate). f[x_] := Piecewise[{{0, x < -2}, {a, -2 <= x < -1}, {-1, -1 <= x < 1}, {a, 1 <= x < 2}}] Here are the computations. In:= beta1 = Integrate[ f[x1] f[x2 - x1] f[x3 - x2] f[x3], {x1, -2, 2}, {x2, -2, 2}, {x3, -2, 2}] Out= 4/3 (4 - 7 a + 13 a^2 - 2 a^3 + 2 a^4) In:= beta2 = Integrate[ f[x1] f[x3 - x1] f[x2] f[x3 - x2], {x1, -2, 2}, {x2, -2, 2}, {x3, -6, 6}] Out= 4/3 (4 - 7 a + 15 a^2 - 3 a^3 + 3 a^4) Numerical consistency checks: In:= NIntegrate[ f[x1] f[x2 - x1] f[x3 - x2] f[x3] /. a -> 3.3, {x1, -2, 2}, {x2, -2, 2}, {x3, -6, 6}] Out= 383.706933333 In:= beta1 /. a -> 3.3 Out= 383.706933333 In:= NIntegrate[ f[x1] f[x3 - x1] f[x2] f[x3 - x2] /. a -> 3.3, {x1, -2, 2}, {x2, -2, 2}, {x3, -6, 6}] Out= 522.953733333 In:= beta2 /. a -> 3.3 Out= 522.953733333