[The vector field plot shows a vector field with components (Fx, Fy).]

Week 9 Notes: Scalar and Vector Fields

We study scalar and vector fields in 2D and learn how to solve Laplace equation using the relaxation method.

Analytic Vector Field

A quantity, such as wind velocity or a gravitational force, that has a direction and a magnitude at every point in space is a vector field.  The Vector Field Plotter model displays a vector field that is defined by two analytic expressions Fx(x,y) and Fy(x,y).  The field is represented by an array of colored arrows arrows of unit length.  We have found that using color rather than arrow length to represent a vector field's strength produces a more effective representation of magnitude over a wider range of values.

 

Examine the model and remove the Length property input in the inspector and run the model again. The vectors overlap because the default arrow length is the vector magnitude. The Color Component property in the appearance section of the inspector allows us to control the mapping of field strength to color. The default color component selects a color based on the field's magnitude, but we can provide our own map. For example, setting the Color Component property to 1 uses the color that correspond to 1 for all arrows.

Related Models

The following EJS models demonstrate how to display two-dimensional scalar and vector fields using elements on the fields and plots tab on the EJS 2D Drawables palette.

Credits:

The Analytic Vector Field Model was created by Wolfgang Christian using the Easy Java Simulations (EJS) version 4.1 authoring and modeling tool.  You can examine and modify a compiled EJS model if you run the model (double click on the model's jar file), right-click within a plot, and select "Open Ejs Model" from the pop-up menu.  You must, of course, have EJS installed on your computer.

 

Information about Ejs is available at: <http://www.um.es/fem/Ejs/> and in the OSP comPADRE collection <http://www.compadre.org/OSP/>.