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.
Posted 3 oct. 2014, 09:17 UTC−4 0 Replies
Please login with a confirmed email address before reporting spam
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!
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.