Curvilinear Coordinates

version (160 KB) by Howard Wilson
Programs using curvilinear coordinates, and tensor concepts are given.


Updated 15 Apr 2014

View License

Programs and utility functions employing the Symbolic Math Toolbox are provided to analyze vectors and tensors in general curvilinear coordinates. The programs perform the following functions:
1) runcoord plots intersecting coordinate surfaces for several typical coordinate systems
2) runmetric computes and prints metric tensor properties for a general curvilinear coordinate system specified in a user defined function such as sphr.m
3) rundivcrl verifies agreement of numerical values of divergence and curl of an arbitrary vector computed in both cartesian and curvilinear coordinates
4) runconic plots surfaces illustrating how intersections of a cone and a plane produce conic section curves.
5) Testmetric computes properties for nine different coordinate systems and places the output in runmetric.tst. The symbolic equations from some of the examples are fairly lengthy.

The programs employ a number of other functions to define several coordinate systems (such as cylindrical, spherical, toroidal, conical, parabolic, ellipsoidal, and oblate spheroidal) and to compute base vectors, metric tensors, Christoffel symbols, covariant derivatives, divergence, and curl.

Functions readme.m and listequations.m describe the workspace contents and governing equations. These files, consisting mainly of comments, can be examined by typing their names or using the editor. A longer pdf file, accessible with the command open('TensorNotes.pdf'), develops the classical ideas of curvilinear coordinates and tensor analysis.

Cite As

Howard Wilson (2022). Curvilinear Coordinates (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP1
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!