// Numbas version: finer_feedback_settings {"name": "Couples in equilibrium", "extensions": ["geogebra", "quantities"], "custom_part_types": [{"source": {"pk": 24, "author": {"name": "William Haynes", "pk": 2530}, "edit_page": "/part_type/24/edit"}, "name": "Angle quantity", "short_name": "angle-quantity-from-reference", "description": "

Angle as a quantity in degrees.

", "help_url": "", "input_widget": "string", "input_options": {"correctAnswer": "plain_string(settings['correct_quantity'])", "hint": {"static": true, "value": ""}, "allowEmpty": {"static": true, "value": false}}, "can_be_gap": true, "can_be_step": true, "marking_script": "mark:\nswitch( \nright and good_units and right_sign and angle_in_range, add_credit(1.0,'Correct.'),\nright and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\nright and right_sign and not good_units, add_credit(settings['C2'],'Correct angle, but missing degree symbol.'),\nright and good_units and right_sign and not angle_in_range,add_credit(settings['C1'],'Angle is out of range.'),\nclose and good_units, add_credit(settings['C1'],'Close.'),\nclose and not good_units, add_credit(settings['C3'],'Answer is close, but missing degree symbol.'),\nincorrect('Wrong answer.')\n)\n\ninterpreted_answer:\nqty(student_scalar, student_units)\n\ncorrect_scalar:\nscalar(correct_quantity)\n \n\ncorrect_quantity:\nsettings['correct_quantity']\n\ncorrect_units:\nunits(correct_quantity)\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:\njoin(\nsplit(studentAnswer[len(match_student_number[0])..len(studentAnswer)]\n,\"\u00b0\"),\" deg\")\n\n\n\ngood_units:\ntry(\nkind(quantity(1, student_units))= kind(correct_quantity),\nmsg,\nfeedback(msg);false)\n\nstudent_quantity:\nswitch(not good_units, \nstudent_scalar * correct_units, \nnot right_sign,\n-quantity(student_scalar, student_units),\nquantity(student_scalar,student_units)\n)\n\nright_sign:\nsign(student_scalar) = sign(correct_quantity)\n\nangle_in_range:\nif(settings['restrict_angle'], abs(student_scalar) <= 90, true)\n\nright:\nwithinTolerance(abs(student_scalar), abs(correct_scalar), settings['right'])\n\nclose:\nwithinTolerance(student_scalar, correct_scalar, settings['close'])", "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( \nright and good_units and right_sign and angle_in_range, add_credit(1.0,'Correct.'),\nright and good_units and not right_sign, add_credit(settings['C2'],'Wrong sign.'),\nright and right_sign and not good_units, add_credit(settings['C2'],'Correct angle, but missing degree symbol.'),\nright and good_units and right_sign and not angle_in_range,add_credit(settings['C1'],'Angle is out of range.'),\nclose and good_units, add_credit(settings['C1'],'Close.'),\nclose and not good_units, add_credit(settings['C3'],'Answer is close, but missing degree symbol.'),\nincorrect('Wrong answer.')\n)"}, {"name": "interpreted_answer", "description": "A value representing the student's answer to this part.", "definition": "qty(student_scalar, student_units)"}, {"name": "correct_scalar", "description": "", "definition": "scalar(correct_quantity)\n "}, {"name": "correct_quantity", "description": "", "definition": "settings['correct_quantity']"}, {"name": "correct_units", "description": "", "definition": "units(correct_quantity)"}, {"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": "", "definition": "join(\nsplit(studentAnswer[len(match_student_number[0])..len(studentAnswer)]\n,\"\u00b0\"),\" deg\")\n\n"}, {"name": "good_units", "description": "", "definition": "try(\nkind(quantity(1, student_units))= kind(correct_quantity),\nmsg,\nfeedback(msg);false)"}, {"name": "student_quantity", "description": "", "definition": "switch(not good_units, \nstudent_scalar * correct_units, \nnot right_sign,\n-quantity(student_scalar, student_units),\nquantity(student_scalar,student_units)\n)"}, {"name": "right_sign", "description": "", "definition": "sign(student_scalar) = sign(correct_quantity)"}, {"name": "angle_in_range", "description": "", "definition": "if(settings['restrict_angle'], abs(student_scalar) <= 90, true)"}, {"name": "right", "description": "

Will check for correct sign elswhere.

", "definition": "withinTolerance(abs(student_scalar), abs(correct_scalar), settings['right'])"}, {"name": "close", "description": "

Must have correct sign to be close.

", "definition": "withinTolerance(student_scalar, correct_scalar, settings['close'])\n"}], "settings": [{"name": "correct_quantity", "label": "Correct Angle as quantity ", "help_url": "", "hint": "", "input_type": "code", "default_value": "qty(45,'deg')", "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 amount from the correct value.", "input_type": "code", "default_value": "0.1", "evaluate": true}, {"name": "restrict_angle", "label": "Less than 90\u00b0", "help_url": "", "hint": "When checked, angle must be between -90° and +90°.", "input_type": "checkbox", "default_value": true}, {"name": "C1", "label": "Close with units.", "help_url": "", "hint": "Partial Credit for close value with appropriate units.", "input_type": "percent", "default_value": "75"}, {"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 amount from the correct value.", "input_type": "code", "default_value": "0.5", "evaluate": true}, {"name": "C2", "label": "No units or wrong sign", "help_url": "", "hint": "Partial credit for forgetting units or using wrong sign.", "input_type": "percent", "default_value": "50"}, {"name": "C3", "label": "Close, no units.", "help_url": "", "hint": "Partial Credit for close value without units.", "input_type": "percent", "default_value": "25"}], "public_availability": "restricted", "published": false, "extensions": ["quantities"]}], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Couples in equilibrium", "tags": ["Couples", "couples", "Equilibrium", "equilibrium", "Mechanics", "mechanics", "Statics", "statics", "weierstrass"], "metadata": {"description": "

Solve for an angle which will result in equilibrium for a triangle subjected to three couples.   A trial and error solution is recommended.

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

{applet}

\n

Determine angle $\\alpha$ knowing that the triangular plate is in equilbrium when subjected to the three couples shown.

\n

", "advice": "

The triangular plate is in equlibrium, so the three couple moments add to zero.  Note that the length of side $d$ the triangle is not significant, only the angle $\\alpha$.

\n

\\[\\begin{align}  \\Sigma M &=0\\\\M_1 + M_2 + M_3 &= 0\\\\ \\require{cancel} (\\var{F_1} \\cancel{d} \\cos \\alpha) + (\\var {F_2}  \\cancel{d} \\sin \\alpha) + (\\var{show(F_3)}\\cancel{d} )&= 0\\\\ \\simplify[all,!collectNumbers]{{F_1} cos(alpha)+ {F_2} sin(alpha)} &= \\simplify{ - {show(F_3)}} \\\\ \\alpha &= \\var{alpha}°\\end{align}\\]

\n

This equation has only one unknown, and it can be solved algebraically for $\\alpha$, although it is not simple.  For the method, see this example.  

\n

An easier way is simply to plot  the equation: $y = \\simplify[all,!collectNumbers]{{F_1} cos(alpha)+ {F_2} sin(alpha) +  {show(F_3)}} $; the first positive root is the answer.  A guess-and-check solution may also be used.

\n

{advice}

", "rulesets": {}, "extensions": ["geogebra", "quantities"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true}, "constants": [], "variables": {"F_1": {"name": "F_1", "group": "Inputs", "definition": "random(-500..500#50 except 0)", "description": "", "templateType": "anything", "can_override": false}, "F_3": {"name": "F_3", "group": "results", "definition": "-(F_1 cos(radians(alpha)) + F_2 sin(radians(alpha)))", "description": "", "templateType": "anything", "can_override": false}, "alpha": {"name": "alpha", "group": "Inputs", "definition": "random(25..75)", "description": "", "templateType": "anything", "can_override": false}, "F_2": {"name": "F_2", "group": "Inputs", "definition": "random(-500..500#50 except 0)", "description": "", "templateType": "anything", "can_override": false}, "x_max": {"name": "x_max", "group": "results", "definition": "degrees(arctan(F_2/F_1))", "description": "

this is the angle of the maximum point on the sine wave

", "templateType": "anything", "can_override": false}, "roots": {"name": "roots", "group": "results", "definition": "[x_max+abs(x_max - alpha),x_max - abs(x_max - alpha)]", "description": "

roots are symmetrically to the left and right of the maximum.  Variable testing eliminates cases where there are two roots < 90°

", "templateType": "anything", "can_override": false}, "applet": {"name": "applet", "group": "ggb", "definition": "geogebra_applet('vyuvgyf7',params)", "description": "

{geogebra_applet('vyuvgyf7', [['α' , radians(alpha)],  ['F_1', F_1], ['F_2', F_2] ] )} 

", "templateType": "anything", "can_override": false}, "params": {"name": "params", "group": "ggb", "definition": "['\u03b1':radians(alpha),\nF_1: F_1,\nF_2: F_2 ]", "description": "", "templateType": "anything", "can_override": false}, "advice": {"name": "advice", "group": "ggb", "definition": "geogebra_applet('y3s8cnxe',advice_params)", "description": "

{geogebra_applet('y3s8cnxe',[ ['F_1', F_1], ['F_2', F_2],['F_3', F_3] ])}

", "templateType": "anything", "can_override": false}, "advice_params": {"name": "advice_params", "group": "ggb", "definition": "[F_1: F_1, F_2: F_2, F_3: F_3]", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "not (abs(roots[0]) < 90 and abs(roots[1]) < 90)", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "Inputs", "variables": ["alpha", "F_1", "F_2"]}, {"name": "results", "variables": ["F_3", "x_max", "roots"]}, {"name": "ggb", "variables": ["applet", "params", "advice", "advice_params"]}], "functions": {"show": {"parameters": [["f", "number"]], "type": "number", "language": "jme", "definition": "siground(f,4)"}}, "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": "

$\\alpha $ = [[0]] 

\n

\n

Note: the angle is an integer between 0° and 90°.

", "gaps": [{"type": "angle-quantity-from-reference", "useCustomName": true, "customName": "alpha", "marks": "10", "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "settings": {"correct_quantity": "qty(alpha,'deg')", "right": "0.2", "restrict_angle": true, "C1": "75", "close": "1.0", "C2": "50", "C3": "25"}}], "sortAnswers": false}], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "type": "question", "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/"}]}