// Numbas version: exam_results_page_options {"name": "Equilibrium of a rigid body: cantilever beam", "extensions": ["geogebra", "quantities"], "custom_part_types": [{"source": {"pk": 12, "author": {"name": "William Haynes", "pk": 2530}, "edit_page": "/part_type/12/edit"}, "name": "Angle quantity 2020", "short_name": "angle", "description": "

Adjusts all angles to 0< $\\theta$ < 360.

\n

Accepts '°' and 'deg' as units.

\n

Penalizes if not close enough or no units.

\n

90° = -270° = 450°

numeric part of students answer, which is a quantity.

", "definition": "matchnumber(studentAnswer,['plain','en'])[1]"}], "settings": [{"name": "expected_answer", "label": "Expected Answer", "help_url": "", "hint": "Expected angle as a quantity.", "input_type": "code", "default_value": "qty(30,'deg')", "evaluate": true}, {"name": "unit_penalty", "label": "Unit penalty", "help_url": "", "hint": "Penalty for not including degree sign or 'deg'.", "input_type": "percent", "default_value": "20"}, {"name": "close_penalty", "label": "Close Penalty", "help_url": "", "hint": "Penalty for close answer.", "input_type": "percent", "default_value": "20"}, {"name": "close_tol", "label": "Close", "help_url": "", "hint": "Angle must be $\\pm$ this many degrees to be marked close.   ", "input_type": "code", "default_value": "0.5", "evaluate": false}, {"name": "right_tol", "label": "Right ", "help_url": "", "hint": "Angle must be $\\pm$ this many degrees to be marked correct.  ", "input_type": "code", "default_value": "0.1", "evaluate": false}], "public_availability": "restricted", "published": false, "extensions": ["quantities"]}, {"source": {"pk": 19, "author": {"name": "William Haynes", "pk": 2530}, "edit_page": "/part_type/19/edit"}, "name": "Engineering Accuracy with units", "short_name": "engineering-answer", "description": "

A value with units marked right if within an adjustable % error of the correct value.  Marked close if within a wider margin of error.

Does clumsy substitution to

\n

1. replace '-' with ' '

\n

2. replace '°' with ' deg'

\n

to allow answers like 10 ft-lb and 30°

", "name": "student_units"}, {"definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n", "description": "", "name": "good_units"}, {"definition": "switch(not good_units, \n student_scalar * correct_units, \n not right_sign,\n -quantity(student_scalar, student_units),\n quantity(student_scalar,student_units)\n)\n \n", "description": "

This fixes the student answer for two common errors.

\n

If student_units are wrong  - replace with correct units

\n

If student_scalar has the wrong sign - replace with right sign

\n

If student makes both errors, only one gets fixed.

", "name": "student_quantity"}, {"definition": "try(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n ", "description": "", "name": "percent_error"}, {"definition": "percent_error <= settings['right']\n", "description": "", "name": "right"}, {"definition": "right_sign and percent_error <= settings['close']", "description": "

Only marked close if the student actually has the right sign.

", "name": "close"}, {"definition": "sign(student_scalar) = sign(correct_quantity) ", "description": "", "name": "right_sign"}], "settings": [{"input_type": "code", "evaluate": true, "hint": "The correct answer given as a JME quantity.", "default_value": "", "label": "Correct Quantity.", "help_url": "", "name": "correctAnswer"}, {"input_type": "code", "evaluate": true, "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "default_value": "0.2", "label": "% Accuracy for right.", "help_url": "", "name": "right"}, {"input_type": "code", "evaluate": true, "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "default_value": "1.0", "label": "% Accuracy for close.", "help_url": "", "name": "close"}, {"input_type": "percent", "hint": "Partial Credit for close value with appropriate units.  if correct answer is 100 N and close is ±1%,
99  N is accepted.", "default_value": "75", "label": "Close with units.", "help_url": "", "name": "C1"}, {"input_type": "percent", "hint": "Partial credit for forgetting units or using wrong sign.
If the correct answer is 100 N, both 100 and -100 N are accepted.", "default_value": "50", "label": "No units or wrong sign", "help_url": "", "name": "C2"}, {"input_type": "percent", "hint": "Partial Credit for close value but forgotten units.
This value would be close if the expected units were provided.  If the correct answer is 100 N, and close is ±1%,
99 is accepted.", "default_value": "25", "label": "Close, no units.", "help_url": "", "name": "C3"}], "public_availability": "restricted", "published": false, "extensions": ["quantities"]}], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Equilibrium of a rigid body: cantilever beam", "tags": ["angle_from_ref", "equilibrium", "Equilibrium", "fixed support", "mechanics", "Mechanics", "rigid body", "Rigid Body", "Statics", "statics"], "metadata": {"description": "

Determine the reactions supporting a cantilever beam carrying concentrated forces and moments.

", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "

{geogebra_applet('v5xfnaym',[['A',A],['B',B],['L',L],['units','\"'+units[1]+'\"'],['fa',FA], ['fc',FC], ['M',M]])}

\n

\n

A beam of length L = {L} {units[1]} is supported by a fixed (cantilever) support at O. Detemine the reactions at O when the beam supports these loads:

\n

A = {magA} {units[0]}, B = {abs(M)} {units[0]}-{units[1]} and C = {magC} {units[0]}, as shown.

\n

Draw a free body diagaram of the beam, then apply the equations of equilibrium.

\n

\n

$\\Sigma M = 0$

\n

$M_O + M_A + M_B + M_C = 0$

\n

$M_A = d_1 A_y$ = ({OA}) ({qty(abs(FA[1]),units[0])}) = {abs(MA)} {if(sign(MA)>0,'counterclockwise','clockwise')}

\n

$M_B =$ {abs(MB)} {if(sign(MB)>0,'counterclockwise','clockwise')}

\n

$M_C = L C_y$ = ({OC}) ({format(qty(abs(FC[1]),units[0]))}) = {format(abs(MC))} {if(sign(MC)>0,'counterclockwise','clockwise')}

\n

$M_O = - ( \\var{format(MA)} + \\var{format(MB)} + \\var{format(MC)} ) = \\var{format(abs(MO))}$ {if(sign(MO)>0,'counterclockwise','clockwise')}

\n

\n

$\\Sigma F_x = 0$

\n

$O_x + A_x + C_x = 0$

\n

$O_x = 0 - C_x = \\var{format(qty(abs(FO[0]), units[0]))}$ {if(sign(FO[0])>=0,'right','left')}

\n

\n

$\\Sigma F_y = 0$

\n

$O_y + A_y + C_y = 0$

\n

$O_y = - (A_y + C_y) = - ( \\var{FA[1]} + \\var{siground(FC[1],4)} )= \\var{format(qty(abs(FO[1]), units[0]))}$  {if(sign(FO[1])>=0,'up','down')}

\n

\n

Resolve $O_x$ and $O_y$ to get

\n

Force $O = \\var{format(qty(abs(FO), units[0]))}$ at an angle of {format(dirO)} from the positve x-axis.

", "rulesets": {}, "extensions": ["geogebra", "quantities"], "variables": {"FO": {"name": "FO", "group": "output", "definition": "-(FA+FC)", "description": "

The resultant force at O as a vector.

", "templateType": "anything"}, "A": {"name": "A", "group": "Input", "definition": "random(0.2..0.8#0.1)", "description": "", "templateType": "anything"}, "FC": {"name": "FC", "group": "Input", "definition": "magC vector(cos(radians(theta_C)),sin(radians(theta_C)))", "description": "", "templateType": "anything"}, "B": {"name": "B", "group": "Input", "definition": "random(A..0.9#0.1)", "description": "", "templateType": "anything"}, "OA": {"name": "OA", "group": "output", "definition": "qty(A L, units[1])", "description": "

distance from O to A

", "templateType": "anything"}, "MA": {"name": "MA", "group": "output", "definition": "qty(cross(vector(scalar(OA),0,0),vector(FA[0],\n FA[1],0))[2],\nunits[0] + \" \" + units[1])\n\n", "description": "

Moment of force A about point O.

", "templateType": "anything"}, "units": {"name": "units", "group": "Input", "definition": "random(['N','m'],['lb','ft'])", "description": "", "templateType": "anything"}, "debug": {"name": "debug", "group": "Input", "definition": "false", "description": "", "templateType": "anything"}, "MB": {"name": "MB", "group": "output", "definition": "qty(M,units[0] + \" \" + units[1])\n", "description": "

The concentrated moment.

", "templateType": "anything"}, "magA": {"name": "magA", "group": "Input", "definition": "random(10..150#10)", "description": "", "templateType": "anything"}, "OB": {"name": "OB", "group": "output", "definition": "qty(B L, units[1])", "description": "

distance from O to B

", "templateType": "anything"}, "L": {"name": "L", "group": "Input", "definition": "if(units[1]='ft',random(2..12#2),random(1..5))", "description": "", "templateType": "anything"}, "MagC": {"name": "MagC", "group": "Input", "definition": "random(10..150#10)", "description": "", "templateType": "anything"}, "dirO": {"name": "dirO", "group": "output", "definition": "qty(mod(degrees(atan2(FO[1],FO[0])),360),'deg')", "description": "", "templateType": "anything"}, "FA": {"name": "FA", "group": "Input", "definition": "MagA vector(0,random(1,-1))", "description": "", "templateType": "anything"}, "OC": {"name": "OC", "group": "output", "definition": "qty(L, units[1])", "description": "

distance from O to C

", "templateType": "anything"}, "MO": {"name": "MO", "group": "output", "definition": "-(MA + MB + MC)", "description": "

The reaction moment at O.

", "templateType": "anything"}, "M": {"name": "M", "group": "Input", "definition": "random(100..500#25) random(1,-1)", "description": "

The magnitude of the moment.

", "templateType": "anything"}, "theta_c": {"name": "theta_c", "group": "Input", "definition": "random(0..355#5 except [0,90,180,270])", "description": "", "templateType": "anything"}, "MC": {"name": "MC", "group": "output", "definition": "qty(cross(vector(scalar(OC),0,0),\n vector(FC[0],FC[1],0))[2],\n units[0] + \" \" + units[1])\n \n \n ", "description": "

Moment of force C about point O.

", "templateType": "anything"}}, "variablesTest": {"condition": "B-A > 0.2", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "Input", "variables": ["L", "A", "B", "units", "FA", "magA", "MagC", "theta_c", "FC", "M", "debug"]}, {"name": "output", "variables": ["OA", "OC", "OB", "MA", "MC", "MB", "MO", "FO", "dirO"]}], "functions": {"format": {"parameters": [["q", "quantity"]], "type": "string", "language": "jme", "definition": "string(siground(q,4))"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Moment at O", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Determine the magnitude and direction of the moment at the fixed support at O.

\n

$M_O$ = [[0]]  [[1]]  {format(MO)}