| Author |
Comment/Response |
Britnee Crawford
|
07/24/10 5:22pm
Hi, I am trying to compute a triple integral with the inner integrals as variable limits of integration. NIntegrate doesn't seem to work because the limits are not numbers for the inner integrals. But, using Integrate takes forever and doesn't seem to run.
I think part of the problem is that the function I am trying to integrate is piecewise with domain of each piece depending on a variable. Here is the syntax for the definition of the piecewise function:
b0 := 0
b1 := 5
b2 := 50
b3 := 75
b4 := 100
b5 := Sqrt[(M5 (b4^2 - b3^2) + M4 b4^2)/M4]
M1 := 0.51
M2 := 0
M3 := 0.0375
M4 := 0.0125
M5 := 0.44
r0[x_] := (b0 Sqrt[1 - e^2])/(1 - e Sin[x])
r1[x_] := (b1 Sqrt[1 - e^2])/(1 - e Sin[x])
r2[x_] := (b2 Sqrt[1 - e^2])/(1 - e Sin[x])
r3[x_] := (b3 Sqrt[1 - e^2])/(1 - e Sin[x])
r4[x_] := (b4 Sqrt[1 - e^2])/(1 - e Sin[x])
r5[x_] := (b5 Sqrt[1 - e^2])/(1 - e Sin[x])
f1[x_] := (M1 Sqrt[1 - e^2])/(Pi (b1^2 - b0^2))
f2[x_] := (M2 Sqrt[1 - e^2])/(Pi (b2^2 - b1^2))
f3[x_] := (M3 Sqrt[1 - e^2])/(Pi (b3^2 - b2^2))
f4[x_] := (M4 Sqrt[1 - e^2])/(Pi (b4^2 - b3^2))
f5[x_] := (M5 Sqrt[1 - e^2])/(Pi (b5^2 - b4^2))
Psi[r_, x_] :=
Piecewise[{{f1[x], r <= r1[x]}, {f2[x], r1[x] < r <= r2[x]}, {f3[x],
r2[x] < r <= r3[x]}, {f4[x], r3[x] < r <= r4[x]}, {f5[x],
r4[x] < r <= r5[x]}}]
Then, here is the integral:
N[Integrate[
Integrate[
Integrate[Psi[r, x] r, {r, r1[x], r5[x]}], {x, right[y],
left[y]}], {y, -b5, 0}]]
"right[y]" and "left[y]" are two functions of y that I have defined, but not written here.
I have tried several different ways of writing this integral (using nested Integrate, or just 1 Integrate as a triple integral).
Can anyone help?
Britnee Crawford
URL: , |
|