spatial dynamical modeling with terrame (part 2) gilberto câmara
TRANSCRIPT
![Page 1: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/1.jpg)
Spatial Dynamical Modeling with TerraME (part 2)
Gilberto Câmara
![Page 2: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/2.jpg)
f ( It+n )
. . FF
f (It) f (It+1) f (It+2)
Dynamic Spatial Models
“A dynamical spatial model is a computational representation of a real-world process where a location on the earth’s surface changes in response to variations on external and internal dynamics on the landscape” (Peter Burrough)
![Page 3: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/3.jpg)
tp - 20 tp - 10
tp
Calibration Calibration tp + 10
ForecastForecast
Dynamic Spatial Models
Source: Cláudia Almeida
![Page 4: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/4.jpg)
Cell Spaces
A cell space is a raster-based spatial data structure where each cell can handle one or more types of attribute
Cell-spaces have several advantages over raster-based layers as a means of storing information about continuous spatial phenomena.
Using one-attribute raster structures, describing a complex spatial phenomenon requires information to be stored in different files
In a cell-space, such information is kept together in a single structure, with significant benefits in terms of visualization and interface.
![Page 5: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/5.jpg)
Computational Modelling with Cell Spaces
Cell Spaces
Representation
Cell Spaces Generalized Proximity Matriz – GPM Hybrid Automata model Nested scales
![Page 6: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/6.jpg)
2500 m 2.500 m e 500 m
Cellular Data Base Resolution
![Page 7: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/7.jpg)
TerraME - overview
Model data in cell spaces
Read/write data from a database
![Page 8: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/8.jpg)
TerraME functionality
Eclipse & LUA plugin• model description• model highlight syntax
TerraView• data acquisition• data visualization• data management• data analysis
TerraLibdatabase
da
ta
Model source code
MODEL DATA
mod
el
• model syntax semantic checking• model execution
TerraME INTERPRETER
LUA interpreter
TerraME framework
TerraME/LUA interface
model d
ata
![Page 9: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/9.jpg)
TerraME Runtime Environment
Eclipse & LUA plugin• model description• model highlight syntax
TerraView• data acquisition• data visualization• data management• data analysis
TerraLibdatabase
da
ta
Model source code
MODEL DATA
mod
el
• model syntax semantic checking• model execution
TerraME INTERPRETER
LUA interpreter
TerraME framework
TerraME/LUA interface
model d
ata
![Page 10: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/10.jpg)
TerraLib: the support for TerraME
Open source library for GIS Data management
object-relational DBMS raster + vector geometries ORACLE, Postgres, mySQL, Access
Environment for customized GIS applications Web-based cooperative development
http://www.terralib.org
![Page 11: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/11.jpg)
TerraLib
TerraLib EnviromentalModeling Framework
C++ Signal Processing
librarys
C++ Mathematical
librarys
C++ Statistical
librarys
TerraME Virtual Machine
TerraME Compiler
TerraME Language
RondôniaModel DinamicaModel TROLLModel CLUEModel
TerraME architecture
![Page 12: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/12.jpg)
Lua and the Web
Lua
Roberto Ierusalimschy
PUC-Rio, Brazil
![Page 13: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/13.jpg)
Lua and the Web
What is Lua?
Yet Another Scripting Language
an “extension” language
implemented as a library in ANSI C
HostProgram
LuaInterpreter
-- a Lua scriptcolor = REDb = button { label = ‘OK’, x = 10, y = 20}
![Page 14: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/14.jpg)
Lua and the Web
Why Lua?
Simple and flexible “Simple things simple, complex things possible”
Small
Efficient
Portable Whole library written in ANSI C, compiles the same
source code in all platforms Typical uses: MS-DOS, Windows (3.1, 95, NT), Unix (Linux,
Solaris, IRIX, AIX, ULTRIX), Next, OS/2, Mac
![Page 15: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/15.jpg)
Lua and the Web
Where is Lua?
Inside Brazil Petrobras, the Brazilian Oil Company Embratel (the main telecommunication company in
Brazil) many other companies
Outside Brazil Lua is used in hundreds of projects, both commercial
and academic CGILua still in restricted use
» until recently all documentation was in Portuguese
![Page 16: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/16.jpg)
Lua and the Web
How is Lua?
Pascal-like Syntax.
Interpreter executes sequence of statements. function definitions are also statements (see later)
Six types: numbers, tables, functions, strings, userdata, nil
function fat (n) if n == 0 then return 1 else return n*fat(n-1) endend
![Page 17: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/17.jpg)
My first Lua program C = 2; -- rain/t
K = 0.4; -- flow coefficient
q = 0;
-- RULES
for time = 0, 20, 1 do
-- soil water
q = q + C - K*q;
end
print(“q = "..q);
![Page 18: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/18.jpg)
Types
![Page 19: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/19.jpg)
Type nil
Different from everything else
Default variable type
Also acts as false (boolean)
![Page 20: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/20.jpg)
Type boolean
Comparison value
if (rain == true) then ....
![Page 21: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/21.jpg)
Type number
Unique native type for numbersdouble (by default)
a = 3b = 3.5c = 4.5e-8
![Page 22: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/22.jpg)
Type string
Immutable
No size limit (read large files as strings)
No termination value (‘\0’)
Powerful Pattern-matching in standard library
myname = “Werner Kuhn”;
![Page 23: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/23.jpg)
Lua and the Web
Tables
Implement associative arrays: any value (including functions and other tables) can be
used both for indices and values
t = {} -- creates an empty tablet[1] = "hello"t.x = print -- t.x is sugar for t[‘x’]t.x(t[1]) -- prints ‘hello’t.next = t -- circular list
![Page 24: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/24.jpg)
Lua and the Web
Constructors Expressions to create and initialize tables
Record style point={x=10,y=20} print(point.y) --> 20
List style days={"Sun","Mon","Tue","Wed","Thu","Fri","Sat"} print(days[3]) --> Tue
Mixed style points={{x=0,y=0}, point, n=2} print(points[points.n].y) --> 20
![Page 25: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/25.jpg)
Table Table
loc = { cover = "forest", distRoad = 0.3, distUrban = 2 };
loc.cover = “cerrado”;loc[“cover”] = “soja”;
if (loc.distUrban > 1.5) then
![Page 26: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/26.jpg)
Tables in LuaTables in Lua
loc = { cover = "forest", distRoad = 0.3, distUrban = 2 };
loc.desfPot = loc.distRoad + loc.distUrban;
![Page 27: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/27.jpg)
Tables em Lua : functionsTables em Lua : functions
loc = { cover = "forest", distRoad = 0.3, distUrban = 2 };
...loc.reset = function( self )
self.cover = ""; self.distRoad = 0.0; self.distUrban = 0.0;
end
![Page 28: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/28.jpg)
Lua and the Web
Constructors
article{ author="F.P.Brooks", title="The Mythical Man-Month", year=1975,}
news = { {text = "New version 2.0", date = "21/05/1997"}, {text = "New example", date = "21/05/1997"}, {text = "New version: 2.1",date = "17/06/1997"},}
calls function“article”
![Page 29: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/29.jpg)
Functions in Lua
function fat (n)
if n == 0 then
return 1
else
return n*fat(n-1)
end
end
![Page 30: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/30.jpg)
Lua and the Web
Functions in Lua
First class values
function inc (x) return x+1end
inc = function (x) return x+1 end
sugar
clone = {}foreach(t, function (i,e) clone[i]=e end)
Example: cloning a table t
![Page 31: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/31.jpg)
Lua and the Web
Upvalues
Mechanism to allow functions to access non-local variables
An upvalue is a variable expression whose value is computed when the enclosing function is instantiated (and not when the function is executed)
function add (x) return function (y) return y+%x endend
add1 = add(1)print(add1(10)) --> 11
upvalue
![Page 32: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/32.jpg)
Functions and Tables
w = { redraw = function () ... end, pick = function (x,y) ... end,}
if w.pick(x,y) then w.redraw()end
![Page 33: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/33.jpg)
Lua and the Web
Tables x Objects
Tables are dynamically created objects. in the sense of Hoare
list
value - vnext -
old list...
list = {value=v, next=list}
![Page 34: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/34.jpg)
Objects First-class functions+ tables = almost OO
Tables can have functions as fields
Sugar for method definition and call Implicit parameter self
a.foo(a,x)a:foo(x)
a.foo = function (self,x) ...end
function a:foo (x) ...end
sugar
sugar
![Page 35: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/35.jpg)
My second Lua programC = 2; -- rain/tK = 0.4; -- flow coefficientq = 0; --function rain (t) if (t < 10) then
return 4 – 4*math.cos(math.pi*t/10);else
return 4 – 4*math.cos(math.pi*(t-10)/10); endend--for time = 0, 20, 1 do
-- soil waterq = q + rain(time) - K*q;
end-- report
print(“q = "..q);
![Page 36: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/36.jpg)
Standard librariesStandard libraries
Basic String Table Math IO OS Debug Coroutine
![Page 37: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/37.jpg)
BasicBasic
Basic functionsprinttypesetmetatablepairs
![Page 38: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/38.jpg)
StringString
String manipulationpattern matching
string.findstring.gsub
![Page 39: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/39.jpg)
TableTable
Function for table manipulationtable.inserttable.removetable.sort
![Page 40: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/40.jpg)
rainrain rain
N
Itacolomi do ItambéPeak Lobo’s Range
My third Lua program
Define a two-dimensional gridMake it rain on the gridLet water flow downwards
![Page 41: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/41.jpg)
My third Lua programMy third Lua program
4 6
2
8 97
1
5
3
30 30
50
15 1515
50
30
50
0.3 0.3
0.2
0.4 0.40.4
0.2
0.3
0.2
Cell number height absortioncapability
flow direction
![Page 42: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/42.jpg)
TerraME extensions to LuaTerraME extensions to Lua
To build spatial dynamic models, TerraME includes new value types in LUA using the constructor mechanism.
These values are: CellularSpace, Cell, Neighbourhood
![Page 43: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/43.jpg)
Cellular SpaceCellular Space
A CellularSpace is a multivalued set of Cells. It consists of a geographical area of interest,
divided into a regular grid. Each cell in the grid has one or more
attributes.
CellularSpaces are stored and retrieved from a TerraLib database, so the modeller should specify the properties of the CellularSpace
![Page 44: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/44.jpg)
Cellular SpaceCellular Space Usa o construtor de LUAcsCabecaDeBoi = CellularSpace {
dbType = "MySQL",host = "localhost",database = "CabecaDeBoi ",user = "",password = "",layer = "cells90x90",theme = "cells",select = { “height", “capInf" }where = "mask <> ‘noData’";
}
![Page 45: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/45.jpg)
Loading DataLoading Data
-- Loads the TerraLib cellular spacecsCabecaDeBoi = CellularSpace{
dbType = "ADO",host = “localhost",database = "c:\\cabecaDeBoi.mdb",user = "",password = "",layer = "cellsLobo90x90",theme = "cells",select = { “height", “soilWater", “capInf" }
}csCabecaDeBoi:load();
csCabecaDeBoi:loadMooreNeighbourhood;
GIS
![Page 46: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/46.jpg)
Referencing cellsReferencing cells
A CellularSpace has a special attribute called cells. It is a one-dimensional table of references for each Cell in the CellularSpace
-- c is the seventh cell in the cellular spacec = csCabecaDeBoi.cells[ 7 ];-- Updating the attribute “infcap” from the
seventh cellc.infcap = 10;
print (csCabecaDeBoi.cells[7].infCap);
![Page 47: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/47.jpg)
Database managementDatabase management
-- loads a cellular spacecsAmazonia:load();csAmazonia:loadNeighbourhood("Moore");…-- save (time, themeName, attrTableName) -- for time = 1, 10,1 do csAmazonia:save(time, “sim", {"water"});end
![Page 48: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/48.jpg)
The Cell typeThe Cell type
A Cell value has two special attributes: latency and past.
The latency attribute registers the period of time since the last change in a cell attribute value.
The past attribute is a copy of all cell attribute values in the instant of the last change.
if(cell.cover == "abandoned" and cell.latency >= 10 ) then cell.cover = "secFor"; end
cell.water = cell.past.water + 2;
![Page 49: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/49.jpg)
Traversing a Cell SpaceTraversing a Cell Space
"for...end" statement:
"for i, cell in pairs (csQ.cells) do ...end”. The i and cell variable in the statement are the
index and the value of a cell inside the cells attribute from the cellular space csQ.
for i, cell in pairs( csQ.cells ) docell.water = cell.past.water + 2;
end
![Page 50: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/50.jpg)
Traversing a Cell SpaceTraversing a Cell Space
ForEachCell(cs, function())
Applies the chosen function to each cell of the cellular space. This function enables using different rules in a cellular space.
ForEachCell(csQ, function(cell) cell.Water = cell.past.Water + 2;
return true; end);
![Page 51: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/51.jpg)
Von Neumann Neighborhood
Moore Neighborhood
Isotropic neighbourhoods in cell Isotropic neighbourhoods in cell spacesspaces
![Page 52: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/52.jpg)
Traversing a NeighbourhoodTraversing a Neighbourhood
csq:loadNeighbourhood(“Moore”);ForEachCell(csQ,
function(cell) count = 0; ForEachNeighbour(cell, 0,
function(cell, neigh) if (neigh.past.value == 1 and
neigh ~= cell) then count = count + 1; end end; ); -- for each neighbor
![Page 53: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/53.jpg)
Synchronizing a cell spaceSynchronizing a cell space TerraME keeps two copies of a cellular space in
memory: one stores the past values of the cell attributes, and another stores the current (present) values of the cell attributes.
The model equations must read (the right side of the equation rules) the past copy, and must write (the left side of the equation rules) the values to the present copy of the cellular space.
At the correct moment, it will be necessary to synchronize the two copies of the cellular space, copying the current attribute values to the past copy of the cellular space.
![Page 54: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/54.jpg)
SynchronizationSynchronization
Always read from the pastAlways write to the present….csQ:syncronize();
![Page 55: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/55.jpg)
ReferencesReferences Carneiro, T., 2006. Nested-CA: a foundation for
multiscale modeling of land use and land change., in PhD Thesis in Computer Science. National Institute of Space Research: São José dos Campos, Brazil.
Carneiro, T.; Câmara, G., 2007. A Gentle Introduction to TerraME. INPE Report, 2007.
Ierusalimschy, R. 2006. Programming in Lua (2nd edition). Rio de Janeiro, Lua.Org.
![Page 56: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/56.jpg)
Simulation of Physical Processes
- rain drainage in a terrain -
![Page 57: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/57.jpg)
rainrain rain
N
Itacolomi do ItambéPeak Lobo’s Range
My first TerraME program
A simple 2D hydrological model(see example in “Gentle Introduction”)
![Page 58: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/58.jpg)
Picture direction
Itacolomido Itambé Peak
Lobo’s Range
![Page 59: Spatial Dynamical Modeling with TerraME (part 2) Gilberto Câmara](https://reader035.vdocuments.us/reader035/viewer/2022062308/56649e355503460f94b2481b/html5/thumbnails/59.jpg)
SimulationResult(36 min.)