1
$\begingroup$

I have calculated the temperature of the section of a cylinder, which is subjected to a heat flow on its upper surface. Getting the temperature distribution in the 2D section. As shown in the following image.

enter image description here

From this temperature distribution would represent the upper part of the cylinder as in the picture below.

enter image description here

$\endgroup$
  • $\begingroup$ Welcome to SciComp! What question are you asking here? $\endgroup$ – Geoff Oxberry Aug 22 '14 at 0:12
  • $\begingroup$ I am looking for a circular surface which represents the top of the cylinder starting from the temperature distribution. And represent it in Matlab. Thank you for your attention $\endgroup$ – Santiago murillo Aug 22 '14 at 0:32
  • $\begingroup$ I still don't understand what you want to do. Can you be more specific? Do you have an example that looks like what you want? $\endgroup$ – nicoguaro Aug 22 '14 at 1:29
  • $\begingroup$ The first image is the temperature distribution that I generated using finite volumes, and the second image is not mine, is the image that I want to generate. $\endgroup$ – Santiago murillo Aug 22 '14 at 8:57
  • $\begingroup$ Basically my problem is that I don't know how program it in matlab, from an array of surface temperatures. $\endgroup$ – Santiago murillo Aug 22 '14 at 14:00
3
$\begingroup$

If I understand, what you want is to make a polar plot of your data presented in the first image. Where, I assume, the axis are the radius and angle. You need to make a change of coordinates from polar to Cartesian to do that. Matlab has a built-in function for that called pol2cart (documentation). See an example here

You can do something like

r = linspace(0,1,1000);
th = linspace(0,2*pi,1000);

[TH,R] = meshgrid(th,r);
[X,Y] = pol2cart(TH,R);

Z = besselj(0,20*R);

figure
contourf(X,Y,Z); axis square

figure
surf(X,Y,Z); shading interp

here it is the contour plot (in Octave, though): enter image description here and

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.