// Numbas version: exam_results_page_options {"name": "3D Equilibrium: Hanging Plate", "extensions": ["linear-algebra", "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
\n1. replacing \"ohms\" with \"ohm\" case insensitive
\n2. replacing '-' with ' '
\n3. replacing '°' with ' deg'
\nto 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.
\nIf student_units are wrong - replace with correct units
\nIf student_scalar has the wrong sign - replace with right sign
\nIf 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%,3D equilibrium of a particle problem. Rectangular steel plate supported by three cables, dimensions and density given.
", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "statement": "{applet} | \nYou can rotate the diagram and move the labels with the mouse, zoom with the mouse wheel, and shift-drag to pan. | \n
A $\\var{qty(L,mm)} \\times \\var{qty(W,mm)}$ steel plate $\\var{qty(t,mm)}$ thick is suspended from point $P$ located $\\var{qty(H,mm)}$ above the center of the plate.
\nKnowing that $DE = \\var{qty(DE,mm)}$ and that the density of the steel is $\\rho = \\var{qty(rho, \"kg/m^3\")}$, determine the tensions in the three cables.
\n", "advice": "To find the tensions in the cables, consider equilibrium of particle $P$, and note that force $\\mathbf{P}$ acts vertically up with a magnitude equal to the weight of the plate.
\nFind the weight of the plate, and the upward force $\\mathbf{P}$.
\n$\\begin{align} W &= m g = \\rho\\ (L\\times W \\times t)\\ g \\\\
& = \\var{qty(rho, \"kg/m^3\")} \\times \\left(\\var{qty(L,\"mm\")} \\times \\var{qty(W,\"mm\")} \\times \\var{qty(t,\"mm\")} \\right) \\times \\left(\\frac{\\var{qty(1, \"m\")}}{\\var{qty(1000,\"mm\")}}\\right)^3 \\times \\var{g}\\\\
& = \\var{siground(weight,4)}\\\\ \\mathbf{P} &= \\langle 0,0, \\var{siground(scalar(weight),4)} \\rangle \\text{ N}\\\\ \\end{align}$
Find position vectors and corresponding unit vectors from point $P$ to points $A$, $B$, and $D$.
\n$\\begin{align}
r_A &= \\var{ brackets(r_A)} \\text{ mm} & u_A &= \\frac{r_A}{|r_A|} = \\var{brackets(U_A)} \\\\
r_B &= \\var{ brackets(r_B)} \\text{ mm} & u_B &= \\frac{r_B}{|r_B|} = \\var{brackets(U_B)} \\\\
r_D &= \\var{ brackets(r_D)} \\text{ mm} & u_D &= \\frac{r_D}{|r_D|} = \\var{brackets(U_D)} \\\\
\\end{align}$
Express the forces in the cables in terms of unknown tensions and the unit vectors.
\n$\\begin{align}
\\mathbf{T_A} & = T_A u_A = T_A \\var{brackets(u_A)}\\\\
\\mathbf{T_B} & = T_B u_B = T_B \\var{brackets(u_B)}\\\\
\\mathbf{T_D} & = T_D u_A = T_D \\var{brackets(u_D)}\\\\
\\end{align}$
Set up three scalar equilibrium equations corresponding to $\\mathbf{T_A} + \\mathbf{T_B} + \\mathbf{T_D} + \\mathbf{P} = 0$.
\n\\begin{align}
\\Sigma F_x&=0: &\\simplify[!zeroTerm]{+{precround(U_A[0],3)} T_A + {precround(U_B[0],3)} T_B + { precround(U_D[0],3)} T_D + 0 = 0 }\\\\
\\Sigma F_y&=0: &\\simplify[!zeroTerm]{+{precround(U_A[1],3) } T_A + {precround(U_B[1],3) } T_B + { precround(U_D[1],3) } T_D + 0 =0} \\\\
\\Sigma F_z&=0: &\\simplify[!zeroTerm]{{precround(U_A[2],3) } T_A + {precround(U_B[2],3) } T_B + { precround(U_D[2],3) } T_D + {siground(scalar(weight),4)} =0}\\\\
\\end{align}
Solve the equilibrium equations simultaneously to get:
\n$\\begin{align}
T_A &= \\var{siground(qty(T_A,\"N\"),4)}\\\\
T_B &= \\var{siground(qty(T_B,\"N\"),4)}\\\\
T_D &= \\var{siground(qty(T_D,\"N\"),4)}\\\\
\\end{align}$
height of hook
", "templateType": "anything", "can_override": false}, "W": {"name": "W", "group": "inputs", "definition": "random(400..800#50)", "description": "width of plate in mm
", "templateType": "anything", "can_override": false}, "L": {"name": "L", "group": "inputs", "definition": "random(300..1000#20)", "description": "length of plate in mm
", "templateType": "anything", "can_override": false}, "frac": {"name": "frac", "group": "inputs", "definition": "random(0.2..0.8#0.1 except 0.5)", "description": "for ggb: fraction of length W to get CD
", "templateType": "anything", "can_override": false}, "params": {"name": "params", "group": "inputs", "definition": "[H: decimal(H/100), W: decimal(W/100), L: decimal(L/100), t: frac]", "description": "", "templateType": "anything", "can_override": false}, "mm": {"name": "mm", "group": "inputs", "definition": "\"mm\"", "description": "units
", "templateType": "anything", "can_override": false}, "CD": {"name": "CD", "group": "calculations", "definition": "W frac", "description": "segment CD, no closer than 150 mm to corners
", "templateType": "anything", "can_override": false}, "rho": {"name": "rho", "group": "inputs", "definition": "random(7750..8050#10)", "description": "density of steel in kg/m^3
", "templateType": "anything", "can_override": false}, "DE": {"name": "DE", "group": "calculations", "definition": "(1-frac)W", "description": "", "templateType": "anything", "can_override": false}, "t": {"name": "t", "group": "inputs", "definition": "random(20..40#5)", "description": "thickness of plate in mm
", "templateType": "anything", "can_override": false}, "weight": {"name": "weight", "group": "calculations", "definition": "qty(W,mm) * qty(L,mm) * qty(t,mm) * qty(rho, \"kg/m^3\") * g in \"N\"\n", "description": "", "templateType": "anything", "can_override": false}, "g": {"name": "g", "group": "inputs", "definition": "9.81 * quantity(\"m/s^2\")", "description": "", "templateType": "anything", "can_override": false}, "r_A": {"name": "r_A", "group": "vectors", "definition": "vector(L/2,-W/2,-H)", "description": "position vector to A from P in mm
", "templateType": "anything", "can_override": false}, "r_B": {"name": "r_B", "group": "vectors", "definition": "vector(L/2,W/2,-H)", "description": "position vector to B from P in mm
", "templateType": "anything", "can_override": false}, "r_D": {"name": "r_D", "group": "vectors", "definition": "vector(-L/2,-W/2+DE,-H)", "description": "position vector to D from P in mm
", "templateType": "anything", "can_override": false}, "u_A": {"name": "u_A", "group": "vectors", "definition": "r_A/abs(r_A)", "description": "unit vector to A
", "templateType": "anything", "can_override": false}, "u_B": {"name": "u_B", "group": "vectors", "definition": "r_B/abs(r_b)", "description": "unit vector to B
", "templateType": "anything", "can_override": false}, "u_D": {"name": "u_D", "group": "vectors", "definition": "r_D/abs(r_D)", "description": "unit vector to D
", "templateType": "anything", "can_override": false}, "MA": {"name": "MA", "group": "matrices", "definition": "transpose(matrix(u_A,u_B,u_D))", "description": "3x3 matrix of unit vectors
\n[[U_Ax U_Bx U_Dx]
\n[U_Ay U_By U_Dy]
\n[U_Az U_Bz U_Dz]]
", "templateType": "anything", "can_override": false}, "P": {"name": "P", "group": "matrices", "definition": "matrix([0],[0],[scalar(weight)])", "description": "column vector of upward force P
", "templateType": "anything", "can_override": false}, "MC": {"name": "MC", "group": "matrices", "definition": "augment(MA,-P)", "description": "3x4 augmented matrix P is negative since it needs to move across equals sign
", "templateType": "anything", "can_override": false}, "soln": {"name": "soln", "group": "matrices", "definition": "reduced_row_echelon_form(MC)", "description": "this finds solution
", "templateType": "anything", "can_override": false}, "T_A": {"name": "T_A", "group": "tensions", "definition": "soln[0][3]", "description": "", "templateType": "anything", "can_override": false}, "T_B": {"name": "T_B", "group": "tensions", "definition": "soln[1][3]", "description": "", "templateType": "anything", "can_override": false}, "T_D": {"name": "T_D", "group": "tensions", "definition": "soln[2][3]", "description": "", "templateType": "anything", "can_override": false}, "F_A": {"name": "F_A", "group": "check", "definition": "T_A u_A", "description": "Vector force A
", "templateType": "anything", "can_override": false}, "sum": {"name": "sum", "group": "check", "definition": "F_A+F_B+F_D+F_P", "description": "this should equal (0,0,0)
", "templateType": "anything", "can_override": false}, "F_B": {"name": "F_B", "group": "check", "definition": "T_B U_B", "description": "Vector force B
", "templateType": "anything", "can_override": false}, "F_D": {"name": "F_D", "group": "check", "definition": "T_D u_D", "description": "Vector force D
", "templateType": "anything", "can_override": false}, "F_P": {"name": "F_P", "group": "check", "definition": "vector(0,0,scalar(weight))", "description": "Vector force P
", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "inputs", "variables": ["W", "L", "H", "frac", "rho", "t", "applet", "params", "g", "mm"]}, {"name": "calculations", "variables": ["DE", "CD", "weight"]}, {"name": "vectors", "variables": ["r_A", "r_B", "r_D", "u_A", "u_B", "u_D"]}, {"name": "matrices", "variables": ["MA", "P", "MC", "soln"]}, {"name": "tensions", "variables": ["T_A", "T_B", "T_D"]}, {"name": "check", "variables": ["F_A", "F_B", "F_D", "F_P", "sum"]}], "functions": {"brackets": {"parameters": [["v", "vector"]], "type": "string", "language": "jme", "definition": "latex(\"\\\\langle \" + precround(v[0],3) + \", \" + precround(v[1],3) + \", \" + precround(v[2],3) + \" \\\\rangle\" )"}}, "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": "$T_A$ = [[0]] $T_B$ = [[1]] $T_D$ = [[2]]
", "gaps": [{"type": "engineering-answer", "useCustomName": true, "customName": "$T_A$", "marks": "20", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(T_A, \"N\")", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}, {"type": "engineering-answer", "useCustomName": true, "customName": "$T_B$", "marks": "20", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(T_B, \"N\")", "right": "0.2", "close": "1.0", "C1": "75", "C2": "50", "C3": "25"}}, {"type": "engineering-answer", "useCustomName": true, "customName": "$T_D$", "marks": "20", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correctAnswer": "qty(T_D, \"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", "contributors": [{"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}]}]}], "contributors": [{"name": "William Haynes", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/"}]}