Discussion Closed This discussion was created more than 6 months ago and has been closed. To start a new discussion with a link back to this one, click here.

Exporting and manipulating "surface" data/how to plot in cylindrical co-ordinates.

Please login with a confirmed email address before reporting spam

Hello, I want to evaluate a component of the magnetic field (say, Bz) on the surface of a half-cylinder surrounding a cylindrical current source (long axis = z). For this, I have created a cylinder domain and a "surface" data set. Under parametrization I have selected the x and y axes to be the zy-plane.

The magnetic field gets evaluated as expected, now I wish to plot a component of the field (say the z component, mef.Bz ) as a color gradient map on the z-theta plane, i.e. unwrapping the cylinder. I can do this in 3D using 3D Plot group --> surface. But in 2D using surface, I am having trouble getting the correct axes, I can plot the field against the z,y parameters (as I defined the surface data set to have selected the x and y axes to be the zy-plane) but this biases the field to the top and the bottom of the cylinder where there are more elements per unit y due to the curvature).

In order to plot plot the field in the z, theta plane, I have exported the data (x,y,z,mef.Bx,mef.By,mef.Bz,mef.normB) as a text file for manipulation in MATLAB. I now have a column vector for each of these parameters but I can't plot a field component as a a function of z and theta (theta = arctan(y./x)) on a color map as I require a matrix of B values corresponding to the co-ordinate points z and theta.

Essentially, I am trying to understand how to recreate the 2D "surface" plot from COMSOL using the raw exported data set from the surface, using MATLAB. Either that, or is there a way I could plot B_z(z, theta) on a graph of z and theta in COMSOL rather than the cartesean z and y?

I have tried to make this as clear as possible, but I understand it may still be confusing. Please ask for any clarification.

Many thanks for your help!

0 Replies Last Post 2014年10月3日 GMT-4 09:17
COMSOL Moderator

Hello Richard Phillips

Your Discussion has gone 30 days without a reply. If you still need help with COMSOL and have an on-subscription license, please visit our Support Center for help.

If you do not hold an on-subscription license, you may find an answer in another Discussion or in the Knowledge Base.

Note that while COMSOL employees may participate in the discussion forum, COMSOL® software users who are on-subscription should submit their questions via the Support Center for a more comprehensive response from the Technical Support team.