-
Notifications
You must be signed in to change notification settings - Fork 3
fb_dim
This performs a dimensional check of a result. The user has to provide a list of variables and a list of the corresponding dimensions. The test is based on a proposal by Leo Butler (forum discussion, Github issue).
In order to ensure reasonable results, the test should only be applied to expressions with the correct set of variables (use fb_vars first).
fb_dim(sans, vars, dims)
-
sans
symbolic expression to be checked for the dimension -
vars
list of expected variables in the expression -
dims
list of dimensions for the variables. Use any variable names, which don't interfere with the actual variables in the expression
Returns the dimension of sans
.
To use the function, insert the following command in the question variables:
stack_include("https://raw.githubusercontent.com/mkraska/meclib/main/Maxima/fb_value.mac");
Get the dimension of the expression N*l/(E*A)
, which is the extension of a rod of cross section A
(dimension length²), length l
and Young's modulus E
(dimension force divided by length²) subjected to a force F
. The force dimension is expressed in base dimensions.
We use the names LE
(Längeneinheit, length unit) for length, ME
for mass, and TE
for time (Zeit).
vars: [N, l, A, E];
FE: ME*LE/ZE^2;
dims: [FE, LE, LE^2, FE/LE^2];
D: fb_dim( N*l/(E*A), vars, dims);
results in D
equal to LE
.
If the result is free of any of the variables in vars
, then the dimensions of the expression are consistent.
Used in question TM2 01 T05.
In order to try code snippets in jsfiddle,
- copy the code from the wiki page to the clipboard
- follow the link for the JSXGraph version you want to try
- Replace the code in the HTML section (contents of
<p hidden id="init">
) with the content of the clipboard