Code covered by the BSD License  

Highlights from
Curvilinear Coordinates

Be the first to rate this file! 12 Downloads (last 30 days) File Size: 168.3 KB File ID: #15903

Curvilinear Coordinates

by Howard Wilson

 

11 Aug 2007 (Updated 10 Feb 2011)

Programs are presented which use symbolic math, curvilinear coordinates, and tensor concepts.

| Watch this File

File Information
Description

Programs and utility functions using 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 typical
     coordinate systems
  2) runmetric computes and prints metric tensor properties for a
     general curvilinear coordinate system
  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 complicated.
  
  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.
  
  Files readme.m and equations.m describe the workspace contents and
  governing equations. These files consist completely of comments and
  can be examined with either the help or the edit commands. A pdf.file
  named TensorNotes presents derivations of the classical analytical
  formulas used.
>>

Required Products Symbolic Math Toolbox
MATLAB release MATLAB 7.0.1 (R14SP1)
Other requirements These programs should run with Student MATLAB or Professional MATLAB and the Symbolic Toolbox. The software was developed on a computer having 4Gbyte of RAM. Users should remember that symbolic output in some instances can be quite lengthy.
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
28 Jul 2011 Theophanes Raptis

How is one supposed to use the curl function in numeric mode? Tried with
syms r t p cs2 real; names=[r t p];
X=[r*sin(t)*cos(p);r*sin(t)*sin(p);r*cos(t)];% Basis of Covariant Vectors

bcov = [[ cos(t), -r*sin(t), 0], [ sin(t), r*cos(t), 0], [ 0, 0, 1]];
        
        
% Christoffel Symbols of the Second Kind

cs2 = zeros(3,3,3);
       
cs2(:,:,1) = [[ 0, 0, 0], [ 0, -r, 0], [ 0, 0, 0]];
 
cs2(:,:,2) = [[ 0, 1/r, 0], [ 1/r, 0, 0], [ 0, 0, 0]];
 
cs2(:,:,3) = [[ 0, 0, 0], [ 0, 0, 0], [ 0, 0, 0]];
 
curls([1, 2 ,3],names,bcovar,cs2,tn)

and gives

>> curltst
??? The following error occurred converting from sym to double:
Error using ==> sym.double at 25
DOUBLE cannot convert the input expression into a double array.
If the input expression contains a symbolic variable, use the VPA function instead.

Error in ==> curltst at 11
cs2(:,:,1) = [[ 0, 0, 0], [ 0, -r, 0], [ 0, 0, 0]];

Please login to add a comment or rating.
Updates
10 Feb 2011

Several code changes were made to improve compatibility with MATLAB 2011. A pdf document presenting tensor analysis concepts was also added.

Tag Activity for this File
Tag Applied By Date/Time
aerospace Howard Wilson 22 Oct 2008 09:22:52
aeronautics Howard Wilson 22 Oct 2008 09:22:52
aerodef Howard Wilson 22 Oct 2008 09:22:52
curvilinear coordinates Howard Wilson 22 Oct 2008 09:22:52
tensor analysis Howard Wilson 22 Oct 2008 09:22:52
symbolic math Howard Wilson 22 Oct 2008 09:22:52
analyze Howard Wilson 22 Oct 2008 09:22:52

Contact us at files@mathworks.com