// Numbas version: finer_feedback_settings {"name": "Chapter 9 Exercises", "metadata": {"description": "

End of chapter exercises for Engineering Statics: Open and Interactive 

", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "duration": 0, "percentPass": 0, "showQuestionGroupNames": true, "shuffleQuestionGroups": false, "showstudentname": true, "question_groups": [{"name": "Group", "pickingStrategy": "all-ordered", "pickQuestions": 1, "questionNames": ["", "", "", "", "", ""], "variable_overrides": [[], [], [], [], [], []], "questions": [{"name": "Friction: Block on Incline", "extensions": ["geogebra", "quantities"], "custom_part_types": [{"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.

", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "siground(settings['correctAnswer'],4)", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nswitch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n\n\ninterpreted_answer:\nqty(student_scalar, student_units)\n\n\n\ncorrect_quantity:\nsettings[\"correctAnswer\"]\n\n\n\ncorrect_units:\nunits(correct_quantity)\n\n\nallowed_notation_styles:\n[\"plain\",\"en\"]\n\nmatch_student_number:\nmatchnumber(studentAnswer,allowed_notation_styles)\n\nstudent_scalar:\nmatch_student_number[1]\n\nstudent_units:\nreplace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")\n\ngood_units:\ntry(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n\n\nstudent_quantity:\nswitch(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\n\npercent_error:\ntry(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n \n\nright:\npercent_error <= settings['right']\n\n\nclose:\nright_sign and percent_error <= settings['close']\n\nright_sign:\nsign(student_scalar) = sign(correct_quantity)", "marking_notes": [{"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "switch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "qty(student_scalar, student_units)\n\n"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]\n\n"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)\n"}, {"name": "allowed_notation_styles", "description": "", "definition": "[\"plain\",\"en\"]"}, {"name": "match_student_number", "description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)"}, {"name": "student_scalar", "description": "", "definition": "match_student_number[1]"}, {"name": "student_units", "description": "

Modify the unit portion of the student's answer by

\n

1. replacing \"ohms\" with \"ohm\"  case insensitive

\n

2. replacing '-' with ' ' 

\n

3. replacing '°' with ' deg' 

\n

to allow answers like 10 ft-lb and 30°

", "definition": "replace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")"}, {"name": "good_units", "description": "", "definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n"}, {"name": "student_quantity", "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.

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

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

", "definition": "right_sign and percent_error <= settings['close']"}, {"name": "right_sign", "description": "", "definition": "sign(student_scalar) = sign(correct_quantity) "}], "settings": [{"name": "correctAnswer", "label": "Correct Quantity.", "help_url": "", "hint": "The correct answer given as a JME quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "right", "label": "% Accuracy for right.", "help_url": "", "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "0.2", "evaluate": true}, {"name": "close", "label": "% Accuracy for close.", "help_url": "", "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "1.0", "evaluate": true}, {"name": "C1", "label": "Close with units.", "help_url": "", "hint": "Partial Credit for close value with appropriate units.  if correct answer is 100 N and close is ±1%,
99  N is accepted.", "input_type": "percent", "default_value": "75"}, {"name": "C2", "label": "No units or wrong sign", "help_url": "", "hint": "Partial credit for forgetting units or using wrong sign.
If the correct answer is 100 N, both 100 and -100 N are accepted.", "input_type": "percent", "default_value": "50"}, {"name": "C3", "label": "Close, no units.", "help_url": "", "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.", "input_type": "percent", "default_value": "25"}], "public_availability": "always", "published": true, "extensions": ["quantities"]}], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}], "tags": ["Equilibrium", "equilibrium", "friction", "Mechanics", "mechanics", "Statics", "statics"], "metadata": {"description": "

Determine frictional force acting on a block on an incline.  Coefficients of friction, weight and a horizontal force are given

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

{applet()}

\n

A {qty(P,units[1])} horizontal force $P$ is applied to a {qty(W,units[1])} box resting on an {theta}° incline.  The line of action of $P$ passes through the center of gravity of the box.  The box is  $\\var{qty(WIDTH,units[0])}$ wide $\\times \\ \\var{qty(HEIGHT,units[0]) }$ tall, and the coefficents of friction between the box and the surface are $\\mu_s = \\var{mu_s}$ and $\\mu_k = \\var{mu_k}$.

\n

", "advice": "

Establish a coordinate system parallel and perpendicular to the incline, and draw a free body diagram of the box.  At this point we don't know whether the box is in equilibrium or the direction of the frictional force, so we will provisionally assume that the box is in equilibrium and that the frictional force acts up the incline.  A assumed friction force acting up the incline implies that the box is sliding down the incline.

\n

Calculate the force require to hold the box in equilibrium

\n

$\\begin{align} \\sum F_x &= 0 &\\sum F_y &=0\\\\ F &= -P_x + W_x &  N &= P_y + W_y \\\\& = -P \\cos \\theta + W \\sin \\theta &  &= P \\sin \\theta + W \\cos \\theta\\\\ & = -\\var{P} \\cos \\var{theta}° + \\var{W} \\sin \\var{theta}° & &= \\var{P} \\sin \\var{theta}° + \\var{W} \\cos \\var{theta}°\\\\ &= -\\var{siground(P_x,4)}+\\var{siground(W_x,4)} &&= \\var{siground(P_y,4)} + \\var{siground(W_y,4)} \\\\F &= \\var{siground(qty(F,units[1]),4)} & N &= \\var{siground(qty(N,units[1]),4)} \\end{align}$

\n

Calculate the available frictional force

\n

$F_s = \\mu_s N = (\\var{mu_s})\\ (\\var{siground(N,4)}) = \\var{siground(qty(F_s, units[1]),4)}$

\n

$F_k = \\mu_k N = (\\var{mu_k})\\ (\\var{siground(N,4)}) = \\var{siground(qty(F_k, units[1]),4)}$

\n

Draw Conclusions

\n

Since the absolute value of the required force $F$ is less than the available static friction force $F_s$, the box is in equilibrium. The magnitude of the  actual friction force is $F = \\var{siground(qty(abs(F),units[1]),4)}$.

\n

Since the absolute value of the required force $F$ is equal to the available static friction force $F_s$, the box is in equilibrium, but on the verge of motion. The magnitude of the actual friction force is $F = F_s = \\var{siground(qty(abs(F),units[1]),4)}$.

\n

Since the absolute value of the required force $F$ is greater than the available static friction force $F_s$, the box is sliding. The magnitude of the actual friction force is $F = F_k = \\var{siground(qty(F_k,units[1]),4)}$.

\n

Since the sign on the required frictional force $F$ is negative, the assumption that friction acts up the incline is incorrect.  The actual force acts down the incline, which means that the box being pushed up the incline.

\n

Since the sign on the required frictional force $F$ is positive, the assumed friction direction is correct and the box is sliding down the incline.

\n

Check that no tipping occurs.

\n

The resultant frictional and normal forces can be considered to act at a single point. The location of this point can be found by performing a moment equilibrium about a convenient point.  We choose the center of gravity, where the lines of action of the weight and the load $P$ intersect, and use the actual value of the frictional force, which is $F$ if the box is in equilibrium, $F_k$ if the box is sliding.  If distance $d$ is greater than half the width of the box, it tips.

\n

$\\begin{align} \\sum M_C &= 0\\\\ N(d) &= F(h/2) \\\\ d &= \\frac{F h}{2 N} \\\\ &= \\frac{(\\var{siground(F_actual,4)})( \\var{height})}{(2) (\\var{siground(N,4)})} \\\\ &= \\var{siground(qty(d,units[0]),3)} \\end{align}$

\n

Since $|d| <= \\var{qty(WIDTH/2,units[0])}$, the block is not tipping.

\n

Since $|d| > \\var{qty(WIDTH/2,units[0])}$, the block is tipping.

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"theta": {"name": "theta", "group": "Inputs", "definition": "random(15..35)", "description": "", "templateType": "anything", "can_override": false}, "WIDTH": {"name": "WIDTH", "group": "Inputs", "definition": "random(3..8#0.5)", "description": "", "templateType": "anything", "can_override": false}, "HEIGHT": {"name": "HEIGHT", "group": "Inputs", "definition": "random(2..5#0.5)", "description": "", "templateType": "anything", "can_override": false}, "diag": {"name": "diag", "group": "computed", "definition": "sqrt(HEIGHT^2+WIDTH^2)", "description": "

diagonal of box

", "templateType": "anything", "can_override": false}, "phi": {"name": "phi", "group": "computed", "definition": "degrees(arctan(HEIGHT/WIDTH))", "description": "", "templateType": "anything", "can_override": false}, "mu_s": {"name": "mu_s", "group": "Inputs", "definition": "random(0.1..0.7#0.05)", "description": "", "templateType": "anything", "can_override": false}, "mu_k": {"name": "mu_k", "group": "Inputs", "definition": "siground(mu_s random(0.75..0.9#0.01),2)", "description": "", "templateType": "anything", "can_override": false}, "units": {"name": "units", "group": "Inputs", "definition": "random([['ft','lb'], ['m','kN']])", "description": "", "templateType": "anything", "can_override": false}, "W": {"name": "W", "group": "Inputs", "definition": "random(20..250#10)", "description": "

magnitude of weight

", "templateType": "anything", "can_override": false}, "P": {"name": "P", "group": "Inputs", "definition": "random(20..400#10)", "description": "

magnitude of horizontal force

", "templateType": "anything", "can_override": false}, "F": {"name": "F", "group": "vector solution", "definition": "dot(F_Q,u)", "description": "", "templateType": "anything", "can_override": false}, "P_x": {"name": "P_x", "group": "computed", "definition": "P cos(radians(theta))", "description": "", "templateType": "anything", "can_override": false}, "P_y": {"name": "P_y", "group": "computed", "definition": "P sin(radians(theta))", "description": "", "templateType": "anything", "can_override": false}, "W_x": {"name": "W_x", "group": "computed", "definition": "W sin(radians(theta))", "description": "", "templateType": "anything", "can_override": false}, "W_y": {"name": "W_y", "group": "computed", "definition": "W cos(radians(theta))", "description": "", "templateType": "anything", "can_override": false}, "N": {"name": "N", "group": "vector solution", "definition": "dot(F_Q,v)", "description": "", "templateType": "anything", "can_override": false}, "F_s": {"name": "F_s", "group": "computed", "definition": "N mu_s", "description": "", "templateType": "anything", "can_override": false}, "F_k": {"name": "F_k", "group": "computed", "definition": "N mu_k", "description": "", "templateType": "anything", "can_override": false}, "u": {"name": "u", "group": "vector solution", "definition": "vector(cos(radians(theta)),sin(radians(theta)))", "description": "", "templateType": "anything", "can_override": false}, "v": {"name": "v", "group": "vector solution", "definition": "vector(-sin(radians(theta)), cos(radians(theta)))", "description": "", "templateType": "anything", "can_override": false}, "ii": {"name": "ii", "group": "vector solution", "definition": "vector(1,0)", "description": "", "templateType": "anything", "can_override": false}, "jj": {"name": "jj", "group": "vector solution", "definition": "vector(0,1)", "description": "", "templateType": "anything", "can_override": false}, "F_Q": {"name": "F_Q", "group": "vector solution", "definition": "-(F_W + F_P)", "description": "

force of incline on block

", "templateType": "anything", "can_override": false}, "F_W": {"name": "F_W", "group": "vector solution", "definition": "-jj W", "description": "", "templateType": "anything", "can_override": false}, "F_P": {"name": "F_P", "group": "vector solution", "definition": "P ii", "description": "", "templateType": "anything", "can_override": false}, "Wx": {"name": "Wx", "group": "vector solution", "definition": "dot(F_W,u)", "description": "", "templateType": "anything", "can_override": false}, "Wy": {"name": "Wy", "group": "vector solution", "definition": "dot(F_W,v)", "description": "", "templateType": "anything", "can_override": false}, "Px": {"name": "Px", "group": "vector solution", "definition": "dot(F_P,u)", "description": "", "templateType": "anything", "can_override": false}, "Py": {"name": "Py", "group": "vector solution", "definition": "dot(F_P,v)", "description": "", "templateType": "anything", "can_override": false}, "d": {"name": "d", "group": "computed", "definition": "F_actual Height/ 2/N", "description": "

distance from center to point A where friction acts.

", "templateType": "anything", "can_override": false}, "F_actual": {"name": "F_actual", "group": "computed", "definition": "if(abs(F) <= F_s, F, F_k)", "description": "", "templateType": "anything", "can_override": false}, "tipping": {"name": "tipping", "group": "conclusions", "definition": "abs(d) > WIDTH/2", "description": "", "templateType": "anything", "can_override": false}, "equilibrium": {"name": "equilibrium", "group": "conclusions", "definition": "abs(F) <= F_s", "description": "", "templateType": "anything", "can_override": false}, "slipping_up": {"name": "slipping_up", "group": "conclusions", "definition": "F<0", "description": "", "templateType": "anything", "can_override": false}, "slipping_down": {"name": "slipping_down", "group": "conclusions", "definition": "F>0", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": " diag/2 sin(radians(theta + phi)) < HEIGHT cos(radians(theta)) // keep P on box\nand diag sin(radians(theta +phi)) < 7 // keep top right corner of box in diagram.\nand (theta + phi) < 80 // keep CG over bottom of box", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "computed", "variables": ["diag", "phi", "F", "P_x", "P_y", "W_x", "W_y", "N", "F_s", "F_k", "d", "F_actual"]}, {"name": "Inputs", "variables": ["theta", "HEIGHT", "WIDTH", "mu_s", "mu_k", "units", "W", "P"]}, {"name": "vector solution", "variables": ["u", "v", "ii", "jj", "F_Q", "N", "F_W", "F_P", "F", "Wx", "Wy", "Px", "Py"]}, {"name": "conclusions", "variables": ["tipping", "equilibrium", "slipping_up", "slipping_down"]}], "functions": {"applet": {"parameters": [], "type": "ggbapplet", "language": "javascript", "definition": "//{geogebra_applet('mgahtzn8', [ 'H':[ definition: HEIGHT, visible: false], 'W':[ definition: WIDTH, visible: false],'\u03b8': [definition: radians(THETA), visible: false], 'show': [definition: \"false\" , visible: false] ])}\n\n\n// Create the worksheet. \n// This function returns an object with a container `element` and a `promise` resolving to a GeoGebra applet.\nvar params = {\n material_id: 'mgahtzn8'\n}\n\nvar result = Numbas.extensions.geogebra.createGeogebraApplet(params);\n\n// Once the applet has loaded, run some commands to manipulate the worksheet.\nresult.promise.then(function(d) {\n var app = d.app;\n question.applet = d;\n \nfunction setGGBNumber(g_name, n_name = g_name) {\n // Sets number in GGB to a Numbas Variable\n var n = scope.getVariable(n_name).value;\n app.setValue(g_name,n);\n app.setVisible(g_name,false);\n }\n \n function setGGBAngle(gname, nname=gname) {\n // Sets angle in GGB to a Numbas Variable given in degrees.\n var v = Math.PI / 180 * Numbas.jme.unwrapValue(question.scope.getVariable(nname));\n app.setValue(gname,v);\n } \n \n \n //initialize the dimensions and forces\n setGGBNumber('H','HEIGHT');\n setGGBNumber('W','WIDTH');\n setGGBAngle('\u03b8', 'THETA');\n app.setValue('show',\"false\");\n app.setVisible('H',false,false);\n app.setVisible('W',false,false);\n app.setVisible('\u03b8',false,false);\n app.setVisible('show',false,false);\n \n \n \n});\n\n// This function returns the result of `createGeogebraApplet` as an object \n// with the JME data type 'ggbapplet', which can be substituted into the question's content.\nreturn new Numbas.jme.types.ggbapplet(result);\n"}}, "preamble": {"js": "question.signals.on('adviceDisplayed',function() {\n try{\n var app = question.applet.app;\n \n app.setVisible('show', true);\n app.setValue('show',true);\n \n }\n catch(err){} \n})\n\n\n", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "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 of the friction force acting on the box.

\n

$F$ = [[0]]

\n

The box is [[1]]

", "gaps": [{"type": "engineering-answer", "useCustomName": true, "customName": "Friction", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(F_actual,units[1])", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}, {"type": "1_n_2", "useCustomName": true, "customName": "Direction", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["In static equilibrium", "Sliding up the incline", "Sliding down the incline.", "Tipping"], "matrix": ["if(equilibrium,10,0)", "if(slipping_up,10,0)", "if(slipping_down,10,0)", "if(tipping,10,0)"], "distractors": ["", "", "", ""]}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Friction: Determine direction of $F_f$", "extensions": ["quantities"], "custom_part_types": [{"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.

", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "siground(settings['correctAnswer'],4)", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nswitch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n\n\ninterpreted_answer:\nqty(student_scalar, student_units)\n\n\n\ncorrect_quantity:\nsettings[\"correctAnswer\"]\n\n\n\ncorrect_units:\nunits(correct_quantity)\n\n\nallowed_notation_styles:\n[\"plain\",\"en\"]\n\nmatch_student_number:\nmatchnumber(studentAnswer,allowed_notation_styles)\n\nstudent_scalar:\nmatch_student_number[1]\n\nstudent_units:\nreplace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")\n\ngood_units:\ntry(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n\n\nstudent_quantity:\nswitch(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\n\npercent_error:\ntry(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n \n\nright:\npercent_error <= settings['right']\n\n\nclose:\nright_sign and percent_error <= settings['close']\n\nright_sign:\nsign(student_scalar) = sign(correct_quantity)", "marking_notes": [{"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "switch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "qty(student_scalar, student_units)\n\n"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]\n\n"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)\n"}, {"name": "allowed_notation_styles", "description": "", "definition": "[\"plain\",\"en\"]"}, {"name": "match_student_number", "description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)"}, {"name": "student_scalar", "description": "", "definition": "match_student_number[1]"}, {"name": "student_units", "description": "

Modify the unit portion of the student's answer by

\n

1. replacing \"ohms\" with \"ohm\"  case insensitive

\n

2. replacing '-' with ' ' 

\n

3. replacing '°' with ' deg' 

\n

to allow answers like 10 ft-lb and 30°

", "definition": "replace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")"}, {"name": "good_units", "description": "", "definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n"}, {"name": "student_quantity", "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.

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

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

", "definition": "right_sign and percent_error <= settings['close']"}, {"name": "right_sign", "description": "", "definition": "sign(student_scalar) = sign(correct_quantity) "}], "settings": [{"name": "correctAnswer", "label": "Correct Quantity.", "help_url": "", "hint": "The correct answer given as a JME quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "right", "label": "% Accuracy for right.", "help_url": "", "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "0.2", "evaluate": true}, {"name": "close", "label": "% Accuracy for close.", "help_url": "", "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "1.0", "evaluate": true}, {"name": "C1", "label": "Close with units.", "help_url": "", "hint": "Partial Credit for close value with appropriate units.  if correct answer is 100 N and close is ±1%,
99  N is accepted.", "input_type": "percent", "default_value": "75"}, {"name": "C2", "label": "No units or wrong sign", "help_url": "", "hint": "Partial credit for forgetting units or using wrong sign.
If the correct answer is 100 N, both 100 and -100 N are accepted.", "input_type": "percent", "default_value": "50"}, {"name": "C3", "label": "Close, no units.", "help_url": "", "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.", "input_type": "percent", "default_value": "25"}], "public_availability": "always", "published": true, "extensions": ["quantities"]}], "resources": [["question-resources/hw5sol1.png", "/srv/numbas/media/question-resources/hw5sol1.png"], ["question-resources/block_TxlOZUk.svg", "/srv/numbas/media/question-resources/block_TxlOZUk.svg"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Vladimir Vingoradov", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1862/"}, {"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}, {"name": "Haoyu Huang", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/17657/"}], "tags": [], "metadata": {"description": "

Friction

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

\n

Determine whether the block shown is in equilibrium and find the magnitude and direction of the friction force when $\\mu_s = 0.20$, $\\mu_k = 0.15$, $\\theta=\\var{th}^\\circ$ and $P=\\var{P}\\,\\text{N}$

\n

", "advice": "

\n

(a)

\n

Assume equilibrium

\n

$+\\!\\!\\nearrow\\sum F_y=0,\\quad\\implies\\quad N-(800\\,\\text{N})\\cos 25^\\circ +(\\var{P}\\,\\text{N})\\sin(\\var{th}^\\circ-25^\\circ)=0$

\n

$N=\\var{normal_force}\\,\\text{N}$

\n

$+\\!\\!\\searrow\\sum F_x=0,\\quad\\implies\\quad -F_\\mu+(800\\,\\text{N})\\sin 25^\\circ-(\\var{P}\\,\\text{N})\\cos (\\var{th}^\\circ-25^\\circ)=0$

\n

$F_\\mu=\\var{friction_force_trial}\\,\\text{N}$ is required for equilibrium.

\n

Maximum friction force: $F_m=\\mu_s N=0.2\\times\\var{normal_force}=\\var{max_friction_force}\\,\\text{N}$

\n
\n

Since $|F_\\mu| > F_m$, the block is sliding, 

\n

(b)

\n

and the magmitude of the friction force is

\n

\\[F_\\mu=\\mu_k N=\\var{abs(friction_force)}\\,\\text{N},\\quad\\var{direction_string}\\] 

\n
\n

\n
\n

Since $|F_\\mu| \\le F_m$, the block is in equilibrium, and

\n

(b)

\n

The magmitude of the friction force is

\n

\\[F_\\mu=\\var{abs(friction_force)}\\,\\text{N},\\quad\\var{direction_string}\\] 

\n
", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"mu_s": {"name": "mu_s", "group": "Ungrouped variables", "definition": "0.2", "description": "", "templateType": "number", "can_override": false}, "th": {"name": "th", "group": "Ungrouped variables", "definition": "random(25 .. 70#5)", "description": "", "templateType": "randrange", "can_override": false}, "mu_k": {"name": "mu_k", "group": "Ungrouped variables", "definition": "0.15", "description": "", "templateType": "anything", "can_override": false}, "friction_force_trial": {"name": "friction_force_trial", "group": "Ungrouped variables", "definition": "precround(800*sin(radians(25))-P*cos(radians(th-25)),1)", "description": "

Positive if up the slope

", "templateType": "anything", "can_override": false}, "equil": {"name": "equil", "group": "Ungrouped variables", "definition": "if(abs(friction_force_trial)<=(mu_s*normal_force),[10,0],[0,10])", "description": "", "templateType": "anything", "can_override": false}, "direction": {"name": "direction", "group": "Ungrouped variables", "definition": "if(friction_force<0,[0,10],[10,0])", "description": "", "templateType": "anything", "can_override": false}, "max_friction_force": {"name": "max_friction_force", "group": "Ungrouped variables", "definition": "precround(mu_s*normal_force,1)", "description": "", "templateType": "anything", "can_override": false}, "normal_force": {"name": "normal_force", "group": "Ungrouped variables", "definition": "precround(800*cos(radians(25))-P*sin(radians(th-25)),1)", "description": "", "templateType": "anything", "can_override": false}, "friction_force": {"name": "friction_force", "group": "Ungrouped variables", "definition": "if(abs(friction_force_trial)<=(mu_s*normal_force),friction_force_trial,sign(friction_force_trial)*precround(mu_k*normal_force,1))", "description": "", "templateType": "anything", "can_override": false}, "direction_string": {"name": "direction_string", "group": "Ungrouped variables", "definition": "if(friction_force<0,\"down the slope\",\"up the slope\")", "description": "", "templateType": "anything", "can_override": false}, "P": {"name": "P", "group": "Ungrouped variables", "definition": "random(100 .. 500#20)", "description": "", "templateType": "randrange", "can_override": false}, "W": {"name": "W", "group": "Ungrouped variables", "definition": "\"800 N\"", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["th", "P", "normal_force", "mu_s", "mu_k", "friction_force_trial", "max_friction_force", "equil", "friction_force", "direction", "direction_string", "W"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Answers", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

Is the block in static equilibrium? [[0]]

\n

The magnitude of the friction force is [[1]]

\n

The friction force acts [[2]].

", "gaps": [{"type": "1_n_2", "useCustomName": true, "customName": "In equilibrium", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["

Yes

", "

No

"], "matrix": "{equil}"}, {"type": "engineering-answer", "useCustomName": true, "customName": "Friction", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(abs(friction_force),'N')", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}, {"type": "1_n_2", "useCustomName": true, "customName": "Direction", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "minMarks": 0, "maxMarks": 0, "shuffleChoices": false, "displayType": "radiogroup", "displayColumns": 0, "showCellAnswerState": true, "choices": ["

UP the slope $\\nwarrow$

", "

DOWN the slope $\\searrow$

"], "matrix": "{direction}"}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Friction: Range of values 1", "extensions": ["quantities"], "custom_part_types": [{"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.

", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "siground(settings['correctAnswer'],4)", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nswitch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n\n\ninterpreted_answer:\nqty(student_scalar, student_units)\n\n\n\ncorrect_quantity:\nsettings[\"correctAnswer\"]\n\n\n\ncorrect_units:\nunits(correct_quantity)\n\n\nallowed_notation_styles:\n[\"plain\",\"en\"]\n\nmatch_student_number:\nmatchnumber(studentAnswer,allowed_notation_styles)\n\nstudent_scalar:\nmatch_student_number[1]\n\nstudent_units:\nreplace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")\n\ngood_units:\ntry(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n\n\nstudent_quantity:\nswitch(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\n\npercent_error:\ntry(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n \n\nright:\npercent_error <= settings['right']\n\n\nclose:\nright_sign and percent_error <= settings['close']\n\nright_sign:\nsign(student_scalar) = sign(correct_quantity)", "marking_notes": [{"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "switch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "qty(student_scalar, student_units)\n\n"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]\n\n"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)\n"}, {"name": "allowed_notation_styles", "description": "", "definition": "[\"plain\",\"en\"]"}, {"name": "match_student_number", "description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)"}, {"name": "student_scalar", "description": "", "definition": "match_student_number[1]"}, {"name": "student_units", "description": "

Modify the unit portion of the student's answer by

\n

1. replacing \"ohms\" with \"ohm\"  case insensitive

\n

2. replacing '-' with ' ' 

\n

3. replacing '°' with ' deg' 

\n

to allow answers like 10 ft-lb and 30°

", "definition": "replace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")"}, {"name": "good_units", "description": "", "definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n"}, {"name": "student_quantity", "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.

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

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

", "definition": "right_sign and percent_error <= settings['close']"}, {"name": "right_sign", "description": "", "definition": "sign(student_scalar) = sign(correct_quantity) "}], "settings": [{"name": "correctAnswer", "label": "Correct Quantity.", "help_url": "", "hint": "The correct answer given as a JME quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "right", "label": "% Accuracy for right.", "help_url": "", "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "0.2", "evaluate": true}, {"name": "close", "label": "% Accuracy for close.", "help_url": "", "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "1.0", "evaluate": true}, {"name": "C1", "label": "Close with units.", "help_url": "", "hint": "Partial Credit for close value with appropriate units.  if correct answer is 100 N and close is ±1%,
99  N is accepted.", "input_type": "percent", "default_value": "75"}, {"name": "C2", "label": "No units or wrong sign", "help_url": "", "hint": "Partial credit for forgetting units or using wrong sign.
If the correct answer is 100 N, both 100 and -100 N are accepted.", "input_type": "percent", "default_value": "50"}, {"name": "C3", "label": "Close, no units.", "help_url": "", "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.", "input_type": "percent", "default_value": "25"}], "public_availability": "always", "published": true, "extensions": ["quantities"]}], "resources": [["question-resources/hw5sol1_nKcXJ7J.png", "/srv/numbas/media/question-resources/hw5sol1_nKcXJ7J.png"], ["question-resources/hw5sol2a.png", "/srv/numbas/media/question-resources/hw5sol2a.png"], ["question-resources/hw5sol2b.png", "/srv/numbas/media/question-resources/hw5sol2b.png"], ["question-resources/PNG_image_2021-01-12_12_05_55.png", "/srv/numbas/media/question-resources/PNG_image_2021-01-12_12_05_55.png"], ["question-resources/PNG_image_2021-01-12_12_06_59.png", "/srv/numbas/media/question-resources/PNG_image_2021-01-12_12_06_59.png"], ["question-resources/PNG_image_2021-01-12_12_09_33.png", "/srv/numbas/media/question-resources/PNG_image_2021-01-12_12_09_33.png"], ["question-resources/PNG_image_2021-01-12_12_10_15.png", "/srv/numbas/media/question-resources/PNG_image_2021-01-12_12_10_15.png"], ["question-resources/block_Q19elOW.svg", "/srv/numbas/media/question-resources/block_Q19elOW.svg"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Vladimir Vingoradov", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1862/"}, {"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}, {"name": "Haoyu Huang", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/17657/"}], "tags": [], "metadata": {"description": "

Friction

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

\n

Knowing that $\\mu_s = 0.20$, $\\mu_k = 0.15$, and $\\theta=\\var{th}^\\circ$, determine the range of values of $P$ for which equilibrium is maintained.

", "advice": "

$+\\!\\!\\nearrow\\sum F_y=0,\\quad\\implies\\quad N-800 \\cos 25^\\circ+P\\sin(\\theta-25^\\circ)=0$

\n

$N=800 \\cos 25^\\circ-P\\sin( \\var{th-25}^\\circ),$

\n

$F_m=\\mu_s N$

\n

To start moving the block up the incline:

\n

\n

\n

$+\\!\\!\\searrow\\sum F_x=0,\\quad\\implies\\quad \\mu_s N-P\\cos(\\theta-25^\\circ)+800\\sin 25^\\circ=0$

\n

$\\mu_s (800 \\cos 25^\\circ-P\\sin\\var{th-25}^\\circ)-P\\cos\\var{th-25}^\\circ+800\\sin 25^\\circ=0$

\n

$\\mu_s 800 \\cos 25^\\circ-\\mu_s P\\sin\\var{th-25}^\\circ-P\\cos\\var{th-25}^\\circ+800\\sin 25^\\circ=0$

\n

$\\mu_s 800 \\cos 25^\\circ+800\\sin 25^\\circ=+P[\\mu_s \\sin\\var{th-25}^\\circ+\\cos\\var{th-25}^\\circ]$

\n

$P=\\dfrac{800(\\sin 25^\\circ+\\mu_s\\cos 25^\\circ)}{\\cos\\var{th-25}^\\circ+\\mu_s \\sin\\var{th-25}^\\circ}=\\var{Pmax}\\,\\text{N}\\quad\\blacktriangleleft$

\n

\n

To prevent the block from moving down:

\n

\n

$+\\!\\!\\searrow\\sum F_x=0,\\quad\\implies\\quad -\\mu_s N-P\\cos(\\theta-25^\\circ)+800\\sin 25^\\circ=0$

\n

$-\\mu_s (800 \\cos 25^\\circ-P\\sin \\var{th-25}^\\circ)-P\\cos\\var{th-25}^\\circ+800\\sin 25^\\circ=0$

\n

$-\\mu_s 800  \\cos 25^\\circ +\\mu_s P\\sin \\var{th-25}^\\circ- P\\cos \\var{th-25}^\\circ+800\\sin 25^\\circ=0$

\n

$\\mu_s P\\sin \\var{th-25}^\\circ- P\\cos\\var{th-25}^\\circ-\\mu_s 800  \\cos 25^\\circ +800\\sin 25^\\circ=0$

\n

$-\\mu_s 800  \\cos 25^\\circ +800\\sin 25^\\circ=P[\\cos\\var{th-25}^\\circ-\\mu_s \\sin\\var{th-25}^\\circ]$

\n

$P=\\dfrac{800(\\sin 25^\\circ-\\mu_s\\cos 25^\\circ)}{\\cos\\var{th-25}^\\circ-\\mu_s \\sin\\var{th-25}^\\circ}=\\var{Pmin}\\,\\text{N}\\quad\\blacktriangleleft$

\n

\\[\\var{Pmin}\\,\\text{N} \\le P \\le \\var{Pmax}\\,\\text{N}\\quad\\blacktriangleleft\\]

\n
\n

Alternative solution:

\n

Combine the normal and friction forces $\\vec{R}=\\vec{N}+\\vec{F}_\\mu$. When $F_\\mu=\\mu_sN$, the angle between the resultant $\\vec{R}$ and the normal force is the friction angle:

\n

\\[\\phi_s=\\arctan \\mu_s=\\arctan \\var{mu_s}=\\var{phi}^\\circ.\\]

\n

To prevent the block from moving up:

\n

\n

In this case there are only three forces acting on the block, which in view of equilibrium, form a triangle:

\n

\n

In this triangle, the angle between the force $\\vec{R}$ and weight $\\vec{W}$ is $\\phi_s+25^\\circ$. Using the law of sines:

\n

$\\displaystyle\\frac{P}{\\sin (\\phi_s+25^\\circ)}=\\frac{W}{\\sin \\left[180^\\circ-(\\phi_s+25^\\circ)-(90^\\circ-\\theta)\\right]},$

\n

$\\displaystyle\\frac{P}{\\sin\\var{phi+25}^\\circ}=\\frac{800}{\\sin\\var{180-phi-25-90+th}^\\circ},$

\n

$P=800\\dfrac{\\sin\\var{phi+25}^\\circ}{\\sin\\var{180-phi-25-90+th}^\\circ}=\\var{Pmax}\\,\\text{N}.\\,\\blacktriangleleft$

\n

\n

To prevent the block from moving down send the friction force up the incline:

\n

\n

Form a triangle:

\n

\n

In this triangle, the angle between the force $\\vec{R}$ and weight $\\vec{W}$ is $25^\\circ-\\phi_s$. Using the law of sines:

\n

$\\displaystyle\\frac{P}{\\sin (25^\\circ-\\phi_s)}=\\frac{W}{\\sin \\left[180^\\circ-(25^\\circ-\\phi_s)-(90^\\circ-\\theta)\\right]},$

\n

$\\displaystyle\\frac{P}{\\sin\\var{-phi+25}^\\circ}=\\frac{800}{\\sin\\var{180+phi-25-90+th}^\\circ},$

\n

$P=800\\dfrac{\\sin\\var{-phi+25}^\\circ}{\\sin\\var{180+phi-25-90+th}^\\circ}=\\var{Pmin}\\,\\text{N}\\,\\blacktriangleleft$

\n

\\[\\var{Pmin}\\,\\text{N} \\le P \\le \\var{Pmax}\\,\\text{N}.\\quad\\blacktriangleleft\\]

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"Pmin": {"name": "Pmin", "group": "Ungrouped variables", "definition": "precround(800*(sin(radians(25))-mu_s*cos(radians(25)))/(cos(radians(th-25))-mu_s*sin(radians(th-25))),1)", "description": "", "templateType": "anything", "can_override": false}, "th": {"name": "th", "group": "Ungrouped variables", "definition": "random(10..70#5 except 25)", "description": "", "templateType": "anything", "can_override": false}, "mu_k": {"name": "mu_k", "group": "Ungrouped variables", "definition": "0.15", "description": "", "templateType": "anything", "can_override": false}, "Pmax": {"name": "Pmax", "group": "Ungrouped variables", "definition": "precround(800*(sin(radians(25))+mu_s*cos(radians(25)))/(cos(radians(th-25))+mu_s*sin(radians(th-25))),1)", "description": "", "templateType": "anything", "can_override": false}, "mu_s": {"name": "mu_s", "group": "Ungrouped variables", "definition": "0.2", "description": "", "templateType": "number", "can_override": false}, "phi": {"name": "phi", "group": "Ungrouped variables", "definition": "precround(degrees(arctan(mu_s)),2)", "description": "", "templateType": "anything", "can_override": false}, "W": {"name": "W", "group": "Ungrouped variables", "definition": "'800 N'", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["th", "mu_s", "mu_k", "Pmin", "Pmax", "phi", "W"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The minimum force is [[0]]. 

", "gaps": [{"type": "engineering-answer", "useCustomName": true, "customName": "Pmin", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(Pmin, 'N')", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

The maximum force is [[0]].

", "gaps": [{"type": "engineering-answer", "useCustomName": true, "customName": "Pmax", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(Pmax,'N')", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Friction: Range of values 2", "extensions": ["geogebra", "quantities"], "custom_part_types": [{"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.

", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "siground(settings['correctAnswer'],4)", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nswitch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n\n\ninterpreted_answer:\nqty(student_scalar, student_units)\n\n\n\ncorrect_quantity:\nsettings[\"correctAnswer\"]\n\n\n\ncorrect_units:\nunits(correct_quantity)\n\n\nallowed_notation_styles:\n[\"plain\",\"en\"]\n\nmatch_student_number:\nmatchnumber(studentAnswer,allowed_notation_styles)\n\nstudent_scalar:\nmatch_student_number[1]\n\nstudent_units:\nreplace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")\n\ngood_units:\ntry(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n\n\nstudent_quantity:\nswitch(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\n\npercent_error:\ntry(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n \n\nright:\npercent_error <= settings['right']\n\n\nclose:\nright_sign and percent_error <= settings['close']\n\nright_sign:\nsign(student_scalar) = sign(correct_quantity)", "marking_notes": [{"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "switch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "qty(student_scalar, student_units)\n\n"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]\n\n"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)\n"}, {"name": "allowed_notation_styles", "description": "", "definition": "[\"plain\",\"en\"]"}, {"name": "match_student_number", "description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)"}, {"name": "student_scalar", "description": "", "definition": "match_student_number[1]"}, {"name": "student_units", "description": "

Modify the unit portion of the student's answer by

\n

1. replacing \"ohms\" with \"ohm\"  case insensitive

\n

2. replacing '-' with ' ' 

\n

3. replacing '°' with ' deg' 

\n

to allow answers like 10 ft-lb and 30°

", "definition": "replace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")"}, {"name": "good_units", "description": "", "definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n"}, {"name": "student_quantity", "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.

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

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

", "definition": "right_sign and percent_error <= settings['close']"}, {"name": "right_sign", "description": "", "definition": "sign(student_scalar) = sign(correct_quantity) "}], "settings": [{"name": "correctAnswer", "label": "Correct Quantity.", "help_url": "", "hint": "The correct answer given as a JME quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "right", "label": "% Accuracy for right.", "help_url": "", "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "0.2", "evaluate": true}, {"name": "close", "label": "% Accuracy for close.", "help_url": "", "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "1.0", "evaluate": true}, {"name": "C1", "label": "Close with units.", "help_url": "", "hint": "Partial Credit for close value with appropriate units.  if correct answer is 100 N and close is ±1%,
99  N is accepted.", "input_type": "percent", "default_value": "75"}, {"name": "C2", "label": "No units or wrong sign", "help_url": "", "hint": "Partial credit for forgetting units or using wrong sign.
If the correct answer is 100 N, both 100 and -100 N are accepted.", "input_type": "percent", "default_value": "50"}, {"name": "C3", "label": "Close, no units.", "help_url": "", "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.", "input_type": "percent", "default_value": "25"}], "public_availability": "always", "published": true, "extensions": ["quantities"]}], "resources": [["question-resources/friction-block_xtezuTb.ggb", "/srv/numbas/media/question-resources/friction-block_xtezuTb.ggb"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Vladimir Vingoradov", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1862/"}, {"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}, {"name": "Haoyu Huang", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/17657/"}], "tags": [], "metadata": {"description": "

Friction

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

 {geogebra_applet('axvmx7au', params)}

\n

The coefficient of friction between the block and the rail is $\\mu_s=\\var{mu_s}$. Knowing that the block weighs $\\var{qty(500,'N')}$ and $\\theta=\\var{th}^\\circ$, determine:

", "advice": "

{fbd}

\n

Given: $W = \\var{qty(500,\"N\")}, \\mu_s= \\var{mu_s}$

\n

$+\\!\\!\\nwarrow\\sum F_y=0,\\quad\\implies$

\n

$ N-W \\cos 35^\\circ+P\\sin(\\var{th-35}^\\circ)=0$

\n

$N=W \\cos 35^\\circ-P\\sin( \\var{th-35}^\\circ)$

\n

To start moving the block up the incline, point friction force down the incline:

\n

\n

$+\\!\\!\\swarrow\\sum F_x=0,\\quad\\implies$

\n

       $\\mu_s N-P\\cos(\\theta-35^\\circ)+W\\sin 35^\\circ=0$

\n

$\\mu_s (W \\cos 35^\\circ-P\\sin \\var{th-35}^\\circ)-P\\cos \\var{th-35}^\\circ+W\\sin 35^\\circ=0$

\n

$P=\\dfrac{W\\,(\\sin 35^\\circ+\\mu_s\\cos 35^\\circ)}{(\\cos \\var{th-35}^\\circ+\\mu_s \\sin \\var{th-35}^\\circ)}=\\var{Pmax}\\,\\text{N}\\quad\\blacktriangleleft$

\n

\n

To prevent the block from moving down, point friction force up the incline:

\n

$+\\!\\!\\swarrow\\sum F_x=0,\\quad\\implies$

\n

       $-\\mu_s N-P\\cos(\\theta-35^\\circ)+W\\sin 35^\\circ=0$

\n

$-\\mu_s (W \\cos 35^\\circ-P\\sin \\var{th-35}^\\circ)-P\\cos \\var{th-35}^\\circ+W\\sin 35^\\circ=0$

\n

$P=\\dfrac{W\\,(\\sin 35^\\circ-\\mu_s\\cos 35^\\circ)}{(\\cos\\var{th-35}^\\circ-\\mu_s \\sin \\var{th-35}^\\circ)}=\\var{Pmin}\\,\\text{N}\\quad\\blacktriangleleft$

\n

\\[\\var{Pmin}\\,\\text{N} \\le P \\le \\var{Pmax}\\,\\text{N}\\quad\\blacktriangleleft\\]

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"th": {"name": "th", "group": "Ungrouped variables", "definition": "random(40 .. 80#5)", "description": "", "templateType": "randrange", "can_override": false}, "mu_s": {"name": "mu_s", "group": "Ungrouped variables", "definition": "random(0.15 .. 0.4#0.05)", "description": "", "templateType": "randrange", "can_override": false}, "Pmax": {"name": "Pmax", "group": "Ungrouped variables", "definition": "precround(500*(sin(radians(alpha))+mu_S*cos(radians(35)))/(cos(radians(th-35))+mu_s*sin(radians(th-35))),1)", "description": "", "templateType": "anything", "can_override": false}, "Pmin": {"name": "Pmin", "group": "Ungrouped variables", "definition": "precround(500*(sin(radians(alpha))-mu_S*cos(radians(35)))/(cos(radians(th-35))-mu_s*sin(radians(th-35))),1)", "description": "", "templateType": "anything", "can_override": false}, "params": {"name": "params", "group": "Ungrouped variables", "definition": "[ theta: radians(th), W: 500, alpha: radians(alpha)]", "description": "

Currently advice is for W = 500 N, alpha = 35°.  Diagram will accept other values.

", "templateType": "anything", "can_override": false}, "fbd": {"name": "fbd", "group": "Ungrouped variables", "definition": "view2(geogebra_file(\"friction-block_xtezuTb.ggb\",params))", "description": "", "templateType": "anything", "can_override": false}, "alpha": {"name": "alpha", "group": "Ungrouped variables", "definition": "random(25..35#5)", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["mu_s", "th", "Pmin", "Pmax", "params", "fbd", "alpha"], "variable_groups": [], "functions": {"view2": {"parameters": [["app", "ggbapplet"]], "type": "anything", "language": "javascript", "definition": "// see https://wiki.geogebra.org/en/Reference:GeoGebra_Apps_API for other commands\n\napp.promise.then(function(d) {\n d.app.setPerspective('D');\n d.app.setGridVisible(2,false);\n});\nreturn new Numbas.jme.types.ggbapplet(app);\n"}}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

the maximum value of $P$ before the block starts to move up the incline, i.e. impending upward motion.

\n

[[0]]

", "gaps": [{"type": "engineering-answer", "useCustomName": true, "customName": "Pmax", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(Pmax,'N')", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

 the minimum value of $P$ required to prevent the block from moving down the incline, i.e. impending downward motion.

\n

[[0]]

", "gaps": [{"type": "engineering-answer", "useCustomName": true, "customName": "Pmin", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(Pmin,'N')", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Friction: block on block 1", "extensions": ["quantities"], "custom_part_types": [{"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.

", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "siground(settings['correctAnswer'],4)", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nswitch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n\n\ninterpreted_answer:\nqty(student_scalar, student_units)\n\n\n\ncorrect_quantity:\nsettings[\"correctAnswer\"]\n\n\n\ncorrect_units:\nunits(correct_quantity)\n\n\nallowed_notation_styles:\n[\"plain\",\"en\"]\n\nmatch_student_number:\nmatchnumber(studentAnswer,allowed_notation_styles)\n\nstudent_scalar:\nmatch_student_number[1]\n\nstudent_units:\nreplace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")\n\ngood_units:\ntry(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n\n\nstudent_quantity:\nswitch(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\n\npercent_error:\ntry(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n \n\nright:\npercent_error <= settings['right']\n\n\nclose:\nright_sign and percent_error <= settings['close']\n\nright_sign:\nsign(student_scalar) = sign(correct_quantity)", "marking_notes": [{"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "switch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "qty(student_scalar, student_units)\n\n"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]\n\n"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)\n"}, {"name": "allowed_notation_styles", "description": "", "definition": "[\"plain\",\"en\"]"}, {"name": "match_student_number", "description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)"}, {"name": "student_scalar", "description": "", "definition": "match_student_number[1]"}, {"name": "student_units", "description": "

Modify the unit portion of the student's answer by

\n

1. replacing \"ohms\" with \"ohm\"  case insensitive

\n

2. replacing '-' with ' ' 

\n

3. replacing '°' with ' deg' 

\n

to allow answers like 10 ft-lb and 30°

", "definition": "replace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")"}, {"name": "good_units", "description": "", "definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n"}, {"name": "student_quantity", "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.

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

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

", "definition": "right_sign and percent_error <= settings['close']"}, {"name": "right_sign", "description": "", "definition": "sign(student_scalar) = sign(correct_quantity) "}], "settings": [{"name": "correctAnswer", "label": "Correct Quantity.", "help_url": "", "hint": "The correct answer given as a JME quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "right", "label": "% Accuracy for right.", "help_url": "", "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "0.2", "evaluate": true}, {"name": "close", "label": "% Accuracy for close.", "help_url": "", "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "1.0", "evaluate": true}, {"name": "C1", "label": "Close with units.", "help_url": "", "hint": "Partial Credit for close value with appropriate units.  if correct answer is 100 N and close is ±1%,
99  N is accepted.", "input_type": "percent", "default_value": "75"}, {"name": "C2", "label": "No units or wrong sign", "help_url": "", "hint": "Partial credit for forgetting units or using wrong sign.
If the correct answer is 100 N, both 100 and -100 N are accepted.", "input_type": "percent", "default_value": "50"}, {"name": "C3", "label": "Close, no units.", "help_url": "", "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.", "input_type": "percent", "default_value": "25"}], "public_availability": "always", "published": true, "extensions": ["quantities"]}], "resources": [["question-resources/hw5sol4a.png", "/srv/numbas/media/question-resources/hw5sol4a.png"], ["question-resources/hw5sol4b.png", "/srv/numbas/media/question-resources/hw5sol4b.png"], ["question-resources/hw5sol4c_8mi0we3.png", "/srv/numbas/media/question-resources/hw5sol4c_8mi0we3.png"], ["question-resources/friction4_PfgAjTj.svg", "/srv/numbas/media/question-resources/friction4_PfgAjTj.svg"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Vladimir Vingoradov", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1862/"}, {"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}, {"name": "Haoyu Huang", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/17657/"}], "tags": [], "metadata": {"description": "

Friction

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

\n

The coefficient of friction is $\\mu_s=\\var{mu_s}$ between all surfaces of contact. Knowing that $M_1=\\var{M1}$kg and $M_2=\\var{M2}$kg, determine the smallest force $P$ required to start the block $M_2$ moving.

", "advice": "

(a)

\n

Free body: $\\var{M1}$-kg block

\n

\n

$W_1=M_1 g=\\var{m1}\\times 9.81=\\var{m1*9.81}\\,\\text{N}$

\n

$+\\!\\!\\uparrow\\sum F_y=0:\\quad N_1=W_1$

\n

$F_1=\\mu_s N_1=\\var{mu_s}\\times\\var{m1*9.81}=\\var{mu_s*m1*9.81}\\,\\text{N}$

\n

$\\overset{+}{\\rightarrow}\\sum F_x=0:\\quad T-F_1=0,\\quad T=F_1=\\var{mu_s*m1*9.81}\\,\\text{N}$

\n

\n

\n

Free body: $\\var{M2}$-kg block

\n

\n

$W_2=M_2g=\\var{M2}\\times 9.81=\\var{m2*9.81}\\,\\text{N}$

\n

$+\\!\\!\\uparrow\\sum F_y=0: $

\n

$N_2-N_1-W_2=0,$

\n

$N_2=W_1+W_2=\\var{(m1+m2)*9.81}\\,\\text{N}$

\n

$F_2=\\mu_s N_2=\\var{mu_s}\\times\\var{(m1+m2)*9.81}=\\var{mu_s*(m1+m2)*9.81}\\,\\text{N}$

\n

$\\overset{+}{\\rightarrow}\\sum F_x=0: -P+F_1+F_2+T=0$

\n

\\[P=F_1+F_2+T=\\var{P1}\\,\\text{N}\\quad\\blacktriangleleft\\]

\n

\n

(b)

\n

Blocks move together

\n

\n

$W=(M_1+M_2)g=\\var{(m1+m2)*9.81}\\,\\text{N}$

\n

$\\overset{+}{\\rightarrow}\\sum F_x=0:$

\n

$P-\\mu_s N=0$

\n

$P=\\mu_s N=\\mu_s W=\\var{mu_s}\\times\\var{(m1+m2)*9.81}=\\var{P2}\\,\\text{N}$

\n

\\[P=\\var{P2}\\,\\text{N}\\quad\\blacktriangleleft\\]

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"M2": {"name": "M2", "group": "Ungrouped variables", "definition": "M1+10", "description": "", "templateType": "anything", "can_override": false}, "mu_s": {"name": "mu_s", "group": "Ungrouped variables", "definition": "0.4", "description": "", "templateType": "number", "can_override": false}, "M1": {"name": "M1", "group": "Ungrouped variables", "definition": "random(5 .. 40#5)", "description": "", "templateType": "randrange", "can_override": false}, "P1": {"name": "P1", "group": "Ungrouped variables", "definition": "mu_s*(3*M1+M2)*9.81", "description": "", "templateType": "anything", "can_override": false}, "P2": {"name": "P2", "group": "Ungrouped variables", "definition": "mu_s*(M1+M2)*9.81", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["mu_s", "M1", "M2", "P1", "P2"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

cable AB is connected.

\n

$P$ = [[0]]

", "gaps": [{"type": "engineering-answer", "useCustomName": true, "customName": "P1", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(P1,'N')", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

cable AB is removed.

\n

$P$ = [[0]]

", "gaps": [{"type": "engineering-answer", "useCustomName": true, "customName": "P2", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(P2,'N')", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}, {"name": "Friction: block on block 2", "extensions": ["quantities"], "custom_part_types": [{"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.

", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "siground(settings['correctAnswer'],4)", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nswitch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n\n\ninterpreted_answer:\nqty(student_scalar, student_units)\n\n\n\ncorrect_quantity:\nsettings[\"correctAnswer\"]\n\n\n\ncorrect_units:\nunits(correct_quantity)\n\n\nallowed_notation_styles:\n[\"plain\",\"en\"]\n\nmatch_student_number:\nmatchnumber(studentAnswer,allowed_notation_styles)\n\nstudent_scalar:\nmatch_student_number[1]\n\nstudent_units:\nreplace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")\n\ngood_units:\ntry(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n\n\nstudent_quantity:\nswitch(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\n\npercent_error:\ntry(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n \n\nright:\npercent_error <= settings['right']\n\n\nclose:\nright_sign and percent_error <= settings['close']\n\nright_sign:\nsign(student_scalar) = sign(correct_quantity)", "marking_notes": [{"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "switch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "qty(student_scalar, student_units)\n\n"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]\n\n"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)\n"}, {"name": "allowed_notation_styles", "description": "", "definition": "[\"plain\",\"en\"]"}, {"name": "match_student_number", "description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)"}, {"name": "student_scalar", "description": "", "definition": "match_student_number[1]"}, {"name": "student_units", "description": "

Modify the unit portion of the student's answer by

\n

1. replacing \"ohms\" with \"ohm\"  case insensitive

\n

2. replacing '-' with ' ' 

\n

3. replacing '°' with ' deg' 

\n

to allow answers like 10 ft-lb and 30°

", "definition": "replace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")"}, {"name": "good_units", "description": "", "definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n"}, {"name": "student_quantity", "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.

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

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

", "definition": "right_sign and percent_error <= settings['close']"}, {"name": "right_sign", "description": "", "definition": "sign(student_scalar) = sign(correct_quantity) "}], "settings": [{"name": "correctAnswer", "label": "Correct Quantity.", "help_url": "", "hint": "The correct answer given as a JME quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "right", "label": "% Accuracy for right.", "help_url": "", "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "0.2", "evaluate": true}, {"name": "close", "label": "% Accuracy for close.", "help_url": "", "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "1.0", "evaluate": true}, {"name": "C1", "label": "Close with units.", "help_url": "", "hint": "Partial Credit for close value with appropriate units.  if correct answer is 100 N and close is ±1%,
99  N is accepted.", "input_type": "percent", "default_value": "75"}, {"name": "C2", "label": "No units or wrong sign", "help_url": "", "hint": "Partial credit for forgetting units or using wrong sign.
If the correct answer is 100 N, both 100 and -100 N are accepted.", "input_type": "percent", "default_value": "50"}, {"name": "C3", "label": "Close, no units.", "help_url": "", "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.", "input_type": "percent", "default_value": "25"}], "public_availability": "always", "published": true, "extensions": ["quantities"]}], "resources": [["question-resources/hw5sol4a_FAl4pmC.png", "/srv/numbas/media/question-resources/hw5sol4a_FAl4pmC.png"], ["question-resources/hw5sol5b.png", "/srv/numbas/media/question-resources/hw5sol5b.png"], ["question-resources/friction5_vT7mobf.svg", "/srv/numbas/media/question-resources/friction5_vT7mobf.svg"]], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "contributors": [{"name": "Vladimir Vingoradov", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/1862/"}, {"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}, {"name": "Haoyu Huang", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/17657/"}], "tags": [], "metadata": {"description": "

Friction

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

\n

\n

The coefficient of friction is $\\mu_s=\\var{mu_s}$ between all surfaces of contact. Knowing that $M_1=\\var{M1}$ kg and $M_2=\\var{M2}$ kg, determine the smallest force $P$ required to start the block $M_2$ moving if:

", "advice": "

(a)

\n

Free body: $\\var{M1}$-kg block

\n

\n

$W_1=M_1 g=\\var{m1}\\times 9.81=\\var{m1*9.81}\\,\\text{N}$

\n

$+\\!\\!\\uparrow\\sum F_y=0:\\quad N_1=W_1$

\n

$F_1=\\mu_s N_1=\\var{mu_s}\\times\\var{m1*9.81}=\\var{mu_s*m1*9.81}\\,\\text{N}$

\n

$\\overset{+}{\\rightarrow}\\sum F_x=0:\\quad T-F_1=0,$

\n

$ T=F_1=\\var{mu_s*m1*9.81}\\,\\text{N}$

\n

\n

\n

Free body: $\\var{M2}$-kg block

\n

\n

$W_2=M_2g=\\var{M2}\\times 9.81=\\var{m2*9.81}\\,\\text{N}$

\n

$+\\!\\!\\uparrow\\sum F_y=0: $

\n

$ N_2-N_1-W_2=0,$

\n

$N_2=W_1+W_2=\\var{(m1+m2)*9.81}\\,\\text{N}$

\n

$F_2=\\mu_s N_2=\\var{mu_s}\\times\\var{(m1+m2)*9.81}=\\var{mu_s*(m1+m2)*9.81}\\,\\text{N}$

\n

$\\overset{+}{\\rightarrow}\\sum F_x=0: -P+F_1+F_2=0$

\n

\\[P=F_1+F_2=\\var{P1}\\,\\text{N}\\quad\\blacktriangleleft\\]

\n

\n

(b)

\n

Blocks move together  (see solution for previous question)

\n

\\[P=\\var{P2}\\,\\text{N}\\quad\\blacktriangleleft\\]

", "rulesets": {}, "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"P1": {"name": "P1", "group": "Ungrouped variables", "definition": "precround(mu_s*(2*M1+M2)*9.81,1)", "description": "", "templateType": "anything", "can_override": false}, "M2": {"name": "M2", "group": "Ungrouped variables", "definition": "random(5 .. 40#5)", "description": "", "templateType": "randrange", "can_override": false}, "P2": {"name": "P2", "group": "Ungrouped variables", "definition": "precround(mu_s*(M1+M2)*9.81,1)", "description": "", "templateType": "anything", "can_override": false}, "mu_s": {"name": "mu_s", "group": "Ungrouped variables", "definition": "random(0.15 .. 0.5#0.05)", "description": "", "templateType": "randrange", "can_override": false}, "M1": {"name": "M1", "group": "Ungrouped variables", "definition": "random(5 .. 40#5)", "description": "", "templateType": "randrange", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["mu_s", "M1", "M2", "P1", "P2"], "variable_groups": [], "functions": {}, "preamble": {"js": "", "css": ""}, "parts": [{"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

cable AB is attached as shown, 

\n

 $P$ = [[0]]

", "gaps": [{"type": "engineering-answer", "useCustomName": true, "customName": "P1", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(P1,'N')", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}], "sortAnswers": false}, {"type": "gapfill", "useCustomName": false, "customName": "", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

cable AB is removed.

\n

$P$ = [[0]]

", "gaps": [{"type": "engineering-answer", "useCustomName": true, "customName": "P2", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(P2,'N')", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question"}]}], "allowPrinting": true, "navigation": {"allowregen": true, "reverse": true, "browse": true, "allowsteps": true, "showfrontpage": false, "showresultspage": "oncompletion", "navigatemode": "menu", "onleave": {"action": "none", "message": ""}, "preventleave": false, "startpassword": ""}, "timing": {"allowPause": true, "timeout": {"action": "none", "message": ""}, "timedwarning": {"action": "none", "message": ""}}, "feedback": {"showactualmark": true, "showtotalmark": true, "showanswerstate": true, "allowrevealanswer": true, "advicethreshold": 0, "intro": "", "end_message": "", "reviewshowscore": true, "reviewshowfeedback": true, "reviewshowexpectedanswer": true, "reviewshowadvice": true, "feedbackmessages": [], "enterreviewmodeimmediately": true, "showexpectedanswerswhen": "inreview", "showpartfeedbackmessageswhen": "always", "showactualmarkwhen": "always", "showtotalmarkwhen": "always", "showanswerstatewhen": "always", "showadvicewhen": "inreview"}, "diagnostic": {"knowledge_graph": {"topics": [], "learning_objectives": []}, "script": "diagnosys", "customScript": ""}, "type": "exam", "contributors": [{"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}], "extensions": ["geogebra", "quantities"], "custom_part_types": [{"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.

", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "siground(settings['correctAnswer'],4)", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": true}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nswitch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n\n\ninterpreted_answer:\nqty(student_scalar, student_units)\n\n\n\ncorrect_quantity:\nsettings[\"correctAnswer\"]\n\n\n\ncorrect_units:\nunits(correct_quantity)\n\n\nallowed_notation_styles:\n[\"plain\",\"en\"]\n\nmatch_student_number:\nmatchnumber(studentAnswer,allowed_notation_styles)\n\nstudent_scalar:\nmatch_student_number[1]\n\nstudent_units:\nreplace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")\n\ngood_units:\ntry(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n\n\nstudent_quantity:\nswitch(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\n\npercent_error:\ntry(\nscalar(abs((correct_quantity - student_quantity)/correct_quantity))*100 \n,msg,\nif(student_quantity=correct_quantity,0,100))\n \n\nright:\npercent_error <= settings['right']\n\n\nclose:\nright_sign and percent_error <= settings['close']\n\nright_sign:\nsign(student_scalar) = sign(correct_quantity)", "marking_notes": [{"name": "mark", "description": "This is the main marking note. It should award credit and provide feedback based on the student's answer.", "definition": "switch( \n right and good_units and right_sign, add_credit(1.0,'Correct.'),\n right and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\n right and right_sign and not good_units, add_credit(settings['C2'],'Correct value, but wrong or missing units.'),\n close and good_units, add_credit(settings['C1'],'Close.'),\n close and not good_units, add_credit(settings['C3'],'Answer is close, but wrong or missing units.'),\n incorrect('Wrong answer.')\n)\n"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "qty(student_scalar, student_units)\n\n"}, {"name": "correct_quantity", "description": "", "definition": "settings[\"correctAnswer\"]\n\n"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)\n"}, {"name": "allowed_notation_styles", "description": "", "definition": "[\"plain\",\"en\"]"}, {"name": "match_student_number", "description": "", "definition": "matchnumber(studentAnswer,allowed_notation_styles)"}, {"name": "student_scalar", "description": "", "definition": "match_student_number[1]"}, {"name": "student_units", "description": "

Modify the unit portion of the student's answer by

\n

1. replacing \"ohms\" with \"ohm\"  case insensitive

\n

2. replacing '-' with ' ' 

\n

3. replacing '°' with ' deg' 

\n

to allow answers like 10 ft-lb and 30°

", "definition": "replace_regex('ohms','ohm',\n replace_regex('\u00b0', ' deg',\n replace_regex('-', ' ' ,\n studentAnswer[len(match_student_number[0])..len(studentAnswer)])),\"i\")"}, {"name": "good_units", "description": "", "definition": "try(\ncompatible(quantity(1, student_units),correct_units),\nmsg,\nfeedback(msg);false)\n"}, {"name": "student_quantity", "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.

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

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

", "definition": "right_sign and percent_error <= settings['close']"}, {"name": "right_sign", "description": "", "definition": "sign(student_scalar) = sign(correct_quantity) "}], "settings": [{"name": "correctAnswer", "label": "Correct Quantity.", "help_url": "", "hint": "The correct answer given as a JME quantity.", "input_type": "code", "default_value": "", "evaluate": true}, {"name": "right", "label": "% Accuracy for right.", "help_url": "", "hint": "Question will be considered correct if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "0.2", "evaluate": true}, {"name": "close", "label": "% Accuracy for close.", "help_url": "", "hint": "Question will be considered close if the scalar part of the student's answer is within this % of correct value.", "input_type": "code", "default_value": "1.0", "evaluate": true}, {"name": "C1", "label": "Close with units.", "help_url": "", "hint": "Partial Credit for close value with appropriate units.  if correct answer is 100 N and close is ±1%,
99  N is accepted.", "input_type": "percent", "default_value": "75"}, {"name": "C2", "label": "No units or wrong sign", "help_url": "", "hint": "Partial credit for forgetting units or using wrong sign.
If the correct answer is 100 N, both 100 and -100 N are accepted.", "input_type": "percent", "default_value": "50"}, {"name": "C3", "label": "Close, no units.", "help_url": "", "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.", "input_type": "percent", "default_value": "25"}], "public_availability": "always", "published": true, "extensions": ["quantities"]}], "resources": [["question-resources/hw5sol1.png", "/srv/numbas/media/question-resources/hw5sol1.png"], ["question-resources/block_TxlOZUk.svg", "/srv/numbas/media/question-resources/block_TxlOZUk.svg"], ["question-resources/hw5sol1_nKcXJ7J.png", "/srv/numbas/media/question-resources/hw5sol1_nKcXJ7J.png"], ["question-resources/hw5sol2a.png", "/srv/numbas/media/question-resources/hw5sol2a.png"], ["question-resources/hw5sol2b.png", "/srv/numbas/media/question-resources/hw5sol2b.png"], ["question-resources/PNG_image_2021-01-12_12_05_55.png", "/srv/numbas/media/question-resources/PNG_image_2021-01-12_12_05_55.png"], ["question-resources/PNG_image_2021-01-12_12_06_59.png", "/srv/numbas/media/question-resources/PNG_image_2021-01-12_12_06_59.png"], ["question-resources/PNG_image_2021-01-12_12_09_33.png", "/srv/numbas/media/question-resources/PNG_image_2021-01-12_12_09_33.png"], ["question-resources/PNG_image_2021-01-12_12_10_15.png", "/srv/numbas/media/question-resources/PNG_image_2021-01-12_12_10_15.png"], ["question-resources/block_Q19elOW.svg", "/srv/numbas/media/question-resources/block_Q19elOW.svg"], ["question-resources/friction-block_xtezuTb.ggb", "/srv/numbas/media/question-resources/friction-block_xtezuTb.ggb"], ["question-resources/hw5sol4a.png", "/srv/numbas/media/question-resources/hw5sol4a.png"], ["question-resources/hw5sol4b.png", "/srv/numbas/media/question-resources/hw5sol4b.png"], ["question-resources/hw5sol4c_8mi0we3.png", "/srv/numbas/media/question-resources/hw5sol4c_8mi0we3.png"], ["question-resources/friction4_PfgAjTj.svg", "/srv/numbas/media/question-resources/friction4_PfgAjTj.svg"], ["question-resources/hw5sol4a_FAl4pmC.png", "/srv/numbas/media/question-resources/hw5sol4a_FAl4pmC.png"], ["question-resources/hw5sol5b.png", "/srv/numbas/media/question-resources/hw5sol5b.png"], ["question-resources/friction5_vT7mobf.svg", "/srv/numbas/media/question-resources/friction5_vT7mobf.svg"]]}