Diferencia entre revisiones de «Visualization of vector fields in a solid»

De MateWiki
Saltar a: navegación, buscar
 
(No se muestran 20 ediciones intermedias de 3 usuarios)
Línea 1: Línea 1:
 +
[[Archivo:Campovector1.jpg|400px|thumb|right|Vector field in a solid]]
 +
 
We show how to visualize vector fields on plane regions, representing solids, with Octave UPM. We focus on the example in [[Dibujar un sólido 2-D]], i.e. the rectangle <math> [-1/2,1/2]\times [0,2]</math> and the vector field <math> f(x,y)=x\vec i + y \vec j</math>. We follow the steps:
 
We show how to visualize vector fields on plane regions, representing solids, with Octave UPM. We focus on the example in [[Dibujar un sólido 2-D]], i.e. the rectangle <math> [-1/2,1/2]\times [0,2]</math> and the vector field <math> f(x,y)=x\vec i + y \vec j</math>. We follow the steps:
  
 
# We introduce a sampling of the two segments with a suitable step
 
# We introduce a sampling of the two segments with a suitable step
# With meshgrid command we define two matrixes with the x and y coordenates of the mesh points
+
# With meshgrid command we define two matrixes with the x and y coordinates of the mesh points
 
# Compute the two components of the vector field in the grid points.
 
# Compute the two components of the vector field in the grid points.
# We use the quiver command to draw the field and adjunst the axis. We see the picture from the top.   
+
# We use the quiver command to draw the field and adjust the axis. We see the picture from the top.   
  
 
==  MATLAB code  ==
 
==  MATLAB code  ==
Línea 14: Línea 16:
 
fx=xx;                % x-component of the vector field
 
fx=xx;                % x-component of the vector field
 
fy=yy;                % y-component of the vector field
 
fy=yy;                % y-component of the vector field
quver(xx,yy,fx,fy)    % Draw the vector field
+
quiver(xx,yy,fx,fy)    % Draw the vector field
 
axis([-2,2,-1,3])      % select region for drawing
 
axis([-2,2,-1,3])      % select region for drawing
view([0,0,1])         % See the pisture from the top
+
view(2)               % See the pisture from the top
 
}}
 
}}
  
==  Example ==
+
 
<gallery>
+
==  To go further ==
Archivo:Campovector1.jpg|Mesh in a rectangular solid
+
 
</gallery>
+
[[Mesh of a parametrized 2-D solid]]
 +
 
 +
[[Visualization of a scalar field in a solid]]
 +
 
 +
[[Dibujar un sólido 2-D]]
  
 
[[Categoría:Curso ICE]]
 
[[Categoría:Curso ICE]]
 
[[Categoría:Teoría de Campos]]
 
[[Categoría:Teoría de Campos]]
 +
[[Categoría:Articles in English]]
 +
[[Categoría:TC14/15]]
 +
[[Categoría:TC15/16]]
 +
[[Categoría:TC16/17]]
 +
[[Categoría:TC17/18]]
 +
[[Categoría:TC18/19]]
 +
[[Categoría:TC19/20]]
 +
[[Categoría:TC20/21]]
 +
[[Categoría:TC21/22]]
 +
[[Categoría:TC24/25]]
 +
[[Categoría:TC25/26]]
 +
[[Categoría:Informática]]

Revisión actual del 20:10 25 nov 2025

Vector field in a solid

We show how to visualize vector fields on plane regions, representing solids, with Octave UPM. We focus on the example in Dibujar un sólido 2-D, i.e. the rectangle [math] [-1/2,1/2]\times [0,2][/math] and the vector field [math] f(x,y)=x\vec i + y \vec j[/math]. We follow the steps:

  1. We introduce a sampling of the two segments with a suitable step
  2. With meshgrid command we define two matrixes with the x and y coordinates of the mesh points
  3. Compute the two components of the vector field in the grid points.
  4. We use the quiver command to draw the field and adjust the axis. We see the picture from the top.

1 MATLAB code

x=-0.5:0.1:0.5;       % sampling of the interval [-1/2,1/2]
y=0:0.1:2;            % sampling of the interval [0,2]
[xx,yy]=meshgrid(x,y); % matrixes of x and y coordinates
figure(1)
fx=xx;                 % x-component of the vector field
fy=yy;                 % y-component of the vector field
quiver(xx,yy,fx,fy)     % Draw the vector field
axis([-2,2,-1,3])      % select region for drawing
view(2)                % See the pisture from the top


2 To go further

Mesh of a parametrized 2-D solid

Visualization of a scalar field in a solid

Dibujar un sólido 2-D