File: matrixdata.htm

package info (click to toggle)
extrema 4.3.6-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 19,212 kB
  • ctags: 6,452
  • sloc: cpp: 86,428; sh: 8,229; makefile: 814
file content (159 lines) | stat: -rw-r--r-- 7,901 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
<HTML>
<HEAD>
<TITLE>Matrix data</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">

<P><font size="+2" color="green">Matrix data</font></P>

<TABLE border="1" cols="2" frame="box" rules="all" width="644">
<TR>
<TD width="14%" valign="top"><B>Syntax</B>:</TD>
<TD width="86%" valign="top"><CODE>
CONTOUR { x y } v nctr { min { incr }}<br />
CONTOUR\COLOURS colr { x y } v nctr { min { incr }}<br />
CONTOUR\INTERPSIZE ntrp { x y } v num { min { incr }}<br />
CONTOUR\INTERPSIZE\COLOURS colr ntrp { x y } v num { min { incr }}<br />
CONTOUR\SPECIFIC { x y } v lvls<br />
CONTOUR\SPECIFIC\COLOURS colr { x y } v lvls<br />
CONTOUR\SPECIFIC\INTERPSIZE ntrp { x y } v lvls<br />
CONTOUR\SPECIFIC\INTERPSIZE\COLOURS colr ntrp { x y } v lvls</CODE>
</TD></TR>
<TR>
<TD width="14%" valign="top"><B>Qualifiers:</B></TD>
<TD width="86%" valign="top"><CODE>
\SPECIFIC, \INTERPSIZE, \POLAR, \LEGEND, \COLOURS, \PARTIAL, \RESET,
 \BORDER, \AXES, \COORDINATES, \AREAS, \VOLUMES</CODE>
</TD></TR>
<TR>
<TD valign="top"><B>Defaults:</B></TD>
<TD valign="top"><CODE>
X=[1;2;3;...], y=[1;2;3;...], \-SPECIFIC, \-INTERPSIZE, \-POLAR, \-LEGEND, \-COLOURS,
 \-RESET, \-AREAS, \-VOLUMES, \BORDER, \-COORDINATES, \AXES</CODE>
</TD></TR>
</TABLE>
<P>
 Suppose that <CODE>v</CODE> is a matrix which has <i>n</i> columns and <i>m</i> rows.  The vectors
 <CODE>x</CODE> and <CODE>y</CODE> are optional, and if entered, are used for scaling the axes.
 Each matrix element, <code>v[i,j]</code>, is associated with the coordinates
 <code>(x[j],y[i])</code>. The length of <CODE>x</CODE> must be greater than or equal to <i>n</i>
 and the length of <CODE>y</CODE> must be greater than or equal to <i>m</i>.</P>
<P>
 If <CODE>x</CODE> and <CODE>y</CODE> are not entered, <CODE>x</CODE> defaults to the set
 <CODE>[1;2;3;...;<i>n</i>]</CODE>, and <CODE>y</CODE> defaults to the set
 <CODE>[1;2;3;...;<i>m</i>]</CODE>, so that matrix element <code><i>m</i>[i,j]</code> is
 associated with the coordinates <code>(j,i)</code>.</P>
<P>
 <font size="+1" color="green">Minimum and maximum contour coordinates</font></P>
<P>
 The minimum and maximum <i>x</i> value for each contour are automatically
 stored in vectors named <CODE><font color="orange">CXMIN</font></CODE> and
 <CODE><font color="orange">CXMAX</font></CODE>; the minimum and maximum
 <i>y</i> value for each  contour are automatically stored in vectors named
 <CODE><font color="orange">CYMIN</font></CODE> and
 <CODE><font color="orange">CYMAX</font></CODE>. These vectors are then
 available to the user for plotting and/or manipulation. Each time the
 <CODE>CONTOUR</CODE> command is entered, these
 vectors are emptied and replaced, so if you wish to keep them, they should
 be renamed or copied into other vectors.</P>
<P>
 <font size="+1" color="green">Volume</font></P>
<P>
 If the <CODE>\VOLUMES</CODE> qualifier is used, the volume contained within each contour is
 calculated as a percentage of the total volume.  The volume percentages are automatically stored
 in a vector named <CODE><font color="orange">CVOLM</font></CODE>. Each time the
 <CODE>CONTOUR</CODE> command is entered, this vector is emptied and replaced, so if you wish to
 keep it, it should be renamed or copied into another vector.</P>
<P>
 <font size="+1" color="green">Area</font></P>
<P>
 If the <CODE>\AREAS</CODE> qualifier is used, the area contained within each contour is calculated
 as a percentage of the total area. The area percentages are automatically stored in a vector
 named <CODE><font color="orange">CAREA</font></CODE>. Each time the
 <CODE>CONTOUR</CODE> command is entered, this vector is emptied and replaced, so if you wish to
 keep it, it should be renamed or copied into another vector.</P>
<P>
 <font size="+1" color="green">Area and volume calculation</font></P>
<P>
 The areas and volumes are calculated in the following way. Two
 dimensional, four point linear interpolation is used to calculate a fine
 mesh overlayed on the matrix, see the figure below.
 Suppose the matrix has <i>n</i> columns and <i>m</i> rows and the size of the
 fine mesh is <i>n<sub>1</sub></i> columns by <i>m<sub>1</sub></i> rows. The
 total area is <i>n<sub>1</sub>&middot;m<sub>1</sub></i> and the total volume
 is the sum of the interpolated values.  Each point of the fine mesh is
 tested against the contour levels, and if a mesh point has a value greater
 than the contour level, a one is binned for the area vector and the mesh
 point value is binned for the volume vector.  Finally, the area and volume
 vectors are normalized by conversion to percentages.</P>
<P>
 <center><IMG SRC="img1.gif"><BR />
 Interpolating a fine mesh on the contours of a matrix</center></P>
<P>
 <font size="+1" color="green">Interpolation size</font></P>

<TABLE border="1" cols="2" frame="box" rules="all" width="644">
<TR>
<TD width="14%" valign="top"><B>Syntax</B>:</TD>
<TD width="86%" valign="top"><CODE>
CONTOUR\INTERPSIZE ntrp { x y } v num { min { incr }}<br />
CONTOUR\INTERPSIZE\COLOURS colr ntrp { x y } v num { min { incr }}<br />
CONTOUR\SPECIFIC\INTERPSIZE ntrp { x y } v lvls<br />
CONTOUR\SPECIFIC\INTERPSIZE/COLOURS colr ntrp { x y } v lvls</CODE>
</TD></TR>
</TABLE>
<P>
 Suppose the matrix has <i>n</i> columns and <i>m</i> rows. The total size
 of the fine mesh, <i>n<sub>1</sub></i> columns by <i>m<sub>1</sub></i> rows,
 is defined by the following:</P>
<P>
 <CODE><i>n</i><sub>1</sub> = (<i>n</i>-1)<i>i<sub>x</sub></i> + 1</CODE><br />
 <CODE><i>m</i><sub>1</sub> = (<i>m</i>-1)<i>i<sub>y</sub></i> + 1</CODE></P>
<P>
 where <CODE><i>i<sub>x</sub></i>-1</CODE> is the number of interpolation
 points between matrix points in the <i>x</i>-direction, and
 <CODE><i>i<sub>y</sub></i>-1</CODE> is the number of interpolation points
 between matrix points in the <i>y</i>-direction. The defaults are as
 below:</P>
<p>
 <table cols="2" border="1">
 <tr>
 <td><table cols="7" border="0" cellspacing="0">
  <tr><td align="center"><i>i<sub>x</sub></i></td><td colspan="6"></td></tr>
  <tr><td align="right">10</td><td>&nbsp;if&nbsp;</td>
   <td></td><td></td><td><i>n</i></td><td>&lt;</td><td>20</td></tr>
  <tr><td align="right">5</td><td>&nbsp;if&nbsp;</td>
   <td>20</td><td>&le;</td><td><i>n</i></td><td>&lt;</td><td>50</td></tr>
  <tr><td align="right">3</td><td>&nbsp;if&nbsp;</td>
   <td>50</td><td>&le;</td><td><i>n</i></td><td>&lt;</td><td>100&nbsp;&nbsp;&nbsp;&nbsp;</td></tr>
  <tr><td align="right">2</td><td>&nbsp;if&nbsp;</td>
   <td>100</td><td>&le;</td><td><i>n</i></td><td></td><td></td></tr>
 </table></td>
 <td><table cols="7" border="0" cellspacing="0">
  <tr><td align="center"><i>i<sub>y</sub></i></td><td colspan="6"></td></tr>
  <tr><td align="right">10</td><td>&nbsp;if&nbsp;</td>
   <td></td><td></td><td><i>m</i></td><td>&lt;</td><td>20</td></tr>
  <tr><td align="right">5</td><td>&nbsp;if&nbsp;</td>
   <td>20</td><td>&le;</td><td><i>m</i></td><td>&lt;</td><td>50</td></tr>
  <tr><td align="right">3</td><td>&nbsp;if&nbsp;</td>
   <td>50</td><td>&le;</td><td><i>m</i></td><td>&lt;</td><td>100</td></tr>
  <tr><td align="right">2</td><td>&nbsp;if&nbsp;</td>
   <td>100</td><td>&le;</td><td><i>m</i></td><td></td><td></td></tr>
 </table></td></tr>
 </table>
<P>
 To over-ride these defaults, use the <CODE>\INTERPSIZE</CODE> qualifier, and
 enter <CODE>ntrp</CODE> as the first parameter. Both <i>i<sub>x</sub></i> and <i>i<sub>y</sub></i>
 will be set to <CODE>ntrp</CODE>.</P>
<P>
 <font size="+1" color="green">Matrix boundary</font></P>
<P>
 By default, the boundary of the matrix is outlined within the axes. If this
 boundary is not desired, use the <CODE>\-BORDER</CODE> qualifier.</P>
<P>
 <a href="scattered.htm"><img src="../shadow_left.gif">&nbsp;
 <font size="+1" color="olive">Scattered data</font></a><br />
 <a href="example.htm"><img src="../shadow_right.gif">&nbsp;
 <font size="+1" color="olive">Example</font></a></P>
</BODY>
</HTML>