1 /* First load the necessary file: */
3 /* It is conjectured that for thermistors there is a physical
4 relationship between the voltage drop, current, ambient temperature,
5 room-temperature resistance, convective heat transfer coefficient, and
6 a constant, BETA, having the dimension of temperature. First, to see
7 if the dimension of BETA is already known: */
9 /* It is not. To establish it: */
10 dimension(beta=temperature);
11 /* To automatically determine a set of dimensionless variables
12 sufficient to characterize the physical relation: */
13 nondimensionalize([voltage, current, temperature, resistance,
14 heattransfercoefficient, beta]);
15 /* We learn that the relation may be expressed as a function of
16 only the above 3 variables rather than a function of the six physical
17 quantities. Evidently dimensions were preestablished for all but the
18 last of these particular input quantities, but an appropriate error
19 message would have informed us if this were not so. An extensive
20 set of dimensions have been prestablished, as may be seen from the
23 As another example, there is thought to be a relation between the
24 viscosity, average velocity, molecular mass, and repulsion
25 coefficient of a gas. The repulsive force between two molecules is
26 believed to be of the form K/DISTANCE^N, with unknown N, so K must
27 have the following dimensions: */
28 dimension(k=mass*length^(n+1)/time^2) $
29 /* To get the computation time in milliseconds to be printed
32 /* To do a dimensional analysis of the gas viscosity problem: */
33 nondimensionalize([viscosity, k, mass, velocity]);
34 /* The physical relation must be expressible as a function of
35 this one dimensionless variable, or equivalently, this variable must
36 equal a constant. Consequently, physical measurements may be used
37 to determine N. It turns out to be in the range 7 to 12 for common
40 As a final example, suppose that we conjecture a relation between the
41 deflection angle of a light ray, the mass of a point mass, the speed
42 of light, and the distance from the mass to the point of closest
44 nondimensionalize([angle, mass, length, speedoflight]);
45 /* We learn that there cannot be a dimensionless relation
46 connecting all of these quantities and no others. Let us also try
47 including the constant that enters the inverse-square law of
49 nondimensionalize([angle, mass, length, speedoflight,
51 /* Altermatively, for astrophysics problems such as this,we may
52 prefer to use a dimensional basis in which the gravity constant is
53 taken as a pure number, eliminating one member from our dimensional
55 %pure: cons(gravityconstant, %pure);
56 /* Note that the latter two of the above constants are pure
57 numbers by default, respectively eliminating TEMPERATURE and CHARGE
58 from the basis, but the user may include all five of TEMPERATURE,
59 CHARGE, MASS, LENGTH, and TIME in the basis by resetting %PURE to [].
60 Altermatively, the user may wish to include SPEEDOFLIGHT in %PURE for
61 relativistic problems or PLANCKSCONSTANT for quantum problems. For
62 dimensional analysis it doesn't really matter which basis member is
63 eliminated by each pure constant, but in fact the latter two
64 respectively eliminate LENGTH and TIME, whereas GRAVITYCONSTANT
67 To proceed with our analysis: */
68 nondimensionalize([angle, mass, length, speedoflight]);