File: dimension.html

package info (click to toggle)
maxima 5.9.1-9
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 32,272 kB
  • ctags: 14,123
  • sloc: lisp: 145,126; fortran: 14,031; tcl: 10,052; sh: 3,313; perl: 1,766; makefile: 1,748; ansic: 471; awk: 7
file content (317 lines) | stat: -rw-r--r-- 7,156 bytes parent folder | download | duplicates (3)
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
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
     from dimension.texi on 7 April 2002 -->

<TITLE>Untitled Document</TITLE>

</HEAD>
<BODY>
<H1>Untitled Document</H1>
<P>
<P><HR><P>


<H2><A NAME="SEC1" HREF="dimension_toc.html#TOC1">Introduction to the Dimensional Analysis Package</A></H2>

<P>
This document describes a new dimensional analysis package for Maxima.
There is an older Maxima package for dimensional analysis that
is similar to the one that was shipped with the commercial Macsyma system. 
The software described in this document differs greatly from the
older package. 

</P>
<P>
The new dimensional analysis code  was  written by Barton Willis of the 
University of  Nebraska at Kearney. The complete distribution contains 
source code, texinfo documentation, a file for testing (in standard 
Maxima "rtest" form), and a TeX file that provides additional documentation 
and examples of how to use the package. You may download 
the distribution from www.unk.edu/acad/math/people/willisb 
and you may contact the author at willisb@unk.edu.

</P>

<P>
To use the dimensional analysis package, you must first load the file 
<B>dimension.mac</B>.  Provided this file has been installed in a directory 
that Maxima can  find, load it with the command

<PRE>
(C1) load("dimension.mac")$
</PRE>

<P>
Alternatively, you can compile <B>dimension.mac</B> with the command

<PRE>
(C1) compile_file("dimension.mac")$
</PRE>

<P>
After it has been compiled, load it with

<PRE>
(C2) load("dimension.o")$
</PRE>

<P>
The compiled code runs about thirty percent faster than the interpreted
code.

</P>
<P>
Use <B>qput</B> to define the dimension of a variable; thus
to define <EM>x</EM> to be a length, <EM>t</EM> a time, and <EM>c</EM> a speed, use

<PRE>
(C1) qput(x,"length",dimension)$
(C2) qput(t,"time",dimension)$
(C3) qput(c,"length"/"time",dimension)$
</PRE>

<P>
To find  the dimension of an expression, use the  <B>dimension</B> function. 
For example,

<PRE>
(C4) dimension(c*t/5);
(D4) 				    length
(C5) dimension(c-x/t);
				    length
(D5) 				    ------
				     time
</PRE>

<P>
When an expression is dimensionally inconsistent, <B>dimension</B> 
should signal an error

<PRE>
(C6) dimension(c-x);

Expression is dimensionally inconsistent.
</PRE>

<P>
Any symbol may be used to represent a dimension; if you like,
you can use "L" instead of "length" for the length dimension.  It
isn't necessary to use strings for the dimensions; however, doing
so reduces the chance of conflicting with other variables. 
Thus to use the dimensions "M","L", and "T", for mass, length, and time,
respectively, use the commands

<PRE>
(C1) qput(x,"L",dimension)$
(C2) qput(t,"T",dimension)$
(C3) qput(c,"L"/"T",dimension)$
(C4) qput(m,"M",dimension)$
</PRE>

<P>
Then

<PRE>
(C4) dimension(m * 'diff(x,t));
				      L M
(D4) 				      ---
				       T
</PRE>

<P>
An <EM>equation</EM> is dimensionally consistent if either one side of
the equality vanishes or if both sides have the same 
dimensions. Thus

<PRE>
(C5) dimension(x=c*t);

(D5) 				       L
(C6) dimension(x=0);

(D6) 				       L
(C7) dimension(x=c);

Expression is dimensionally inconsistent.
</PRE>

<P>
The  dimension function supports most Maxima operators and it 
automatically maps over lists.  For example,

<PRE>
(C1) dimension([x^3,x.t,x/t,x^^2]);
				 3	 L   2
(D1) 			       [L , L T, -, L ]
					 T
</PRE>

<P>
The dimension of a subscripted symbol is the dimension of the 
non-subscripted variable.  For example,

<PRE>
(C1) dimension(x[3]);
(D1) 				       L
</PRE>

<P>
When the dimensions of a symbol are undefined, dimension returns
an unevaluated expression

<PRE>
(C2) dimension(z);
(D2) 				 dimension(z)
</PRE>

<P>
The remaining functions in the package, <B>dimensionless</B>,
<B>dimension_as_list</B>, and <B>natural_unit</B> require that
all expressions have dimensions that are members of the
list <B>fundamental_dimensions</B>. The default value of this
list is

<PRE>
(C1) fundamental_dimensions;

(D1) 			     [mass, length, time]
</PRE>

<P>
A user may redefine this list; to use "M", "L", and "T" for
the fundamental dimensions, make the assignment

<PRE>
(C2) fundamental_dimensions : ["M", "L", "T"]$
</PRE>

<P>
The list <B>fundamental_dimensions</B> must be nonempty, but it
can have any finite cardinality.

</P>
<P>
To find the dimensions of an expression as a list of the exponents
of the fundamental dimensions, use the <B>dimension_as_list</B> function

<PRE>
(C3) dimension_as_list('diff(x,t,3));

(D3) 				  [0, 1, - 3]
</PRE>

<P>
Thus the dimension of the third derivative of x
with respect to t  is L / T^3.

</P>
<P>
To find the dimensionless expressions that can be formed as a
product of elements of a list of atoms, use the 
<B>dimensionless</B> function. For example,

<PRE>
(C1) dimensionless([c,t,x]);

Dependent equations eliminated:  (1)
				     x
(D1) 				   [---, 1]
				    c t
</PRE>

<P>
Finally, to find quantities that have a given dimension, use
the <B>natural_unit</B> function.  To find an expression with
dimension time, use the command

<PRE>
(C1) natural_unit("T",[x,c]);

Dependent equations eliminated:  (1)
				       x
(D1) 				      [-]
				       c
</PRE>



<H2><A NAME="SEC2" HREF="dimension_toc.html#TOC2">Definitions for Dimensional Analysis</A></H2>

<a name="FUNDAMENTAL_DIMENSIONS"></a><P>
<DL>
<DT><U>Variable:</U> <B>FUNDAMENTAL_DIMENSIONS</B>
<DD><A NAME="IDX1"></A>
FUNDAMENTAL_DIMENSIONS is a list of the fundamental dimensions. The
default value is ["mass", "length", "time"]; however, a user may
redefine it to be any nonempty list of atoms. The function
<B>dimension</B> doesn't use this list, but the other functions
in the dimensional analysis package do use it.

</P>
</DL>

<a name="DIMENSION"></a><P>
<DL>
<DT><U>Function:</U> <B>DIMENSION</B> <I>(e)</I>
<DD><A NAME="IDX2"></A>
Return the dimension of the expression e. If
e is dimensionally inconsistent, signal an error.
The dimensions of the symbols in the expression e
should be first defined using <B>qput</B>.

</P>
</DL>

<a name="DIMENSION_AS_LIST"></a><P>
<DL>
<DT><U>Function:</U> <B>DIMENSION_AS_LIST</B> <I>(e)</I>
<DD><A NAME="IDX3"></A>
Return the dimension of the expression e as a list of
the exponents of the dimensions in the list
<B>fundamental_dimensions</B>. If e is dimensionally 
inconsistent, signal an error.

</P>
</DL>

<a name="DIMENSIONLESS"></a><P>
<DL>
<DT><U>Function:</U> <B>DIMENSIONLESS</B> <I>([e1,e2,...,en])</I>
<DD><A NAME="IDX4"></A>

</P>
<P>
Return a basis for the dimensionless quantities that can be formed as
a product of powers of the expressions e1, e2, ..., en.

</P>
</DL>

<a name="NATURAL_UNIT"></a><P>
<DL>
<DT><U>Function:</U> <B>NATURAL_UNIT</B> <I>(q, [e1,e2,...,en])</I>
<DD><A NAME="IDX5"></A>

</P>
<P>
Return a basis for the quantities that can be formed as a product of
powers of the expressions e1, e2, ..., en that have the
same dimension as does q.

</P>
</DL>

<P>
 

</P>

<P>
  
<P><HR><P>
This document was generated on 7 April 2002 using the
<A HREF="http://wwwcn.cern.ch/dci/texi2html/">texi2html</A>
translator version 1.51a.</P>
</BODY>
</HTML>