Sage 9.2 Reference Manual: Euclidean Spaces And Vector .

3y ago
37 Views
2 Downloads
283.78 KB
38 Pages
Last View : 2d ago
Last Download : 3m ago
Upload by : Adele Mcdaniel
Transcription

Sage 9.2 Reference Manual: EuclideanSpaces and Vector CalculusRelease 9.2The Sage Development TeamOct 25, 2020

CONTENTS1Euclidean Spaces2Operators for vector calculus127Python Module Index31Index33i

ii

CHAPTERONEEUCLIDEAN SPACESAn Euclidean space of dimension š‘› is an affine space šø, whose associated vector space is a š‘›-dimensional vectorspace over R and is equipped with a positive definite symmetric bilinear form, called the scalar product or dot product[Ber1987]. An Euclidean space of dimension š‘› can also be viewed as a Riemannian manifold that is diffeomorphic toRš‘› and that has a flat metric š‘”. The Euclidean scalar product is then that defined by the Riemannian metric š‘”.The current implementation of Euclidean spaces is based on the second point of view. This allows for the introductionof various coordinate systems in addition to the usual the Cartesian systems. Standard curvilinear systems (planar,spherical and cylindrical coordinates) are predefined for 2-dimensional and 3-dimensional Euclidean spaces, alongwith the corresponding transition maps between them. Another benefit of such an implementation is the direct useof methods for vector calculus already implemented at the level of Riemannian manifolds (see, e.g., the methodscross product() and curl(), as well as the module operators).Euclidean spaces are implemented via the following classes: EuclideanSpace for generic values š‘›, EuclideanPlane for š‘› 2, Euclidean3dimSpace for š‘› 3.The user interface is provided by EuclideanSpace.Example 1: the Euclidean planeWe start by declaring the Euclidean plane E, with (x, y) as Cartesian coordinates:sage: E. x,y EuclideanSpace()sage: EEuclidean plane E 2sage: dim(E)2E is automatically endowed with the chart of Cartesian coordinates:sage: E.atlas()[Chart (E 2, (x, y))]sage: cartesian E.default chart(); cartesianChart (E 2, (x, y))Thanks to the use of x,y when declaring E, the coordinates (š‘„, š‘¦) have been injected in the global namespace, i.e.the Python variables x and y have been created and are available to form symbolic expressions:1

Sage 9.2 Reference Manual: Euclidean Spaces and Vector Calculus, Release 9.2sage:ysage: typesage:[x isytype(y)'sage.symbolic.expression.Expression' assumptions()real, y is real]The metric tensor of E is predefined:sage: g E.metric(); gRiemannian metric g on the Euclidean plane E 2sage: g.display()g dx*dx dy*dysage: g[:][1 0][0 1]It is a flat metric, i.e. it has a vanishing Riemann tensor:sage: g.riemann()Tensor field Riem(g) of type (1,3) on the Euclidean plane E 2sage: g.riemann().display()Riem(g) 0Polar coordinates (š‘Ÿ, šœ‘) are introduced by:sage: polar. r,ph E.polar coordinates()sage: polarChart (E 2, (r, ph))E is now endowed with two coordinate charts:sage: E.atlas()[Chart (E 2, (x, y)), Chart (E 2, (r, ph))]The ranges of the coordinates introduced so far are:sage: cartesian.coord range()x: (-oo, oo); y: (-oo, oo)sage: polar.coord range()r: (0, oo); ph: [0, 2*pi] (periodic)The transition map from polar coordinates to Cartesian ones is:sage: E.coord change(polar, cartesian).display()x r*cos(ph)y r*sin(ph)while the reverse one is:sage: E.coord change(cartesian, polar).display()r sqrt(x 2 y 2)ph arctan2(y, x)A point of E is constructed from its coordinates (by default in the Cartesian chart):2Chapter 1. Euclidean Spaces

Sage 9.2 Reference Manual: Euclidean Spaces and Vector Calculus, Release 9.2sage: p E((-1,1), name 'p'); pPoint p on the Euclidean plane E 2sage: p.parent()Euclidean plane E 2The coordinates of a point are obtained by letting the corresponding chart act on it:sage: cartesian(p)(-1, 1)sage: polar(p)(sqrt(2), 3/4*pi)At this stage, E is endowed with three vector frames:sage: E.frames()[Coordinate frame (E 2, (e x,e y)),Coordinate frame (E 2, (d/dr,d/dph)),Vector frame (E 2, (e r,e ph))]The third one is the standard orthonormal frame associated with polar coordinates, as we can check from the metriccomponents in it:sage: polar frame E.polar frame(); polar frameVector frame (E 2, (e r,e ph))sage: g[polar frame,:][1 0][0 1]The expression of the metric tensor in terms of polar coordinates is:sage: g.display(polar)g dr*dr r 2 dph*dphA vector field on E:sage: v E.vector field(-y, x, name 'v'); vVector field v on the Euclidean plane E 2sage: v.display()v -y e x x e ysage: v[:][-y, x]By default, the components of v, as returned by display or the bracket operator, refer to the Cartesian frame on E;to get the components with respect to the orthonormal polar frame, one has to specify it explicitly, generally alongwith the polar chart for the coordinate expression of the components:sage: v.display(polar frame, polar)v r e phsage: v[polar frame,:,polar][0, r]Note that the default frame for the display of vector fields can be changed thanks to the methodset default frame(); in the same vein, the default coordinates can be changed via the methodset default chart():sage: E.set default frame(polar frame)sage: E.set default chart(polar)(continues on next page)3

Sage 9.2 Reference Manual: Euclidean Spaces and Vector Calculus, Release 9.2(continued from previous page)sage: v.display()v r e phsage: v[:][0, r]sage: E.set default frame(E.cartesian frame())sage: E.set default chart(cartesian)# revert to Cartesian frame# and chartWhen defining a vector field from components relative to a vector frame different from the default one, the vectorframe has to be specified explicitly:sage: v E.vector field(1, 0, frame polar frame)sage: v.display(polar frame)e rsage: v.display()x/sqrt(x 2 y 2) e x y/sqrt(x 2 y 2) e yThe argument chart must be used to specify in which coordinate chart the components are expressed:sage: v E.vector field(0, r, frame polar frame, chart polar)sage: v.display(polar frame, polar)r e phsage: v.display()-y e x x e yIt is also possible to pass the components as a dictionary, with a pair (vector frame, chart) as a key:sage: v E.vector field({(polar frame, polar): (0, r)})sage: v.display(polar frame, polar)r e phThe key can be reduced to the vector frame if the chart is the default one:sage: v E.vector field({polar frame: (0, 1)})sage: v.display(polar frame)e phFinally, it is possible to construct the vector field without initializing any component:sage: v E.vector field(); vVector field on the Euclidean plane E 2The components can then by set in a second stage, via the square bracket operator, the unset components being assumedto be zero:sage: v[1] -ysage: v.display()-y e xsage: v[2] xsage: v.display()-y e x x e y# v[2] is zeroThe above is equivalent to:sage: v[:] -y, xsage: v.display()-y e x x e y4Chapter 1. Euclidean Spaces

Sage 9.2 Reference Manual: Euclidean Spaces and Vector Calculus, Release 9.2The square bracket operator can also be used to set components in a vector frame that is not the default one:sage: v E.vector field(name 'v')sage: v[polar frame, 2, polar] rsage: v.display(polar frame, polar)v r e phsage: v.display()v -y e x x e yThe value of the vector field v at point p:sage: vp v.at(p); vpVector v at Point p on the Euclidean plane E 2sage: vp.display()v -e x - e ysage: vp.display(polar frame.at(p))v sqrt(2) e phA scalar field on E:sage: f E.scalar field(x*y, name 'f'); fScalar field f on the Euclidean plane E 2sage: f.display()f: E 2 -- R(x, y) -- x*y(r, ph) -- r 2*cos(ph)*sin(ph)The value of f at point p:sage: f(p)-1The gradient of f:sage: from sage.manifolds.operators import * # to get grad, div, etc.sage: w grad(f); wVector field grad(f) on the Euclidean plane E 2sage: w.display()grad(f) y e x x e ysage: w.display(polar frame, polar)grad(f) 2*r*cos(ph)*sin(ph) e r (2*cos(ph) 2 - 1)*r e phThe dot product of two vector fields:sage: s v.dot(w); sScalar field v.grad(f) on the Euclidean plane E 2sage: s.display()v.grad(f): E 2 -- R(x, y) -- x 2 - y 2(r, ph) -- (2*cos(ph) 2 - 1)*r 2sage: s.expr()x 2 - y 2The norm is related to the dot product by the standard formula:sage: norm(v) 2 v.dot(v)TrueThe divergence of the vector field v:5

Sage 9.2 Reference Manual: Euclidean Spaces and Vector Calculus, Release 9.2sage: s div(v); sScalar field div(v) on the Euclidean plane E 2sage: s.display()div(v): E 2 -- R(x, y) -- 0(r, ph) -- 0Example 2: Vector calculus in the Euclidean 3-spaceWe start by declaring the 3-dimensional Euclidean space E, with (x,y,z) as Cartesian coordinates:sage: E. x,y,z EuclideanSpace()sage: EEuclidean space E 3A simple vector field on E:sage: v E.vector field(-y, x, 0, name 'v')sage: v.display()v -y e x x e ysage: v[:][-y, x, 0]The Euclidean norm of v:sage: s norm(v); sScalar field v on the Euclidean space E 3sage: s.display() v : E 3 -- R(x, y, z) -- sqrt(x 2 y 2)sage: s.expr()sqrt(x 2 y 2)The divergence of v is zero:sage: from sage.manifolds.operators import *sage: div(v)Scalar field div(v) on the Euclidean space E 3sage: div(v).display()div(v): E 3 -- R(x, y, z) -- 0while its curl is a constant vector field along š‘’š‘§ :sage: w curl(v); wVector field curl(v) on the Euclidean space E 3sage: w.display()curl(v) 2 e zThe gradient of a scalar field:sage: f E.scalar field(sin(x*y*z), name 'f')sage: u grad(f); uVector field grad(f) on the Euclidean space E 3sage: u.display()grad(f) y*z*cos(x*y*z) e x x*z*cos(x*y*z) e y x*y*cos(x*y*z) e z6Chapter 1. Euclidean Spaces

Sage 9.2 Reference Manual: Euclidean Spaces and Vector Calculus, Release 9.2The curl of a gradient is zero:sage: curl(u).display()curl(grad(f)) 0The dot product of two vector fields:sage: s u.dot(v); sScalar field grad(f).v on the Euclidean space E 3sage: s.expr()(x 2 - y 2)*z*cos(x*y*z)The cross product of two vector fields:sage: a u.cross(v); aVector field grad(f) x v on the Euclidean space E 3sage: a.display()grad(f) x v -x 2*y*cos(x*y*z) e x - x*y 2*cos(x*y*z) e y 2*x*y*z*cos(x*y*z) e zThe scalar triple product of three vector fields:sage: triple product E.scalar triple product()sage: s triple product(u, v, w); sScalar field epsilon(grad(f),v,curl(v)) on the Euclidean space E 3sage: s.expr()4*x*y*z*cos(x*y*z)Let us check that the scalar triple product of š‘¢, š‘£ and š‘¤ is š‘¢ Ā· (š‘£ š‘¤):sage: s u.dot(v.cross(w))TrueAUTHORS: Eric Gourgoulhon (2018): initial versionREFERENCES: M. Berger: Geometry I [Ber1987]class dimSpace(name None,latex name None,coordinates 'Cartesian',symbols None,metric name 'g',metric latex name None,start index 1,base manifold None,category None,unique tag None)Bases: pace7

Sage 9.2 Reference Manual: Euclidean Spaces and Vector Calculus, Release 9.23-dimensional Euclidean space.A 3-dimensional Euclidean space is an affine space šø, whose associated vector space is a 3-dimensional vectorspace over R and is equipped with a positive definite symmetric bilinear form, called the scalar product or seudoRiemannianManifold(viaEuclideanSpace) since a 3-dimensional Euclidean space can be viewed as a Riemannian manifoldthat is diffeomorphic to R3 and that has a flat metric š‘”. The Euclidean scalar product is the one defined by theRiemannian metric š‘”.INPUT: name ā€“ (default: None) string; name (symbol) given to the Euclidean 3-space; if None, the name will beset to 'E 3' latex name ā€“ (default: None) string; LaTeX symbol to denote the Euclidean 3-space; if None, it is setto '\mathbb{E} {3}' if name is None and to name otherwise coordinates ā€“ (default:'Cartesian') string describing the type of coordinates tobe initialized at the Euclidean 3-space creation; allowed values are 'Cartesian' (seecartesian coordinates()), 'spherical' (see spherical coordinates()) and'cylindrical' (see cylindrical coordinates()) symbols ā€“ (default: None) string defining the coordinate text symbols and LaTeX symbols, with thesame conventions as the argument coordinates in RealDiffChart, namely symbols is a stringof coordinate fields separated by a blank space, where each field contains the coordinateā€™s text symbol andpossibly the coordinateā€™s LaTeX symbol (when the latter is different from the text symbol), both symbolsbeing separated by a colon (:); if None, the symbols will be automatically generated according to thevalue of coordinates metric name ā€“ (default: 'g') string; name (symbol) given to the Euclidean metric tensor metric latex name ā€“ (default: None) string; LaTeX symbol to denote the Euclidean metric tensor;if none is provided, it is set to metric name start index ā€“ (default: 1) integer; lower value of the range of indices used for ā€œindexed objectsā€ inthe Euclidean 3-space, e.g. coordinates of a chart base manifold ā€“ (default: None) if not None, must be an Euclidean 3-space; the created object isthen an open subset of base manifold category ā€“ (default: None) to specify the category; if None, Manifolds(RR).Smooth() &MetricSpaces().Complete() is assumed names ā€“ (default: None) unused argument, except if symbols is not provided; it must then be a tuplecontaining the coordinate symbols (this is guaranteed if the shortcut operator , is used) init coord methods ā€“ (default: None) dictionary of methods to initialize the various type of coordinates, with each key being a string describing the type of coordinates; to be used by derived classesonly unique tag ā€“ (default: None) tag used to force the construction of a new object when all the otherarguments have been used previously (without unique tag, the UniqueRepresentation behaviorinherited from PseudoRiemannianManifold would return the previously constructed object corresponding to these arguments)EXAMPLES:A 3-dimensional Euclidean space:8Chapter 1. Euclidean Spaces

Sage 9.2 Reference Manual: Euclidean Spaces and Vector Calculus, Release 9.2sage: E EuclideanSpace(3); EEuclidean space E 3sage: latex(E)\mathbb{E} {3}E belongs to the class Euclidean3dimSpace (actually to a dynamically generated subclass of it via SageMathā€™s category framework):sage: type(E) class 3dimSpace with category' E is both a real smooth manifold of dimension 3 and a complete metric space:sage: E.category()Join of Category of smooth manifolds over Real Field with 53 bits ofprecision and Category of complete metric spacessage: dim(E)3It is endowed with a default coordinate chart, which is that of Cartesian coordinates (š‘„, š‘¦, š‘§):sage: E.atlas()[Chart (E 3, (x, y, z))]sage: E.default chart()Chart (E 3, (x, y, z))sage: cartesian E.cartesian coordinates()sage: cartesian is E.default chart()TrueA point of E:sage: p E((3,-2,1)); pPoint on the Euclidean space E 3sage: cartesian(p)(3, -2, 1)sage: p in ETruesage: p.parent() is ETrueE is endowed with a default metric tensor, which defines the Euclidean scalar product:sage: g E.metric(); gRiemannian metric g on the Euclidean space E 3sage: g.display()g dx*dx dy*dy dz*dzCurvilinear coordinates can be introducedcylindrical coordinates().onE:seespherical coordinates()andSee also:Example 2: Vector calculus in the Euclidean 3-spacecartesian coordinates(symbols None, names None)Return the chart of Cartesian coordinates, possibly creating it if it does not already exist.INPUT:9

Sage 9.2 Reference Manual: Euclidean Spaces and Vector Calculus, Release 9.2 symbols ā€“ (default: None) string defining the coordinate text symbols and LaTeX symbols, withthe same conventions as the argument coordinates in RealDiffChart; this is used only if theCartesian chart has not been already defined; if None the symbols are generated as (š‘„, š‘¦, š‘§). names ā€“ (default: None) unused argument, except if symbols is not provided; it must be a tuplecontaining the coordinate symbols (this is guaranteed if the shortcut operator , is used)OUTPUT: the chart of Cartesian coordinates, as an instance of RealDiffChartEXAMPLES:sage: E EuclideanSpace(3)sage: E.cartesian coordinates()Chart (E 3, (x, y, z))sage: E.cartesian coordinates().coord range()x: (-oo, oo); y: (-oo, oo); z: (-oo, oo)An example where the Cartesian coordinates have not been previously created:sage: E EuclideanSpace(3, coordinates 'spherical')sage: E.atlas() # only spherical coordinates have been initialized[Chart (E 3, (r, th, ph))]sage: E.cartesian coordinates(symbols 'X Y Z')Chart (E 3, (X, Y, Z))sage: E.atlas() # the Cartesian chart has been added to the atlas[Chart (E 3, (r, th, ph)), Chart (E 3, (X, Y, Z))]The coordinate variables are returned by the square bracket operator:sage: E.cartesian coordinates()[1]Xsage: E.cartesian coordinates()[3]Zsage: E.cartesian coordinates()[:](X, Y, Z)It is also possible to use the operator , to set symbolic variable containing the coordinates:sage: E EuclideanSpace(3, coordinates 'spherical')sage: cartesian. u,v,w E.cartesian coordinates()sage: cartesianChart (E 3, (u, v, w))sage: u, v, w(u, v, w)The command cartesian. u,v,w E.cartesian coordinates() is actually a shortcutfor:sage: cartesian E.cartesian coordinates(symbols 'u v w')sage: u, v, w cartesian[:]cylindrical coordinates(symbols None, names None)Return the chart of cylindrical coordinates, possibly creating it if it does not already exist.INPUT: symbols ā€“ (default: None) string defining the coordinate text symbols and LaTeX symbols, withthe same conventions as the argument coordinates in RealDiffChart; this is used only if the10Chapter 1. Euclidean Spaces

Sage 9.2 Reference Manual: Euclidean Spaces and Vector Calculus, Release 9.2cylindrical chart has not been already defined; if None the symbols are generated as (šœŒ, šœ‘, š‘§). names ā€“ (default: None) unused argument, except if symbols is not provided; it must be a tuplecontaining the coordinate symbols (this is guaranteed if the shortcut operator , is used)OUTPUT: the chart of cylindrical coordinates, as an instance of RealDiffChartEXAMPLES:sage: E EuclideanSpace(3)sage: E.cylindrical coordinates()Chart (E 3, (rh, ph, z))sage: latex( )\left(\mathbb{E} {3},({\rho}, {\phi}, z)\right)sage: E.cylindrical coordinates().coord range()rh: (0, oo); ph: [0, 2*pi] (periodic); z: (-oo, oo)The relation to Cartesian coordinates is:sage: E.coord change(E.cylindrical coordinates(),.:E.cartesian coordinates()).display()x rh*cos(ph)y rh*sin(ph)z zsage: E.coord change(E.cartesian coordinates(),.:E.cylindrical coordinates()).display()rh sqrt(x 2 y 2)ph arctan2(y, x)z zThe coordinate variables are returned by the square bracket operator:sage: E.cylindrical coordinates()[1]rhsage: E.cylindrical coordinates()[3]zsage: E.cylindrical coordinates()[:](rh, ph, z)They can also be obtained via the operator , :sage: cylindrical. rh,ph,z E.cylindrical coordinates()sage: cylindricalChart (E 3, (rh, ph, z))sage: rh, ph, z(rh, ph, z)Actually, cylindrical. rh,ph,z E.cylindrical coordinates() is a shortcut for:sage: cylindrical E.cylindrical coordinates()sage: rh, ph, z cylindrical[:]The coordinate symbols can be customized:sage: E EuclideanSpace(3)sage: E.cylindrical coordinates(symbols r"R Phi:\Phi Z")Chart (E 3, (R, Phi, Z))(continues on next page)11

Sage 9.2 Reference Manual: Euclidean Spaces and Vector Calculus, Release 9.2(continued from previous page)sage: latex(E.cylindrical coordinates())\left(\mathbb{E} {3},(R, {\Phi}, Z)\right)Note that if the cylindrical coordinates have been already initialized, the argument symbols has no effect:sage: E.cylindrical coordinates(symbols r"rh:\rho ph:\phi z")Chart (E 3, (R, Phi, Z))cylindrical frame()Return the orthonormal vector frame associated with cylindrical coordinates.OUTPUT: VectorFrameEXAMPLES:sage: E EuclideanSpace(3)sage: E.cylindrical frame()Vector frame (E 3, (e rh,e ph,e z))sage: E.cylindrical frame()[1]Vector field e rh on the Euclidean space E 3sage: E.cylindrical frame()[:](Vector field e rh on the Euclidean space E 3,Vector field e ph on the Euclidean space E 3,Vector field e z on the Euclidean space E 3)The cylindrical frame e

An Euclidean space of dimension is an afļ¬ne space , whose associated vector space is a -dimensional vector space over Rand is equipped with a positive deļ¬nite symmetric bilinear form, called the scalar product or dot product [Ber1987]. An Euclidean space of dimension can also be viewed as a Riemannian manifold that is diffeomorphic to

Related Documents:

Integrate Sage CRM with Sage 300 Use Sage CRM features that are added during integration How to Use this Guide The first five chapters of this guide are for Sage CRM implementers. Chapter 6, "Using Sage CRM with Sage 300," is for Sage CRM users. We assume that implementers: Have experience implementing and troubleshooting Sage CRM

Sage.CRM.WebObjectNamespace 11-7 Sage.CRM.ControlsNamespace 11-7 DeveloperGuide Contents-ix. Contents Sage.CRM.DataNamespace 11-7 Sage.CRM.UtilsNamespace 11-7 Sage.CRM.BlocksNamespace 11-8 Sage.CRM.HTMLNamespace 11-8 Sage.CRM.UINamespace 11-8 Installingthe.NETSDK 11-8

Sage 50 Sage 100 Sage 300 HRMS Construction Modernizationā€”bridging the past to the future Leveraging modern technology to . Sage 300 2016 February 2016 Sage 300 2016.1 May 2016 New Direct Deposit service for US payroll August 2016 Sage 300 2017.

Sage Abra Workforce Connections, the web-based employee self-service solution for Sage HRMS. It consists of: Abra Employee Self-Service Abra Benefits Enrollment Abra eRecruiter Sage Accpac HRMS Payroll Link, for transferring employee data and earnings, deductions, and benefits information from Sage HRMS to Sage Accpac Payroll.

ERP MAS 90, Sage ERP MAS 200, and Sage ERP MAS 200 SQL. This manual also contains information and troubleshooting tips on the configuration of the various operating systems and environments in which the Sage ERP MAS software is supported. The instructions contain detailed technical information on the configuration ofFile Size: 1MB

Installation Guide. Where To Now? Installation and Administration Guide 1 ā€“5 : Sage 300 Integrated with Sage CRM : Similar to Sage 300, Sage CRM can be installed locally, or on a server, or be deployed on the Web. In the illustration below, weā€™ve shown the Sage 300 Web server and the

Sage HRMS or Sage ABRA Suite G/L Link using General Ledger Exchange or VI import Sage HRMS Product Version Sage 100 Standard and Advanced . 2016.1 X X Requires Sage 100 2016.1 (Update 1) or higher Remote access; cannot be

If you are using Sage Fixed Assets-Depreciation Premier, see page 4-1. Unlike some of the other Sage Fixed Assets link programs, you do not need to run the link in the Sage Fixed Assets application to post depreciation to Sage 100You need only . calculate depreciation for the desired period and group of assets. Then, in the Sage 100