MathGroup Archive 1999

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Help! How to execute line integral, surface integral or integration around contour.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg17580] RE: [mg17552] Help! How to execute line integral, surface integral or integration around contour.
  • From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
  • Date: Mon, 17 May 1999 02:14:29 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

Kazuhiko Kato  wrote:
---------------------

Please teach me how to execute line integral, surface integral or
integration of analytic function around a contour by using mathematica.

----------------------

The code below is from section 6.4 of "Mathematica for Scientists and
Engineers", by Thomas Bahder. The book was written before we had Mathematica
3.0, so I had to change the obsolete feature "Literal" to "HoldPattern".
Also I decided to change (_*Dt ) to (_.*Dt )

The book has code for ContourIntegrate, but didn't see anything on
SurfaceIntegrate.  Now that you have the code below you may be able to come
up with code for the others.  You might also buy the book.


LineIntegrate::usage="LineIntegrate[
 P Dt[x1]+ Q Dt[x2]+ R t[x3],
 {x1==f1[t],x2==f2[t],x3==f3[t]},
 {t,tmin,tmax},{x1,x2,x3}
] attempts to calculate the line integral in {x1,x2,x3} space by
parameterizing the integration path,{x1==f1[t],x2==f2[t],x3==f3[t]}, with
respect to t from t=tmin to t=tmax. This can be used for a line integral in
higher dimensions.";


LineIntegrate[
	f:HoldPattern[_.*Dt[_]|Plus[(_.*Dt[_])..]],
	path:{__Equal},params:{t_,_,_},vars:{__}]:=
	Integrate[f/.First[Solve[path,vars]]/.Dt[t]->1,params]/;
		Length[params]===Length[vars]


(* --------- Example ---------*)
In[4]:=
LineIntegrate[x^2 y Dt[x]+y z Dt[y]+z x
Dt[z],{x==Cos[t],y==Sin[t],z==Sin[t]},
{t,0,2 Pi},{x,y,z}]

Out[4]=
-Pi/4

----------
Regards,
Ted Ersek


  • Prev by Date: Re: ask for help on Mathematica
  • Next by Date: Re: Impulse Fumction using UnitStep???
  • Previous by thread: Help! How to execute line integral, surface integral or integration around contour.
  • Next by thread: Re: Help! How to execute line integral, surface integral or integration around contour.