Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #14561

Re: Repeated Integrals

From Peter Pein <petsie@dordos.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: Repeated Integrals
Date 2013-05-21 04:02 +0000
Message-ID <knerkl$2p$1@smc.vnet.net> (permalink)
References <kna71o$fve$1@smc.vnet.net>
Organization Time-Warner Telecom

Show all headers | View raw


Am 19.05.2013 11:46, schrieb briankolo@gmail.com:
> I'm fairly new to Mathematica and I'm trying to create an expression for a set of nested integrals. The innermost integral is
> 
> int[0,x,L(y,a)g(y),dy]
> 
> Where g(y) is an arbitrary function and a is a parameter. The next integral is
> 
> int[0,w,L(x,b)h(x,a),dx]
> 
> Where b is a parameter and h(x,a) is the result of the previous integral.
> 
> The process then repeats N times. Is there a simple way to express this in Mathematica?
> 
> 

Nest/NestList are your friends:

intlist = With[ (* toy example *)
  {L = HeavisideTheta[#1, 1 - #1/#2]&, g = Cos[Pi #]&, a = 3, b = 2},
  Assuming[Element[x, Reals], (* needed in this case *)
    NestList[
      Block[{t}, Integrate[L[t, b] (# /. x->t), {t, 0, x}]]&,
      Integrate[L[y, a] g[y], {y, 0, x}],
      5]
    ]
  ];

Peter

P.S.: in this example, try the plot:

Plot[MapIndexed[#1*Gamma[#2 + 1] x^-#2 &, intlist] //
  Evaluate, {x, -.1, 3.5}, PlotRange -> {-.22, 1},
 Exclusions -> None, PlotLegends -> Automatic,
 WorkingPrecision -> 1.5 $MachinePrecision]

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

Repeated Integrals briankolo@gmail.com - 2013-05-19 09:46 +0000
  Re: Repeated Integrals Peter Pein <petsie@dordos.net> - 2013-05-21 04:02 +0000

csiph-web