Mesh of a parametrized 2-D solid

De MateWiki
Saltar a: navegación, buscar
Mesh of a parametrized solid

We show how to draw meshes of plane regions, representing solids, with Octave UPM. The objective is to be able of visualizing physical quantities in the mesh points. The simplest example was considered in Dibujar un sólido 2-D. Here we go further and consider a parametrized solid. As an example we consider an annulus. We follow the steps:

  1. We introduce a sampling of the two parameters, (u,v) with a suitable step
  2. With meshgrid command we define two matrixes with the u and v coordinates of the mesh points in the parameter region D
  3. We compute the (x,y) coordenates of the mesh points with the parametrization.
  4. We use the mesh command to draw the mesh and adjunst the axis. We see the mesh from the top.

1 MATLAB code

 1 h=0.1                  % sampling step
 2 u=1:h:2;               % sampling of the interval [1,2]
 3 v=0:h:2*pi+h;            % sampling of the interval [0,2*pi]
 4 [uu,vv]=meshgrid(u,v); % matrixes of u and v coordinates
 5 figure(1)
 6 xx=uu.*cos(vv);        % parametrization
 7 yy=uu.*sin(vv);
 8 mesh(xx,yy,0*xx)       % Draw the mesh
 9 axis([-3,3,-3,3])      % select region for drawing
10 view(2)                % See the pisture from the top

2 To go further

Visualization of a scalar field in a solid

Visualization of vector fields in a solid

Dibujar un sólido 2-D