Re: piecewise integration
- To: mathgroup at smc.vnet.net
- Subject: [mg66963] Re: piecewise integration
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Mon, 5 Jun 2006 03:48:27 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <e5tt8l$ebs$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Chris Chiasson wrote: > The Integrate result seems pretty weak. Is there any way to obtain a > more explicit exact answer besides manually converting the Piecewise > function to two UnitStep functions? Can the same be done if the final > limit of integration is a variable? > > in > > load[x_]=-9*10^3*DiracDelta[x]+Piecewise[{{x*10*(10^3/3),0<=x<=3}}]-6*10^3*DiracDelta[x-5]//InputForm > > out > > -6000*DiracDelta[-5 + x] - 9000*DiracDelta[x] + > Piecewise[{{(10000*x)/3, 0 <= x <= 3}}, 0] > > in > > Integrate[load[x],{x,0,5}]//InputForm > > out > > Integrate[InputForm[-6000*DiracDelta[-5 + x] - 9000*DiracDelta[x] + > Piecewise[{{(10000*x)/3, 0 <= x <= 3}}, 0]], {x, 0, 5}] > Hi Chris, You could try Maxim Rytin's PiecewiseIntegrate function [1]. From MathSource: "The notebook contains the implementation of four functions PiecewiseIntegrate, PiecewiseSum, NPiecewiseIntegrate, NPiecewiseSum. They are intended for working with piecewise continuous functions, and also generalized functions in the case of PiecewiseIntegrate. They support all the standard Mathematica piecewise functions such as UnitStep, Abs, Max, as well as Floor and other arithmetic piecewise functions. PiecewiseIntegrate supports the multidimensional DiracDelta function and its derivatives. The arguments of the piecewise functions can be non-algebraic and contain symbolic parameters." In[1]:= load[x_] := -6000*DiracDelta[-5 + x] - 9000*DiracDelta[x] + Piecewise[ {{(10000*x)/3, 0 <= x <= 3}}, 0] In[2]:= Integrate[load[x], {x, 0, 5}] Out[2]= Integrate[-6000*DiracDelta[-5 + x] - 9000*DiracDelta[x] + Piecewise[ {{(10000*x)/3, 0 <= x <= 3}}], {x, 0, 5}] In[103]:= PiecewiseIntegrate[load[x], {x, 0, 5}] Out[103]= 0 HTH, Jean-Marc [1]: Rytin, Maxim, _Integration of Piecewise Functions with Applications_, Mathematica Package, http://library.wolfram.com/infocenter/MathSource/5117/