<< Click to Display Table of Contents >> tabulate |
{ TABULATE.PDE
This problem tabulates an arithmetic expression into a data table.
The structure of the inline tabulate command is:
TABULATE <range_controls> : <expression>
The <range_control> clause is
VERSUS <name> ( <list_specification> )
or
FOR <name> ( <list_specification> )
A <list_specification> may be the name of an array or a list of values,
possibly including "BY <step> TO <last>" clauses.
A TABULATE command can be preceded by SPLINE to request
spline interpolation rather than the default linear interpolation.
TABLES may be constructed with one, two or three coordinates.
The constructed tables are exported in various forms, to show the use
of TABULATE to create tables for other FlexPDE applications to use.
}
title 'Tabulation Test'
select
regrid=off
variables
u
definitions
alpha =tabulate versus x(0 by 0.1 to 10)
versus y(0 by 0.1 to 10)
: sin(x)*sin(y)+1.1
xar =array (0 by 0.1 to 10)
beta =spline tabulate for x(xar)
for y(0 by 0.1 to 10)
: sin(x)*sin(y)+1.1
p = x
q = p+y
s = y^2*(p+q)
equations
U: div(beta*grad(u)) + alpha = 0
boundaries
region 1
start(0,10)
value(u) = 0
line to (0,0) to (10,0) to (10,10) to close
monitors
contour(u)
plots
grid(x,y) as "computation mesh"
contour(u) as "solution"
surface(u) as "solution"
contour(alpha) as "tabulated data" export file='alpha.tbl'
contour(beta) as "spline-tabulated data"
contour(alpha-beta) as "linear-spline difference"
vector(grad(alpha)) as "table gradient"
vector(grad(beta)) as "spline gradient"
surface(alpha) as "tabulated data"
surface(beta) as "spline data"
table(alpha)
table(s)
vtk(beta)
contour(space_error())
end