Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Cartesian - cylindrical transformations

Subject: Cartesian - cylindrical transformations

From: Bogathi

Date: 12 Jun, 2010 16:28:05

Message: 1 of 2

hi,
Recently i have problem in plotting a function. here it is
E_i = (E_x, E_y,E_z), components of a vector in Cartesian. Each of the component is a function of cylindrical coordinates, ie.,E_i is 3-d matrx . I want to plot these components in Cartesian planes - XZ,YZ. I could get XY from pol2cart command.
Can any one help in this regard.
Thnks in advance.
Reddy

Subject: Cartesian - cylindrical transformations

From: Roger Stafford

Date: 12 Jun, 2010 19:50:24

Message: 2 of 2

"Bogathi " <bogathi.reddy@gmail.com> wrote in message <hv0cil$5j9$1@fred.mathworks.com>...
> hi,
> Recently i have problem in plotting a function. here it is
> E_i = (E_x, E_y,E_z), components of a vector in Cartesian. Each of the component is a function of cylindrical coordinates, ie.,E_i is 3-d matrx . I want to plot these components in Cartesian planes - XZ,YZ. I could get XY from pol2cart command.
> Can any one help in this regard.
> Thnks in advance.
> Reddy

  If I understand you correctly, I can't see that there is any difficulty here. You apparently want surface plots made of each of the vector field components for planes orthogonal to each of the three cartesian axes. Each of these components is a known function of the cylindrical coordinates, r, t (theta), and z. (I'm assuming the usual definition of cylindrical coordinates in terms of x, y, and z holds.)

  For a plane orthogonal to the y-axis ("XZ plane"), just establish a rectangular mesh in x and z coordinates with y held to some constant, y0.
 
 [X,Z] = meshgrid(linspace(x1,x2),linspace(z1,z2)); % x and z limits
 R = sqrt(X.^2+y0^2);
 T = atan2(y0,X);

For the E_x component, for example, do this plot:

 surf(X,Z,E_x(R,T,Z))

where E_x can be evaluated, as you have said, in terms of r, t, and z. This gives you a rectangular grid of points as projected onto the XZ plane.

Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us