       Re: Nested numerical integral - speed: Is it suppose to be so slow?

• To: mathgroup at smc.vnet.net
• Subject: [mg127643] Re: Nested numerical integral - speed: Is it suppose to be so slow?
• From: W Craig Carter <ccarter at MIT.EDU>
• Date: Fri, 10 Aug 2012 02:43:01 -0400 (EDT)
• Delivered-to: l-mathgroup@mail-archive0.wolfram.com
• Delivered-to: l-mathgroup@wolfram.com
• Delivered-to: mathgroup-newout@smc.vnet.net
• Delivered-to: mathgroup-newsend@smc.vnet.net
• References: <20120809075343.71F12664F@smc.vnet.net>

```Hello Sune,
I believe you can work symbolically:

trap[t_, t1_, t2_, a_] :=
Piecewise[{{0, t < 0 || t >= t1 + t2}, {a t,
t >= 0 && t < t1}, {a t1, t >= t1 && t < t2}, {a (-t + t1 + t2),
t >= t2 && t < t1 + t2}}]

tplus = Integrate[trap[t, t1, t2, a], {u, 0, t},
Assumptions -> Element[{g, a, \[Delta], \[CapitalDelta], t}, Reals]]

tminus = Integrate[trap[t - 2 \[CapitalDelta], t1, t2, a], {u, 0, t},
Assumptions -> Element[{g, a, \[Delta], \[CapitalDelta], t}, Reals]]

inttminus =
Integrate[tminus, {u, 0, t},
Assumptions -> Element[{g, a, \[Delta], \[CapitalDelta], t}, Reals]]

inttplus =
Integrate[tplus, {u, 0, t},
Assumptions -> Element[{g, a, \[Delta], \[CapitalDelta], t}, Reals]]

baSym = (2.675222/10)^2 ( inttplus - inttminus)

baSym /. {t -> 5.5,
a -> 100000, \[CapitalDelta] -> 12, \[Delta] -> 0.25}
(*the result depends on t1 and t2 which are undefined?*)

W Craig Carter
Professor of Materials Science, MIT

On Aug 9, , at Thu Aug 9, 12 @3:53 AM, Sune wrote:

> In:= ba[g_,a_,\[CapitalDelta]_,\[Delta]_]:=(2.675222/10)^2 NIntegrate[Fa[x,g,a,\[CapitalDelta],\[Delta]]^2,{x,0,\[Delta]+2 \[CapitalDelta]}]

```

• Prev by Date: Re: Simplify Binomial
• Next by Date: Re: Nested numerical integral - speed: Is it suppose to be
• Previous by thread: Nested numerical integral - speed: Is it suppose to be so slow?
• Next by thread: Re: Nested numerical integral - speed: Is it suppose to be