{\def\dummy\}:#{}}%-*-LaTeX-*- % This is a mapledoc file, it may be read \ \documentclass{article} % into a Maple worksheet to load the code, \ \usepackage{mapledoc} % or run through LaTeX to typeset the \ \usepackage{euler,beton} % documentation. To do the latter you will \ \usepackage{amsmath,url} % need the mapledoc package, it is available \ \def\fileversion{4.03b} % from the author, Joe Riel, at \ \def\filedate{1996/11/25} % . \ \def\docdate {1996/11/25} %\ \IndexByCodeline %\ \EnableAutoIndex %\ \RecordChanges %\ \DoNotIndex{} %\ \MakeIgnore\# # \MakeComment\% # \makeatletter # \GobbleAfterHash{1} # \MakeShortVerb\" # \let\comment=\emph # \MakeParameter\$ # \newcommand\Rn[1]{\ensuremath{\mathcal{R}^{$1}}} #% \def\verbatim@font{\ttfamily\bf} # \MakeMath\$ # \newtheorem{example}{Example} # \makeatother # # \begin{document} # # \title{Path Integrals in Maple\thanks{% # This is version \fileversion\ of this package, # last revised \filedate, # documentation dated \docdate. # The most significant digit is the release of Maple # for which it was written.}} # # \author{Joseph Riel \\ \vspace{1ex} jsr@sparc.sandiegoca.ncr.com} # \date{Printed \today} # \maketitle # # \change{v4.01}{96/11/24}{Initial release} # \change{v4.02}{96/11/25}{Removed innerprod, fixed some minor bugs.} # \change{v4.03}{96/11/26}{Removed dotprod, added dot.} # \change{v4.03b}{96/12/03}{Incorporated help page.} # # # \section{Introduction} # # Maple's definite integral function, "int" integrates a scalar # along the real axis. This package defines a funtion, "pathint", # that integrates a vector or scalar along a path in \Rn{n}. # It provides several methods for specifying the path, similar to # how "plot" allows curves to be specified. # # \section{Syntax} # # \DescribeProc{pathint} # The syntax of "pathint" is similar to that of "int". # The function has two mandatory arguments, the first is the integrand, # the second is an equation that specifies the integration # vector and the path. A significant difference from "int" is that # "pathint" requires that there be an explicit differential element # in the integrand. Following is a simple example that # integrates the vector field \mbox{$\vec{F}(x,y) = (xy,x+y)$} # along the line segment from $(0,0)$ to~$(a,b)$. # # \begin{verbatim} # > F := [x*y,x+y]: p := [x,y]: p1 := [0,0]: p2 := [a,b]: # > pathint(dot(F,D(p)), p = p1..p2); # \end{verbatim} # \[ \frac13 a^2b + \frac12 b^2 + \frac12 ab \] # # \subsection{Integrand} # # The first parameter to "pathint" is the integrand, it may be a scalar # or vector quantity. A vector quantity may be expressed as either a # list, a vector, or a linear combination of lists and vectors; # the expression is converted to a list internally. # A scalar expression, and each item of a vector, must contain a # differential element, that is, a function # call $D(x)$ where $x$ one of the integration vector components. # This is necessary so that "pathint" can substitute the appropriate # derivative of the path. Higher order derivatives may be included, # use the syntax "D(D(x))" for a second derivative, and so on. # # \subsection{Integration vector and path} # # The second parameter specifies the integration vector and the path. # It is an equation of the form \meta{list}=\meta{path}. # The left side of the equation, \meta{list}, # is a list of the names of the components of the integration vector. # The right side of the equation, \meta{path}, specifies an oriented # path in \Rn{n}. Several formats are available for describing the path, # each is described in the following paragraphs. # # A parameterized path \marginpar{Parameterized path} # is a list containing two items: a list of # expressions, one for each coordinate, and an equation giving # the parameter and the range over which it varies. # For example, "[[cos(t),sin(t),t],t=0..2*Pi]" describes a helix. # # A line segment \marginpar{Line segment} # connecting two points in \Rn{n} may be described as a range of # points~(lists). For example, "[0,0]..[1,1]" is a straight line # from $(0,0)$ to~$(1,1)$. The direction of integration is from the # left point to the right point. # # Connected segments \marginpar{Connected segments} # may be described as a list of points. # For example, "[[0,0],[1,0],[0,1],[0,0]]" is a closed triangular # path connecting the points $(0,0)$, $(1,0)$, and~$(1,0)$. # The order of integration is from the first point to the last point. # A separate integral is evaluated for each segment, the results # are summed. # # Disjoint or independent paths \marginpar{Disjoint paths} # are formed by enclosing them in a set. # For example, \{"[1,1]..[0,0],[[t,t^2],t=0..1]"\} consists of # a line segment and a parabolic segment. The integral of each path # is computed separately, the results are summed. # # \subsection{Optional argument} # # An optional third argument, of type name, becomes the integration # variable used by "int" when "pathint" parameterizes the path. # This is useful if Maple cannot evaluate the integral and you # want to access and manipulate the parameterized integrand. # # \section{Miscellaneous Functions} # # \DescribeProc{Pathint} # "Pathint" is an inert version of "pathint". It operates just as # "pathint" does, but passes the integrands to "Int" rather # then "int". # # \DescribeProc{mag} # The "mag" function returns the square root of the sum of the # squares of the items of a list or vector. It is useful in # evaluating many types of line integrals. It implicitly assumes # that the components are real. # # \DescribeProc{dot} # The "dot" function returns the dot product of # two lists or vectors. It is loaded from the "linalg" package. # # \DescribeProc{type/simple} # The type "simple" is defined to be an unassigned name. # # \section{Examples} # # \subsection{Line integral of a vector field (1-form)} # # Let $\gamma$ be a path in \Rn{n}, parameterized by $g(t)$, # with \mbox{$a \le t \le b$}. Let $\vec{F}$ be a continuous vector field # in \Rn{n}. The \emph{line integral} of $\vec{F}$ over $\gamma$ is # $\int_a^b \vec{F}(g(t)\cdot g'(t)\,dt$. The integral can be computed # with "pathint" by using $D(g)$ to form the $g'(t)$. # # \begin{example} # Let \mbox{$\vec{F}(x,y,z)=(z,x^2,y)$}. # Let $\gamma$ be the curve \mbox{$g(t)=(t,t^2,t^3)$} for $0\le t \le a$. # Compute the integral of $\vec{F}$ over~$\gamma$. # # \begin{verbatim} # > Gamma := [[t,t^2,t^3],t=0..a]: # > g := [x,y,z]: # > F := [z,x^2,y]: # > pathint(dot(F,D(g)),g=Gamma); # \end{verbatim} # \[ \frac34 a^4 + \frac35 a^5 \] # \end{example} # # # \subsection{Space curves} # # \begin{example} # Let $\gamma$ be a path in \Rn{n}, parameterized by $g(t)$, # with \mbox{$a \le t \le b$}. # The length of the path is given by $\int_a^b |g'(t)|\,dt$. # The integral can be computed by using the "mag" # and D functions to represent $|g'(t)|$. Compute the # length of the helix $(r\cos{\phi},r\sin{\phi},k\phi)$ # for $0\le\phi\le\Phi$. # # \begin{verbatim} # > Gamma := [[r*cos(phi),r*sin(phi),k*phi],phi=0..Phi]: # > g := [x,y,z]: # > L := pathint(mag(D(g)),g=Gamma); # \end{verbatim} # \[ L := \Phi\sqrt{r^2+k^2} \] # \end{example} # # \begin{example} # The curvature, $\kappa$, of $\gamma$ is # $\sqrt{|g'|^2|g''|^2 - (g'\cdot g'')^2}/|g'|^3$. # The integral of $\kappa$ with respect to arc length, # $\int_a^b \kappa(t)|g'(t)|\,dt$, # gives the total angle through which the path bends. # Compute the quantity for the previously defined helix. # # \begin{verbatim} # > kappa := sqrt(mag(D(g))^2*mag(D(D(g)))^2 # - dot(D(g),D(D(g)))^2)/mag(D(g))^3: # > dtheta := kappa*mag(D(g)): # > theta := pathint(dtheta,g=Gamma); # \end{verbatim} # \[ \theta := \frac{\Phi\sqrt{r^4+r^2k^2}}{r^2+k^2} \] # \end{example} # # # # \subsection{Electromagnetics} # # Electromagnetics provides many nice examples of the application # of path integrals. Here are a few to further demonstrate the # use of "pathint". # # \begin{example} # Given a circular filament with radius $r$ and charge # density $\rho$, determine the electric field along the axis. # The filament is centered at the origin and perpendicular to # the z-axis. The field generated from an infinitesimal # charge is, from Coulomb's law, # \mbox{$d\vec{E} = dQ/(4\pi\epsilon)\vec{R}/|\vec{R}|^3$}. # The infinitesimal charge, $dQ$, is given by $\rho\,dl$, # where $dl$ is a differential length of the filament. # # \begin{verbatim} # > assume(r > 0): # > filament := [[r*cos(phi),r*sin(phi),0], phi = 0..2*Pi]: # > p := [x,y,z]: # p is a point in space # > pf := [xf,yf,zf]: # pf is a point on the filament # > R := p-pf: # R is the vector from pf to p # > dQ := rho*mag(D(pf)): # > dE := 1/4/Pi/epsilon*dQ*R/mag(R)^3: # > dEaxis := subs(x=0,y=0,dE): # > Eaxis := pathint(dEaxis, pf=filament); # \end{verbatim} # \[ Eaxis := [0,0,1/2\,\frac{r\,z\,\rho}{(r^2+z^2)^{3/2}\epsilon} ] \] # \end{example} # # \begin{example} # Compute the potential at the center of the circle. # One method is to integrate the electric field, $\vec{E}$, # along the axis, from the center to $\infty$. The potential at # the center is $V = \int_0^\infty \vec{E}\cdot dz$. # # \begin{verbatim} # > with(linalg): # > axis := [[0,0,zz], zz=0..infinity]: # > dV := dot(Eaxis,D(p)): # > V := simplify(pathint(dV,p=axis)); # \end{verbatim} # \[ V := \frac12\frac\rho\epsilon \] # \end{example} # # \begin{example} # Another method to compute the potential is to integrate the contribution # from each infinitismal charge, which is $dV=dQ/(4\pi\epsilon R)$. # \begin{verbatim} # > dV := subs(x=0,y=0,z=0, dQ/4/Pi/epsilon/mag(R)): # > pathint(dV, pf=filament); # \end{verbatim} # \[ V := \frac12\frac\rho\epsilon \] # \end{example} # # \begin{example} # \newcommand\dH{\ensuremath{d\vec{H}}}% # \newcommand\dl{\ensuremath{d\vec{l}}}% # \newcommand\R{\ensuremath{\vec{R}}}% # Given a current $I$ on a wire of length $l$ lying on # the z-axis and centered at the origin, compute the magnetic # field in the plane $z=0$. The magnetic field generated by # an infinitesmal length of filament is, from the Biot-Savart law, # $ \dH = 1/(4\pi)\,I\,\dl\times\R/|\R|^3 $. # # \begin{verbatim} # > assume(l > 0): alias(I=I): # > wire := [0,0,-l/2]..[0,0,l/2]: # > pw := [xw,yw,zw]: # pw is a point on the wire # > p := [x,y,z]: # p is a point in space # > R := p-pw: # R is the vector from pw to p # > dH := 1/4/Pi*I*crossprod(D(pw),R)/mag(R)^3: # > H := pathint(dH, pw=wire); # \end{verbatim} # \newcommand\denom{\sqrt{l^2+4x^2+4y^2}(x^2+y^2)\pi} # \[ H := \left[-\frac12\frac{I\,l\,y}{\denom}, # \frac12\frac{I\,l\,x}{\denom}, # 0 \right] \] # \end{example} # # \begin{example} # Compute the line integral of $\vec{H}$ along a closed square path, # with sides of length $s$, centered at the origin and lying in the plane # $z=0$. # # \begin{verbatim} # > assume(s > 0): # > box := expand([[1,1,0],[-1,1,0],[-1,-1,0],[1,-1,0],[1,1,0]]*s/2): # > pathint(dot(H,D(p)),p=box); # \end{verbatim} # \[ \frac4\pi I \arctan{\left(\frac{l}{\sqrt{l^2+2s^2}}\right)} \] # \end{example} # # #%-------------------------------------------------------------------------- # \section{Source Code} # # # \begin{maplesource} # # \begin{Global}{coderev} # Assign a string for the revision level of the code. # The most significant digit is the release of Maple for which it is written. coderev := `4.03`: # \end{Global} # # \DefineMacros{check_D} # Assign macros for the auxiliary functions. macro(check_D = `pathint/check_D`): # # \DefineMacros{_illegal_int_vector,_mismatched_vectors,_invalid_path} # \DefineMacros{_illegal_use_of_D,_no_differential} # Assign macros for the error messages. This simplifies testing the code # and modifying the messages. macro( _illegal_int_vector = `illegal component in integration vector`, _mismatched_vectors = `differing number of elements in vectors`, _invalid_path = `invalid path`, _illegal_use_of_D = `invalid use of D, must be a function`, _no_differential = `integrand does not have a valid differential`): # # \begin{Proc}{pathint} # Integrate the first parameter, $ff$, along a given path. # The second parameter is an equation of # the form \mbox{$\meta{list}=\meta{path}$}. The \meta{list} specifies # the components of \Rn{n}. The \meta{path} specifies the path and has # several forms. The third parameter, $tt$, is optional, if supplied # it is used to parameterize a path, if necessary. pathint := proc(ff,varpath::list=anything,tt::name) local f,patheqs,vars,p,path,t,ft,x; options `Copyright (C) 1996 by Joseph Riel`; # # Assign $ff$ to $f$. # Convert a linear combination of vectors and lists to a list. if hastype(ff,vector) then f := convert(evalm(ff),list) else f := expand(ff) fi; vars := lhs(varpath); path := rhs(varpath); # Check for a valid integration vector. if not type(vars,list('simple')) or nops({op(vars)}) <> nops(vars) then ERROR(_illegal_int_vector) fi; # # Determine the path type. # If the path is parameterized, \marginpar{Parameterized path} # substitute the path equations into the field equations, # and evaluate the D operator by substituting the "diff" function. if type(path, [list, name = range]) then patheqs := op(1,path); # # Check for a valid path equation vector. if nops(patheqs) <> nops(vars) then ERROR(_mismatched_vectors) fi; # # Check for a differential element. if type(f,list) then map(check_D, f, vars) else check_D(f,vars) fi; # # Assign the integration variable, $t$ and substitute the parameterized # path equations into $f$. t := lhs(op(2,path)); f := subs(zip((x,y)->(x=y),vars,patheqs),f); # # Substitute the "diff" function for D. f := eval(subs('D'=unapply('diff'(x,t),x),f)); # # Integrate the field equations over the range. # If "f" is a list, then integrate each item separately. if type(f,list) then map(int,f,op(2,path)) else int(f,op(2,path)) fi # # If the path is a line segment, \marginpar{Line segment} # parameterize it and pass it to "pathint". # Check whether an optional third argument was passed, if so, use it for # the integration variable, otherwise use a local variable. elif type(path, list..list) then if nops(op(1,path)) <> nops(op(2,path)) then ERROR(_mismatched_vectors) fi; if nargs > 2 then t := tt fi; ft := subs('_t'=t,(x1,x2)->x1+(x2-x1)*_t); path := [zip(ft,op(1,path),op(2,path)),t=0..1]; procname(f, vars = path) # # If the path is multi-segmented, \marginpar{Connected segments} # convert each segment to a single segment, # pass it to "pathint", and sum the results. elif type(path, list(list)) then add(procname(f,vars=path[p]..path[p+1]),p=1..nops(path)-1) # # If the path is disjoint, \marginpar{Disjoint path} # pass each to "pathint" and sum the results. elif type(path, set) then add(procname(f,vars=p), p=path) else ERROR(_invalid_path) fi end: # \end{Proc} # #%----------------------------------------------------------------------- # \begin{Proc}{check_D} # Verify that $f$ has a valid differential element. An error occurs # if $f$ does not contain at least one expression $D(x)$, where $x$ is # a component of the integration vector, "vars". # # \change{v4.02a}{96/11/24}{Removed RETURN statements} check_D := proc(f,vars::list) local d,x; if indets(f,identical('D')) <> {} then ERROR(_illegal_use_of_D) fi; d := indets(f,specfunc(anything,'D')); x := map(op,d); if d = {} or x intersect {op(vars)} <> x then ERROR(_no_differential) fi; NULL end: # \end{Proc} # # #%-------------------------------------------------------------------------- # \begin{Proc}{Pathint} # Inert version of "pathint". # Set up the integral, but do not evaluate it. Pathint := subs('int'='Int', eval(pathint)): # \end{Proc} # # #%-------------------------------------------------------------------------- # \begin{Proc}{type/simple} # A simple type is a name that is not a structure. `type/simple` := proc(x) type(x,name) and evalb(x = eval(x)) end: # \end{Proc} # # #%-------------------------------------------------------------------------- # \begin{Proc}{mag} # Compute the magnitude of a vector or list. # Assume that the components are real values. mag := proc(v::{list,vector}) sqrt(dot(v,v)) end: # \end{Proc} # #%--------------------------------------------------------------------------- # \begin{Proc}{dot} # Compute the dot product of two vectors or lists. # Use "dotprod" procedure from the "linalg" package. # \change{v4.02a}{96/11/24}{Redefined dotprod to load the code from linalg.} # \change{v4.03a}{96/11/26}{Changed dotprod to dot; redefined.} dot := proc(u,v) linalg[dotprod](u,v,'orthogonal') end: # \end{Proc} # # #%========================================================================= # \section{Test Procedures} # # Define routines to verify the operation of these procedures. # A reasonably complete suite of tests is particularly useful # when these procedures need to be modified or # updated to accomodate a different system or a new version of Maple. # # \begin{Proc}{verify} # Call each of the tests. verify := proc() Test_dot(); Test_mag(); Test_simple(); Test_integrand(); Test_D(); Test_path(); Test_option(); Test_syntax(); Test_inert(); print(`Passed all tests`); NULL end: # \end{Proc} # # # # \begin{Proc}{Test} # Test a procedure. The first parameter, "testproc", is the procedure # that is being tested. The second parameter is an equation, # the left side is a list of the arguments to "testproc", # the right side is the expected result. The arguments are passed # to "testproc", if the result differs from the expected, an error # occurs and the discrepancy is printed. Test := proc(testproc, test::equation) ''testproc''(op(lhs(test))) <> rhs(test); if eval(") then ERROR(") fi; NULL end: # \end{Proc} # # \begin{Proc}{Test_integrand} # Verify that "pathint" accepts integrands that are expressions, # lists, vectors, and linear combinations of lists and vectors. Test_integrand := proc() local a,b,x,y,p; p := [x,y]: Test(pathint, [x*D(x), [x,y]=[0,0]..[a,b]] = a^2/2); Test(pathint, [dot([y,x],D(p)), p=[0,0]..[a,b]] = a*b); Test(pathint, [vector([y*D(x),x*D(y)]), p=[0,0]..[a,b]] = [b*a/2,b*a/2]); Test(pathint, [vector([y*D(x),x*D(y)])+[x^2*D(x),x*y*D(y)], [x,y]=[0,0]..[a,b]] = [1/2*b*a+1/3*a^3, 1/2*b*a+1/3*a*b^2]) end: # \end{Proc} # # \begin{Proc}{Test_D} # Verify that the D operator in the integrand refers to a derivative # of the path. Test_D := proc() local a,x,y,t; Test(Pathint,[mag(D([x,y])),[x,y] = [[t,t^2], t=0..a]] = Int(sqrt(1+4*t^2),t=0..a)) end: # \end{Proc} # # # \begin{Proc}{Test_path} # Verify that each type of path works properly. Test_path := proc() local x,t; Test(pathint, [x*D(x), [x]=[[t],t=0..1]] = 1/2); Test(pathint, [x*D(x), [x]=[0]..[1]] = 1/2); Test(pathint, [x*D(x), [x]=[[0],[1]]] = 1/2); Test(pathint, [x*D(x), [x]={[0]..[1],{[[t],t=0..1]}}] = 1) end: # \end{Proc} # # \begin{Proc}{Test_option} # Verify the the optional parameter to "pathint" works properly. Test_option := proc() local q, x; Test(Pathint, [x*D(x), [x]=[0]..[1], q] = Int(q,q=0..1)) end: # \end{Proc} # # # \begin{Proc}{Test_syntax} # Verify that the syntax checking is working. # \change{v4.02a}{96/11/24}{Added check for _no_differential.} Test_syntax := proc() local x,t,trap; trap := proc() traperror(pathint(args)) end; Test(trap, [x, [3]=[0]..[1]] = _illegal_int_vector); Test(trap, [x, [D]=[0]..[1]] = _illegal_int_vector); Test(trap, [x, [x,x]=[0,0]..[1,1]] = _illegal_int_vector); Test(trap, [D, [x]=[0]..[1]] = _illegal_use_of_D); Test(trap, [x, [x]=[0]..[1]] = _no_differential); Test(trap, [x, [x]=[[t,t^2],t=0..1]] = _mismatched_vectors); Test(trap, [x, [x]=[0]..[1,2]] = _mismatched_vectors); Test(trap, [x, [x]=[[0],[1,2]]] = _mismatched_vectors); Test(trap, [x, [x]=t] = _invalid_path); end: # \end{Proc} # # \begin{Proc}{Test_inert} # Verify "Pathint". This is currently identical to "Test_option". Test_inert := proc() local x,q; Test(Pathint, [x*D(x), [x]=[0]..[1], q] = Int(q,q=0..1)) end: # \end{Proc} # # \begin{Proc}{Test_simple} # Verify "type/simple". Test_simple := proc() local a,v; v := vector([a]): Test(`type/simple`, [a] = true); Test(`type/simple`, [v] = false); v := proc() end: Test(`type/simple`, [v] = false) end: # \end{Proc} # # # \begin{Proc}{Test_mag} # Verify that "mag" works with both lists and vectors as arguments. Test_mag := proc() local a,b; Test(mag, [[a,b,1]] = sqrt(a^2+b^2+1)); Test(mag, [vector([a,b,1])] = sqrt(a^2+b^2+1)); end: # \end{Proc} # # \begin{Proc}{Test_dot} # Verify that "dot" works with both lists and vectors as arguments. Test_dot := proc() local a,b,c; Test(dot, [[a,b],[a,b]] = a^2+b^2); Test(dot, [[a,b]/c,vector([a,b])] = a^2/c+b^2/c) end: # \end{Proc} # # # # #%========================================================================= # \section{Installation} # # Reading this file into Maple loads the code and pops up a help # window that explains how to install it to a library. # # \begin{Proc}{installto} # Write the procedures that make up this package # to the file "pathint.m" in the directory given by the argument. # \change{v4.02a}{96/11/24}{Added dotprod and check_D, removed innerprod.} # \change{v4.03a}{96/11/26}{Removed dotprod, added dot.} installto := proc(dir::name) save pathint,Pathint, mag,dot, check_D,`type/simple`, ``.dir.`/pathint.m`; print(INTERFACE_HELP('insert', 'topic'=pathint, 'helpfile'=dir, 'text'=`help/pathint/text`)) end: # \end{Proc} # # \begin{Global}{greetings} # Assign a text structure that will be displayed when this file is # read into Maple. greetings := TEXT( # \comment{The text is hidden until I write a \LaTeX\ environment that # formats this nicely.} # \iffalse `{VERSION 2 3 "IBM INTEL NT" "2.3" }`, `{USTYLETAB {CSTYLE "Maple Input" -1 0 "Times" 0 0 0 0 255 1 0 0 0 0 1 `, `0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 0 128 0 0 1 0 0 2 0 0 0 0 0 `, `0 }{CSTYLE "Hyperlink" -1 17 "" 0 0 0 0 255 1 0 0 1 0 0 0 0 0 0 }`, `{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "2`, `D Output" 2 20 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "Help Heading`, `" -1 26 "" 1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "system" -1 256 "MS`, ` Sans Serif" 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "menu" -1 257 "MS \\+`, `Sans Serif" 1 10 0 0 22 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "Courie`, `r" 1 10 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "Courier" 1 10 0 `, `0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "Courier" 1 10 0 0 0 0 0 0 `, `0 0 0 0 0 0 0 }{CSTYLE "" -1 262 "Courier" 1 10 0 0 0 0 0 0 0 0 0 0 0 `, `0 0 }{CSTYLE "" -1 263 "Courier" 1 10 0 0 0 0 0 0 0 0 0 0 0 0 0 }`, `{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 0 0 0 0 1 0 0 0 0 0 0 0 `, `0 0 }0 0 0 -1 6 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 `, `{CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 6 6 0 0 0 `, `0 0 0 -1 0 }{PSTYLE "Maple Output" 0 11 1 {CSTYLE "" -1 -1 "" 0 0 0 0 `, `255 1 0 0 0 0 0 0 0 0 0 }3 3 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Bul`, `let Item" 0 15 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 `, `0 0 -1 3 3 0 0 0 0 0 0 15 2 }{PSTYLE "Title" 0 18 1 {CSTYLE "" -1 -1 "`, `" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }`, `{PSTYLE "Author" 0 19 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 `, `0 0 }3 0 0 -1 8 8 0 0 0 0 0 0 0 0 }{PSTYLE "R3 Font 0" -1 256 1 `, `{CSTYLE "" -1 -1 "Courier" 0 10 255 255 255 1 2 2 2 0 0 0 0 0 0 }0 0 `, `0 -1 -1 -1 0 0 0 0 0 0 0 0 }{PSTYLE "R3 Font 2" -1 257 1 {CSTYLE "" `, `-1 -1 "Courier" 0 11 255 255 0 1 2 2 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 `, `0 0 0 0 0 0 0 }{PSTYLE "Maple Code" -1 258 1 {CSTYLE "" -1 -1 "Courier`, `" 1 10 0 0 255 1 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }`, `{PSTYLE "pseudocode" -1 259 1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 212 `, `0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 259 0 }{PSTYLE "abstra`, `ct" -1 260 1 {CSTYLE "" -1 -1 "" 0 0 225 0 0 0 1 0 0 0 0 0 0 0 0 }0 0 `, `0 -1 -1 -1 3 40 3 40 0 0 -1 0 }{PSTYLE "" 15 261 1 {CSTYLE "" -1 -1 "`, `" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 0 -1 0 0 0 0 0 0 -1 0 }`, `{PSTYLE "" 15 262 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 `, `}0 0 0 -1 0 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 15 263 1 {CSTYLE "" -1 -1 `, `"" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 0 -1 0 0 0 0 0 0 -1 0 }`, `{PSTYLE "" 15 264 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 `, `}0 0 0 -1 0 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "" 15 265 1 {CSTYLE "" -1 -1 `, `"" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 0 -1 0 0 0 0 0 0 -1 0 }}`, `{SECT 0 {PARA 18 "" 0 "" {TEXT -1 23 "Path Integrals in Maple" }}`, `{PARA 19 "" 0 "" {TEXT -1 8 "Joe Riel" }}{PARA 19 "" 0 "" {TEXT -1 28 `, `"jsr@sparc.sandiegoca.ncr.com" }}{SECT 0 {PARA 3 "" 0 "" {TEXT 26 8 "C`, `ontents" }}{PARA 261 "" 0 "" {TEXT 259 13 "pathint " }{TEXT -1 `, `24 "Evaluates path integrals" }}{PARA 262 "" 0 "" {TEXT 260 13 "Pathin`, `t " }{TEXT -1 27 "An inert version of pathint" }}{PARA 263 "" 0 "`, `" {TEXT 261 13 "mag " }{TEXT -1 44 "Computes the magnitude of`, ` a vector (or list)" }}{PARA 264 "" 0 "" {TEXT 262 13 "dot " `, `}{TEXT -1 32 "Computes the dot product, calls " }{HYPERLNK 17 "linalg[`, `dotprod]" 2 "linalg[dotprod]" "" }}{PARA 265 "" 0 "" {TEXT 263 13 "typ`, `e/simple " }{TEXT -1 39 "A name that is not a procedure or array" }}}`, `{SECT 0 {PARA 3 "" 0 "" {TEXT 26 12 "Verification" }}{PARA 0 "" 0 "" `, `{TEXT -1 53 "To verify that this package runs on your system, type" }}`, `{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 9 "verify();" }}{PARA 11 "" 1 "`, `" {XPPMATH 20 "6#%1Passed~all~testsG" }}}{PARA 0 "" 0 "" {TEXT -1 32 "`, `You should get the result shown." }}}{SECT 0 {PARA 3 "" 0 "" {TEXT 26 `, `12 "Installation" }}{PARA 0 "" 0 "" {TEXT -1 48 "To install this packa`, `ge to a Maple library, type" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 15 "inst`, `allto(dir);" }}{PARA 0 "" 0 "" {TEXT -1 6 "where " }{XPPEDIT 18 0 "dir`, `" "I$dirG6\\"" }{TEXT -1 38 " is the directory of the library. If " }`, `{XPPEDIT 18 0 "dir" "I$dirG6\\"" }{TEXT -1 20 " is included in the " }`, `{HYPERLNK 17 "libname" 2 "libname" "" }{TEXT -1 91 " path, then, follo`, `wing installation, this package can be loaded into Maple with the comm`, `and" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "readlib(pathint):" }}`, `}}{SECT 0 {PARA 3 "" 0 "" {TEXT 26 4 "Help" }}{PARA 0 "" 0 "" {TEXT `, `-1 86 "If you chose not to install this package to a library, then you`, ` can get help by typing" }}{PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "help(pat`, `hint)" }}{PARA 0 "" 0 "" {TEXT -1 50 "If you did install the package, \\+`, `and the directory " }{XPPEDIT 18 0 "dir" "I$dirG6\\"" }{TEXT -1 20 " is`, ` included in the " }{HYPERLNK 17 "libname" 2 "libname" "" }{TEXT -1 `, `59 " path, then help should be available at any time by typing " }`, `{XPPEDIT 18 0 "``?pathint``" "I)?pathintG6\\"" }{TEXT -1 22 ". Click here`, ` to test, " }{HYPERLNK 17 "pathint" 2 "pathint" "" }{TEXT -1 2 ". " }}`, `}{SECT 0 {PARA 3 "" 0 "" {TEXT 26 13 "Documentation" }}{PARA 0 "" 0 "`, `" {TEXT -1 529 "The source and documentation for this package have bee`, `n integrated into a single document by the use of mapledoc, a LaTeX ma`, `cro package based on doc. To generate the documentation run the file \\+`, `pathint.mtx through LaTeX. Makeindex can be used to generate an index`, ` of the procedures and global variables. You will need the LaTeX styl`, `e files mapledoc.sty, mtxind.ist, and mtxglo.ist. They are generated \\+`, `from the dtx file mapledoc.dtx, available from me, the author. A post`, `script version of the typeset output is also available." }}}}{MARK "6 \\+`, `3 4" 49 }{VIEWOPTS 1 1 0 1 1 1803 }` # \fi ): # \end{Global} # # Display the greeting. INTERFACE_HELP('display', 'topic'=`pathint, version `.coderev, 'text'= greetings); # \section{Help Page} # # \begin{Global}{help/pathint} # Define the help page for this package. `help/pathint/text` := TEXT( # \comment{The text is hidden until I write a \LaTeX\ environment that # formats this nicely.} # \iffalse `{VERSION 2 3 "IBM INTEL NT" "2.3" }`, `{USTYLETAB {CSTYLE "Maple Input" -1 0 "Times" 0 0 0 0 255 1 0 0 0 0 1 `, `0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 0 128 0 0 1 0 0 2 0 0 0 0 0 `, `0 }{CSTYLE "Hyperlink" -1 17 "" 0 0 0 0 255 1 0 0 1 0 0 0 0 0 0 }`, `{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "2`, `D Output" 2 20 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 23 "Cou`, `rier" 1 10 0 0 0 0 0 0 0 0 0 0 3 0 0 }{CSTYLE "Help Heading" -1 26 "" `, `1 14 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "system" -1 256 "MS Sans Serif`, `" 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "menu" -1 257 "MS Sans Serif`, `" 1 10 0 0 22 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "Courier" 1 10 0 `, `0 0 0 0 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "Courier" 1 10 0 0 0 0 0 0 `, `0 0 0 0 0 0 0 }{CSTYLE "" -1 260 "Courier" 1 10 0 0 0 0 0 0 0 0 0 0 0 `, `0 0 }{CSTYLE "" -1 261 "Courier" 1 10 0 0 0 0 0 0 0 0 0 0 0 0 0 }`, `{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 0 0 0 0 1 0 0 0 0 0 0 0 `, `0 0 }0 0 0 -1 6 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 `, `{CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 6 6 0 0 0 `, `0 0 0 -1 0 }{PSTYLE "Heading 2" 3 4 1 {CSTYLE "" -1 -1 "" 1 14 0 0 0 `, `0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 4 4 0 0 0 0 0 0 -1 0 }{PSTYLE "Maple Out`, `put" 0 11 1 {CSTYLE "" -1 -1 "" 0 0 0 0 255 1 0 0 0 0 0 0 0 0 0 }3 3 `, `0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Bullet Item" 0 15 1 {CSTYLE "" `, `-1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 3 3 0 0 0 0 0 0 15 2 `, `}{PSTYLE "R3 Font 0" -1 256 1 {CSTYLE "" -1 -1 "Courier" 0 10 255 255 `, `255 1 2 2 2 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 }{PSTYLE "R3 F`, `ont 2" -1 257 1 {CSTYLE "" -1 -1 "Courier" 0 11 255 255 0 1 2 2 2 0 0 `, `0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 0 0 }{PSTYLE "Maple Code" -1 258 `, `1 {CSTYLE "" -1 -1 "Courier" 1 10 0 0 255 1 0 0 0 0 0 0 0 0 0 }0 0 0 `, `-1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "pseudocode" -1 259 1 {CSTYLE "" `, `-1 -1 "Courier" 1 10 0 0 212 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 `, `0 0 0 0 259 0 }{PSTYLE "abstract" -1 260 1 {CSTYLE "" -1 -1 "" 0 0 `, `225 0 0 0 1 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 3 40 3 40 0 0 -1 0 }`, `{PSTYLE "" 0 261 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }`, `0 0 0 -1 0 -1 0 0 0 0 0 0 -1 0 }}`, `{SECT 0 {SECT 0 {PARA 0 "" 0 "" {TEXT 26 10 "Function: " }{TEXT -1 45 `, `"pathint or Pathint - Integration along a path" }}{PARA 0 "" 0 "usage`, `" {TEXT 26 18 "Calling Sequences:" }{TEXT -1 98 "\\n pathint(f, v=p) \\+`, ` Pathint(f, v=p)\\n pathint(f, v=p,t) Pathint(`, `f, v=p,t)" }}{PARA 0 "" 0 "" {TEXT 26 11 "Parameters:" }{TEXT -1 1 "\\n`, `" }{TEXT 258 1 " " }{TEXT 23 7 "f - " }{TEXT -1 60 "an algebraic ex`, `pression, a list, or a vector, the integrand\\n" }{TEXT 259 2 " v" }`, `{TEXT 23 6 " - " }{TEXT -1 40 "a list of names, the integration vec`, `tor\\n" }{TEXT 260 1 " " }{TEXT 23 7 "p - " }{TEXT -1 46 "the path a`, `long which the integral is evaluated" }}{PARA 261 "" 0 "" {TEXT 261 2 `, `" t" }{TEXT 23 6 " - " }{TEXT -1 37 "(optional) name, integration v`, `ariable" }}}{SECT 0 {PARA 0 "" 0 "synopsis" {TEXT 26 12 "Description:`, `" }}{PARA 0 "" 0 "" {TEXT -1 13 "The function " }{XPPEDIT 18 0 "pathin`, `t" "I(pathintG6\\"" }{TEXT -1 42 " integrates an expression along a pat`, `h in " }{XPPEDIT 18 0 "R^n" ")%\\"RG%\\"nG" }{TEXT -1 2 ". " }}{SECT 0 `, `{PARA 4 "" 0 "" {TEXT -1 10 "Integrand:" }}{PARA 15 "" 0 "" {TEXT -1 `, `15 "The integrand, " }{XPPEDIT 18 0 "f" "I\\"fG6\\"" }{TEXT -1 64 ", may`, ` be a scalar, a vector, or a linear combination of vectors." }}{PARA `, `15 "" 0 "" {TEXT -1 64 "A vector is represented as a list of expressio`, `ns, or as a Maple " }{HYPERLNK 17 "vector" 2 "vector" "" }{TEXT -1 1 "`, `." }}{PARA 15 "" 0 "" {TEXT -1 87 "The integrand must contain a differ`, `ential element. A differential element has the form " }{XPPEDIT 18 0 "`, `D(x)" "-%\\"DG6#%\\"xG" }{TEXT -1 8 ", where " }{HYPERLNK 17 "D" 2 "D" "`, `" }{TEXT -1 40 " is the Maple differential operator and " }{XPPEDIT `, `18 0 "x" "I\\"xG6\\"" }{TEXT -1 43 " is a component of the integration v`, `ector, " }{XPPEDIT 18 0 "v" "I\\"vG6\\"" }{TEXT -1 1 "." }}}{SECT 0 `, `{PARA 4 "" 0 "" {TEXT -1 5 "Path:" }}{PARA 0 "" 0 "" {TEXT -1 91 "The \\+`, `second argument specifies the integration vector and the path. The int`, `egration vector, " }{XPPEDIT 18 0 "v" "I\\"vG6\\"" }{TEXT -1 56 ", is a \\+`, `list of distinct names, each name is a component " }{XPPEDIT 18 0 "R^n`, `" ")%\\"RG%\\"nG" }{TEXT -1 12 ". The path, " }{XPPEDIT 18 0 "p" "I\\"pG6`, `\\"" }{TEXT -1 40 ", may be represented in several formats:" }}{PARA `, `15 "" 0 "" {TEXT -1 201 "A parameterized path is specified by a list o`, `f two items. The first item is a list of real expressions of a paramet`, `er. The second item is an equation that specifies the parameter and a \\+`, `range of values." }}{PARA 15 "" 0 "" {TEXT -1 164 "A line segment path`, ` is specified by a range of two points, each point is a list of values`, `. The orientation of the segment is from the left point to the right p`, `oint." }}{PARA 15 "" 0 "" {TEXT -1 222 "A multi-segmented path is spec`, `ified as a list of points, each point is a list of values. The orienta`, `tion of the sement is from the first point to the last point. Each seg`, `ment is evaluated separately, the results are added." }}{PARA 15 "" 0 `, `"" {TEXT -1 105 "A disjoint path is specified as a set of paths. Each \\+`, `path is evaluated separately, the results are added." }}}{SECT 0 `, `{PARA 4 "" 0 "" {TEXT -1 19 "Optional Parameter:" }}{PARA 0 "" 0 "" `, `{TEXT -1 29 "An optional third parameter, " }{XPPEDIT 18 0 "t" "I\\"tG6`, `\\"" }{TEXT -1 87 ", may be supplied. It is used as the integration var`, `iable when a path is parameterized." }}}{SECT 0 {PARA 4 "" 0 "" {TEXT `, `-1 9 "Defining:" }}{PARA 0 "" 0 "" {TEXT -1 28 "This function is defin`, `ed by " }{XPPEDIT 18 0 "readlib(pathint)" "-%(readlibG6#%(pathintG" }`, `{TEXT -1 0 "" }{TEXT -1 43 ". Also defined are the following functions`, `:" }}{PARA 15 "" 0 "" {TEXT -1 13 "The function " }{XPPEDIT 18 0 "Path`, `int" "I(PathintG6\\"" }{TEXT -1 24 " is an inert version of " }`, `{XPPEDIT 18 0 "pathint" "I(pathintG6\\"" }{TEXT -1 57 ". The only diffe`, `rence is that it passes the integrand to " }{HYPERLNK 17 "Int" 2 "Int`, `" "" }{TEXT -1 13 " rather than " }{HYPERLNK 17 "int" 2 "int" "" }`, `{TEXT -1 1 "." }}{PARA 15 "" 0 "" {TEXT -1 13 "The function " }`, `{XPPEDIT 18 0 "mag" "I$magG6\\"" }{TEXT -1 84 " returns the magnitude o`, `f a list or vector. It assumes that the components are real." }}{PARA `, `15 "" 0 "" {TEXT -1 13 "The function " }{XPPEDIT 18 0 "dot" "I$dotG6\\"`, `" }{TEXT -1 51 " returns the dot product of two vectors (or lists)." }`, `}}}{SECT 0 {PARA 0 "" 0 "examples" {TEXT 26 9 "Examples:" }}{EXCHG `, `{PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "readlib(pathint):" }}}{SECT 0 `, `{PARA 4 "" 0 "" {TEXT -1 6 "1-form" }}{PARA 0 "" 0 "" {TEXT -1 12 "A 1`, `-form in " }{XPPEDIT 18 0 "R^2" "*$%\\"RG\\"\\"#" }{TEXT -1 14 " has the \\+` ,`form " }{XPPEDIT 18 0 "Fx*dx+Fy*dy" ",&*&%#FxG\\"\\"\\"%#dxGF%F%*&%#FyGF%`, `%#dyGF%F%" }{TEXT -1 46 ". The following example evaluates the 1-form`, ` " }{XPPEDIT 18 0 "omega" "I&omegaG6\\"" }{TEXT -1 17 " on the the path`, ` " }{XPPEDIT 18 0 "Gamma" "I&GammaG6\\"" }{TEXT -1 56 ", which is a str`, `aight line from the origin to the point " }{XPPEDIT 18 0 "[a,b]" "7$%`, `\\"aG%\\"bG" }{TEXT -1 3 ". " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 `, `27 "omega := x^2*D(x)+y^2*D(y);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%&`, `omegaG,&*&%\\"xG\\"\\"#-%\\"DG6#F'\\"\\"\\"F,*&%\\"yGF(-F*6#F.F,F," }}}{EXCHG\ `,`{PARA 0 "> " 0 "" {MPLTEXT 1 0 24 "Gamma := [0,0] .. [a,b]:" }}}`, `{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "pathint(omega, [x,y]=Gamma);`, `" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&*$%\\"aG\\"\\"$#\\"\\"\\"F&*$%\\"bGF&F'\ `,`" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 13 "Line integral" }}{PARA 0 "`, `" 0 "" {TEXT -1 32 "The integral of a vector field, " }{XPPEDIT 18 0 "`, `F" "I\\"FG6\\"" }{TEXT -1 111 ", on a path is equivalent to the evaluati`, `on of a 1-form on that path. It is frequently convenient to represent \\+`, `" }{XPPEDIT 18 0 "F" "I\\"FG6\\"" }{TEXT -1 53 " as a vector rather than`, ` a 1-form. The integrand to " }{XPPEDIT 18 0 "pathint" "I(pathintG6\\"`, `" }{TEXT -1 53 " is then formed by taking the dot (inner) product of \\+`, `" }{XPPEDIT 18 0 "F" "I\\"FG6\\"" }{TEXT -1 63 " and the differerential \\+`, `of the integration vector. You may use " }{XPPEDIT 18 0 "dot" "I$dotG6`, `\\"" }{TEXT -1 194 ", which is defined by this package, to form the dot`, ` product. The following example computes the voltage difference betwee`, `n two points in an electric field formed by a point charge at the orig`, `in." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 13 "p := [x,y,z]:" }}}`, `{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "E := Q/4/Pi/epsilon*p/mag(p)`, `^3;" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#>%\\"EG,$*,%\\"QG\\"\\"\\"%#PiG!\\"\\"\ `,`%(epsilonGF*7%%\\"xG%\\"yG%\\"zGF(,(*$F-\\"\\"#F(*$F.F2F(*$F/F2F(#!\\"$F2#F\ (`,`\\"\\"%" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 78 "path := [r1,0,0]..`, `[r2*cos(theta),r2*sin(theta),0]: assume(r1>0): assume(r2>0):" }}}`, `{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "pathint(dot(E,D(p)), p = pat`, `h);" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,&**%\\"QG\\"\\"\\"%(epsilonG!\\"\\"%` ,`#PiGF(,&*&%$r2|irG\\"\\"#-%$cosG6#%&thetaGF-F&*&F,F--%$sinGF0F-F&#F(F-#F`, `(\\"\\"%**%$r1|irGF(F%F&F)F(F'F(#F&F7" }}}{EXCHG {PARA 0 "> " 0 "" `, `{MPLTEXT 1 0 12 "simplify(\\");" }}{PARA 11 "" 1 "" {XPPMATH 20 "6#,$*.`, `%\\"QG\\"\\"\\",&%$r1|irG!\\"\\"%$r2|irGF&F&%(epsilonGF)%#PiGF)F*F)F(F)#F&\\"\ `,`\\"%" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 10 "Arc length" }}{PARA 0 "`, `" 0 "" {TEXT -1 176 "Not all path integrals are equivalent to 1-forms.`, ` The length of a path in space, for example, cannot be expressed as a \\+`, `1-form. It possible, however, to compute the length with " }{XPPEDIT `, `18 0 "pathint" "I(pathintG6\\"" }{TEXT -1 41 ". Here the length of a he`, `lix is computed." }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 54 "path := \\+`, `[[r*cos(phi), r*sin(phi),k*phi], phi=0..4*Pi]:" }}}{EXCHG {PARA 0 "> \\+`, `" 0 "" {MPLTEXT 1 0 29 "pathint(mag(D(p)), p = path);" }}{PARA 11 "" `, `1 "" {XPPMATH 20 "6#,$*&%#PiG\\"\\"\\",&*$%\\"rG\\"\\"#F&*$%\\"kGF*F&#F&F*\\"\ `,`\\"%" }}}}{SECT 0 {PARA 4 "" 0 "" {TEXT -1 22 "Vector valued integral" `, `}}{PARA 0 "" 0 "" {TEXT -1 17 "The integrand to " }{XPPEDIT 18 0 "path`, `int" "I(pathintG6\\"" }{TEXT -1 213 " may be a vector, that is, a vecto`, `r of 1-forms. Such an integral arises, for example, in the computation`, ` of the magnetic field generated by a current loop. Let there be a squ`, `are loop of wire, with sides of length " }{XPPEDIT 18 0 "s" "I\\"sG6\\"`, `" }{TEXT -1 60 ", lying in the xy plane with its axis the z-axis. A cu`, `rrent " }{XPPEDIT 18 0 "I" "I\\"IG6\\"" }{TEXT -1 63 " flows on the wire`, `. Determine the magnetic field on the z-axis." }}{EXCHG {PARA 0 "> " `, `0 "" {MPLTEXT 1 0 66 "loop := expand([[1,1,0],[-1,1,0],[-1,-1,0],[1,-1`, `,0],[1,1,0]]*s/2):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 17 "pl :=`, ` [xl,yl,zl]:" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 11 "alias(I=I):`, `" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 10 "R := p-pl:" }}}{EXCHG `, `{PARA 0 "> " 0 "" {MPLTEXT 1 0 72 "dHaxis := subs(x=0, y=0, mu/4/Pi*I*`, `linalg[crossprod](D(pl),R)/mag(R)^3):" }}}{EXCHG {PARA 0 "> " 0 "" `, `{MPLTEXT 1 0 36 "Haxis := pathint(dHaxis, pl = loop);" }}{PARA 11 "" `, `1 "" {XPPMATH 20 "6#>%&HaxisG7%\\"\\"!F&,$*.%\\"sG\\"\\"#%#muG\\"\\"\\"%\\"IG\ F,`,`,&*$F)F*F**$%\\"zGF*\\"\\"%#!\\"\\"F*,&F/F,F0F2F4%#PiGF4F2" }}}}}}{MARK "\ 1 \\+`,`5 4 2" 51 }{VIEWOPTS 1 1 0 1 1 1803 }` # \fi ): # \end{Global} # # \begin{Proc}{help(pathint)} # Provide a means to display the help page without installing the package. help(pathint) := INTERFACE_HELP('display', 'topic'=pathint, 'text'=`help/pathint/text`): # \end{Proc} # # \end{maplesource} # # \begin{thebibliography}{1} # \let\author=\textsc # \let\book=\emph # \MakeParameter\$ # \def\article$1{``$1''} # # \bibitem{} # \author{S.\@ Ramo, J.R.\@ Whinnery, and T.\@ Van Duzer}, # \book{Fields and Waves in Communication Electronics}, # John Wiley \& Sons, New York, 1984. # # \bibitem{} # \author{R.E.\@ Williamson, R.H.\@ Crowell, and H.F.\@ Trotter}, # \book{Calculus of Vector Functions}, # Prentice-Hall, New Jersey, 1972. # # \bibitem{} # \author{William Hayt}, # \book{Engineering Electromagnetics}, # McGraw-Hill, New York, 1974. # # \end{thebibliography} # # \PrintIndex # \end{document}