Repository navigation
fb_contact_reactions()
-
othe meclib object list (stackjson_parse(objects)) -
nthenamesarray (content of thenamesinput field) -
iindex of the "contact" object
fb_contact_reactions() returns the names the student gave the reactions at a contact, sorted by direction:
-
nNamename of the force along the contact normal (the normal force), -
tNamename of the force along the tangent (the friction force), -
tDirdirection of the friction force as drawn (unit vector), e.g. to read its sense.
Each is false if no such force is found (also while the contact is not deactivated). If there are several, the first one is taken. The tolerance is that of Feedback for "contact" (sine or cosine of the angle below 0.05). Moments and oblique forces are ignored.
It gives no feedback. Check the contact itself with fb_contact() and the names with fb_unique_names(). The function is meant for reference solutions that use the student's names, e.g. equilibrium equations, when several names are accepted for a reaction.
Taken from demo_questions/contact_demo_03 static friction.xml (smooth contact A, rough contact B, tAB points from A to B).
Feedback variables:
obj: stackjson_parse(objects);
[nA, tA, dA]: fb_contact_reactions(obj, names, i_A);
[nB, tB, dB]: fb_contact_reactions(obj, names, i_B);
if member(false, [nA, nB, tB]) then (
txt: "Vervollständigen Sie zuerst den Freischnitt.", ok: false
) else (
sR: signum(float(dB . tAB)), /* sense of the friction force as drawn */
ref: subst([N_A = nA, N_B = nB, R_B = tB], N_B*sin(alpha) - sR*R_B*cos(alpha)),
ok: same_sign(S_GGx, ref),
txt: if ok then "" else fb_vars(S_GGx, ref, [nA, nB, tB, G])
);
The reference is written with fixed names (N_A, N_B, R_B) and the student's names are substituted.
See also fb_reaction_name() (the name of the single reaction at a support).
For tryout use the Meclib Workbench. It requires a local clone of this repository and a local Maxima installation. The workbench includes a rich editor for STACK questions with fast preview including CAStext and Mathjax rendering.
For older versions of Meclib you can use jsfiddle for tryout.
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 id="init">) with the content of the clipboard
The remaining jsfiddle pages don't seem to work any more (as of 04/26)