Home > Modeling Tips > Spatial Modeling in Two Dimensions

Spatial Modeling in Two Dimensions

Editor’s Note:  This is part 2 of a 3-part series on spatial modeling in iThink and STELLA.  Part 1 is available here.  Part 3 is available here.



Last time, we explored spatial modeling using the one-dimensional diffusion problem as an example.  Many spatial applications, however, require two dimensional formulations.  As an extension, we will now explore the two-dimensional diffusion problem.  Instead of a one-meter metal bar with constant heat applied at its ends, the two-dimensional diffusion problem looks at the response of a one-meter by one-meter metal plate with constant heat applied to its center.  We then watch the heat diffuse across the plate.

At first blush, one might think the two-dimensional case is much more difficult than the one-dimensional case.  In particular, if a grid is superimposed over the plate, each finite element on the plate has eight neighbors, as shown below.  It is tempting, therefore, to consider radiating heat in each of these eight directions.

2d-radiation

However, without looking at the two-dimensional diffusion equations, if we consider just the physical layout of this system, the four corners of the finite element only touch the four corner neighbors (1, 3, 5, and 7) at one point.  In contrast, the four sides of the finite element are shared with each of its four immediate neighbors (2, 4, 6, and 8).  This suggests that heat only radiates to (and from) these four neighbors, not all eight.  In fact, if we examine the two-dimensional diffusion equation, we find that there are only component contributions in the x– and the y-directions.  There are no contributions on the diagonal (which would appear in the equation as ∂2u/∂xy and ∂2u/∂yx terms).

Intuitively, then, we have a finite element that is very similar to the one-dimensional case.  We only need to add corresponding flows in the y-direction.  This leads to the following model with the individual finite elements arrayed.

2d-element-model

The array T is now two-dimensional, in x and in y.  In addition, dx can differ from dy, so the diffusion constant C must be broken down into its constituent parts Cx = k/dx2 and Cy = k/dy2.  This leads to the following set of equations for the radiant flows through the plate:

in left = Cx*T[X – 1, Y]                               in top = Cy*T[X, Y – 1]
out left
= Cx*T[X, Y]                                  out top = Cy*T[X, Y]
out right
= Cx*T[X, Y]                              out bottom = Cy*T[X, Y]
in right
= Cx*T[X + 1, Y]                          in right = Cy*T[X, Y + 1]

X and Y are dimension names for the elements in the x– and ­y-directions, respectively.

Using isee Spatial Map, it is possible to view the results of this diffusion across two dimensions.  Spatial Map displays an array as a one-dimensional or two-dimensional grid (depending on the array).  Each cell in the grid is filled with a color corresponding to the value in the corresponding cell of the array.  Below are two spatial maps.  The one on the left shows the initial conditions of the metal plate.  Note that heat only appears in the center of the plate, where it is being externally applied.  The map on the right shows the distribution of heat across the plate at the end of a six-minute simulation.

2d-element-results

The model is available here:  2d-diffusion.  It is already configured to use isee Spatial Map.  In the final installment of this 3-part series, I will describe how to set up isee Spatial Map.

If you enjoyed this post, make sure you subscribe to my RSS feed!
  • azmi

    Ia m interested to combine spatial data with dynamic data to produce integration data between GIS and STELLA. Any body can help me what softwares can use to integrate these data?

    Thanks

    Azmi

  • Usually when someone says they are interested in integrating spatial data, they are specifically referring to tracking the geocoordinates of a specific location on Earth. For example, my grid above could be at (43.65977, -72.24741), in the middle of where Google Earth says the isee systems office is. In my experience, this sort of information is often passed around in GeoTiff files which contains both the raster image of the location and metainformation about its spatial location on earth in latitude and longitude.

    At present, STELLA does not read, track, or write geospatial information. We do have plans to do this in the future. When it has been necessary to track this information, I have tracked it myself. I use the open source GDAL library tools to convert GeoTiffs to ArcInfo ASCII Grid format (AAIGRID). I can then easily massage this data to the CSV format expected by STELLA’s data import. After exporting data out of STELLA, I can then massage the exported CSV back to AAIGRID format and use GDAL to convert it back to a GeoTiff. The GDAL utility that does this is called gdal_translate.

  • Herve GIGAROFF

    @azmi
    Thanks for the “Spatial Model” tutorial. The interesting question about “STELLA & GIS” (or “How modelling in Time & space…!!!) of Azmi has been and is still one of mine… I could advice you the works about “Landscape Simulation Modeling” of R.Costanza & A.Voinov with their modell “S.M.E” = “Spatial Modeling Environment”which uses STELLA. to simulate flows (of water) from GIS cells to cells on awatershade for instance.
    Unfortunatlly I was unable to open it on Macintosh even if I was told that it was possible under the Terminal part of Mac OS X. So if you could give me useful advice that could help me to use “S.M.E” & “STELLA” on Macintosh…
    …it could be very usefull for different projects I have here, as College & High-School professor in France, in the field of Aquaculture & Costal management, dealing with projects of transferring the research works of “Companion Modelling Approach” with “Multi-Agent-Based Models and Role-Playing Games” into College & Highschool level.
    “S.M.E.” on internet= http://www.uvm.edu/giee/SME3/
    Thanks for your answer
    Hervé

  • Pingback: Spatial Modeling with isee Spatial Map | Making Connections()

  • SME is a powerful spatial modeling add-on package for STELLA that was developed at the Gund Institute of Ecological Economics at the University of Maryland. The Gund Institute and Bob Costanza are now at the University of Vermont. Alexey Voinov was also there, but has moved back to [the state of] Maryland. If you need to get SME to work, I suggest you contact him directly. His personal web page is: http://www.likbez.com/AV/

    We are actively adding new features to STELLA to allow you to do some of this modeling within STELLA. This 3-part series was meant to highlight some of these features and how they work together. If you need something special to support your spatial projects, please let me know and we will see what we can do.

  • azmi

    I am planning to integrate STELLA 9.1.2 and ARC GIS to produce Spatial System Dinamic about simulation game dengue fever…any body can give me idea..URGENT….from my reading…..STELLA 9.1.2 can converte file in CSV formate automaticly…..so i never use exell…..can u comment this idea??

  • Yes, one of the major features of version 9.1.2 is that it reads and writes CSV files directly – without using Excel. Hopefully, this was a quick enough answer. When you have an urgent question about the software, you can get the quickest response by e-mailing support@iseesystems.com.

  • Thanks Brother Karim…..i will design it….
    I already uprgate my Stella version 8.1 to version 9.1.2

  • Yes, one of the major features of version 9.1.2 is that it reads and writes CSV files directly – without using Excel. Hopefully, this was a quick enough answer. When you have an urgent question about the software, you can get the quickest response by e-mailing support@iseesystems.com.

  • rossibella

    hello I need a manual on how to use ithink for a project and I am completely new to this, this is my mail if you have any information that might be useful to me thanks beforehand rosvir73@hotmail.com

    • I recommend going to our company website, http://www.iseesystems.com and downloading the trial version. It comes with documentation and tutorials, our website also offers a lot of information. I will send you an email.