Code covered by the BSD License  

Highlights from
smartconvert

Be the first to rate this file! 0 Downloads (last 30 days) File Size: 4.03 KB File ID: #19976

smartconvert

by Ali Mohammad Razeghi

 

19 May 2008 (Updated 20 May 2008)

Tries to find a set of coordinates that function has simple relations between variables or finds the

| Watch this File

File Information
Description

Derives number of dimensions (variables) of given function
(class - inline , symbolic or char) then tries to find a set of
coordinates that function has simple relations between variables or finds
the coordinates that function has less variables. See "p1" comments. This is
done in two (cartesian or polar) or three (cartesian or cylandrical or
spherical) dimensions. The output also contain an extra parameter that
shows the result coordinates and you can choose the out put function
class type (inline , symbolic or char). See "cla" comments. The function
also can be used manually. See "p1" comments. Some of usual change of
coordinate are provided that can be used manually. See "p2" comments.

Clarification: If you choose 'S' for p1: When someone wants to integrate
( ( x ^ 2 ) + ( y ^ 2 ) + ( z ^ 2 ) ) dx dy dz. It is more simpler that
integrate in spherical coordinates with integrand ( r ^ 2 ) ( r ^ 2 sin
( theta )dr d( theta )d( phi ) ). This program tries to find and convert
functions like this. If you choose 'L' for p1: When someone wants to
use del operator on ( ( x ^ 2 ) + ( y ^ 2 ) + ( z ^ 2 ) ). It is more
simpler that work in spherical coordinates with ( r ^ 2 ) and use
spherical del operator. This program tries to find and convert functions
like this. The two case of code using aren't the same always. See
examples of the code.

Example:
(1)
 W = inline ( ' s * cos ( t ) * tan ( e ) ' , ' s ' ,' t ' , ' e ' ) ;
 [ simp , coord ] = smartconvert ( W , 'sym' , 'L')
 simp =
       A*tan(B)
 coord =
        Cartesian
(2)
 W = inline ( ' s * cos ( t ) * tan ( e ) ' , ' s ' ,' t ' , ' e ' ) ;
 [ simp , coord ] = smartconvert ( W , 'sym' , 'S')
 simp =
       C*B/A
 coord =
        Cartesian

Required Products Symbolic Math Toolbox
MATLAB release MATLAB 7.2 (R2006a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
convert Ali Mohammad Razeghi 22 Oct 2008 10:02:11
simple Ali Mohammad Razeghi 22 Oct 2008 10:02:11
mathematics Ali Mohammad Razeghi 22 Oct 2008 10:02:11
function Ali Mohammad Razeghi 22 Oct 2008 10:02:11
general Ali Mohammad Razeghi 22 Oct 2008 10:02:12

Contact us at files@mathworks.com