// Numbas version: exam_results_page_options {"name": "Vector addition: tip-to-tail method", "extensions": ["geogebra", "quantities"], "custom_part_types": [{"source": {"pk": 12, "author": {"name": "William Haynes", "pk": 2530}, "edit_page": "/part_type/12/edit"}, "name": "Angle quantity 2020", "short_name": "angle", "description": "

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

\n

Accepts '°' and 'deg' as units.

\n

Penalizes if not close enough or no units.

\n

90° = -270° = 450°

numeric part of students answer, which is a quantity.

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

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

Does clumsy substitution to

\n

1. replace '-' with ' '

\n

2. replace '°' with ' deg'

\n

to allow answers like 10 ft-lb and 30°

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

This fixes the student answer for two common errors.

\n

If student_units are wrong  - replace with correct units

\n

If student_scalar has the wrong sign - replace with right sign

\n

If student makes both errors, only one gets fixed.

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

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

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

Given three vectors, arrange them in a tip to tail arrangement using geogebra, then estimate the magnitude and direction of their resultant.

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

{geogebra_applet('jwussezq', [['f_a', forceA],['f_b', forceB],['f_c', forceC]])}

\n

Three forces act on  point A:   A = {FA} {units[1]} at {alpha}°, B = {FB} {units[1]} at {beta}°  and, = {FC} {units[1]} at {gamma}°.

\n

Estimate the magnitude and direction of the resultant force R using the tip-to-tail method.

\n

Force A: {fa} {units[1]} at {alpha} = {forceA}

\n

Force B: {fb} {units[1]} at {beta} = {forceB}

\n

Force C: {fc}{units[1]} at {gamma} = {forceC}

\n

Resultant: {R}{units[1]}  at {rho}  = {forceR}

\n
\n
1. Move the tips of forces A, B, and C in this diagram to the correct magnitudes and directions. When this has been done correctly the dotted vector will become solid.
2. \n
3. Pick up vectors A, B and C  by their tails, and move them into a tip to tail arrangement. When this has been correctly done the resultant R will appear.
4. \n
\n

Based on this diagram, estimate the magnitude R  and direction of the resultant.

\n

$\\Sigma F_x = R_x \\qquad R=\\sqrt{R_x^2 + R_y^2}\\\\\\\\ \\Sigma F_y = R_y \\qquad \\theta = \\tan^{-1}\\left(\\left|\\frac{R_y}{R_x}\\right| \\right)$

", "rulesets": {}, "extensions": ["geogebra", "quantities"], "variables": {"FA": {"name": "FA", "group": "Inputs", "definition": "random(20..80#5)", "description": "

Magnitude of force A

", "templateType": "anything"}, "alpha": {"name": "alpha", "group": "Inputs", "definition": "(random(-180..180#15))\n", "description": "

direction of force A

", "templateType": "anything"}, "ForceC": {"name": "ForceC", "group": "Outputs", "definition": "FC *( vector(cos(radians(gamma)),sin(radians(gamma))))", "description": "

Force C as a vector

", "templateType": "anything"}, "ForceR": {"name": "ForceR", "group": "Outputs", "definition": "ForceA+ForceB+ForceC", "description": "

Resultant as a vector

", "templateType": "anything"}, "FB": {"name": "FB", "group": "Inputs", "definition": "random(20..80#5)", "description": "

Magnitude of Force B

", "templateType": "anything"}, "units": {"name": "units", "group": "Inputs", "definition": "random(['ft','lb'],['in','lb'],['cm','N'])", "description": "", "templateType": "anything"}, "rho": {"name": "rho", "group": "Outputs", "definition": "degrees(direction(ForceR))", "description": "

direction of resultant

", "templateType": "anything"}, "gamma": {"name": "gamma", "group": "Inputs", "definition": "(random(-180..180#15))", "description": "

Direction of force C in degrees

", "templateType": "anything"}, "FC": {"name": "FC", "group": "Inputs", "definition": "random(20..80#5)", "description": "

Magnitude of force C

", "templateType": "anything"}, "ForceA": {"name": "ForceA", "group": "Outputs", "definition": "FA *( vector(cos(radians(alpha)),sin(radians(alpha))))", "description": "

force A as a vector

", "templateType": "anything"}, "ForceB": {"name": "ForceB", "group": "Outputs", "definition": "FB *( vector(cos(radians(beta)),sin(radians(beta))))", "description": "

Force B as a vector

", "templateType": "anything"}, "debug": {"name": "debug", "group": "Inputs", "definition": "false", "description": "", "templateType": "anything"}, "R": {"name": "R", "group": "Outputs", "definition": "abs(ForceR)", "description": "

Magnitude of resultant

", "templateType": "anything"}, "beta": {"name": "beta", "group": "Inputs", "definition": "(random(-180..180#15))", "description": "

Direction of force B

", "templateType": "anything"}}, "variablesTest": {"condition": "abs(alpha-beta) >= 15 and abs(beta-gamma) >= 15 and abs(gamma-alpha) >= 15 and r <=100 and r > 10", "maxRuns": 100}, "ungrouped_variables": [], "variable_groups": [{"name": "Inputs", "variables": ["alpha", "gamma", "beta", "FA", "FB", "FC", "units", "debug"]}, {"name": "Outputs", "variables": ["ForceA", "ForceB", "ForceC", "ForceR", "rho", "R"]}], "functions": {"direction": {"parameters": [["v", "vector"]], "type": "number", "language": "javascript", "definition": "return Math.atan2(v[1],v[0])"}}, "preamble": {"js": "", "css": ".red{color:red;}\n.blue{color:blue;}\n.green{color:green;}"}, "parts": [{"type": "gapfill", "useCustomName": true, "customName": "Magnitude", "marks": 0, "scripts": {}, "customMarkingAlgorithm": "", "extendBaseMarkingAlgorithm": true, "unitTests": [], "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacements": [], "variableReplacementStrategy": "originalfirst", "nextParts": [], "suggestGoingBack": false, "adaptiveMarkingPenalty": 0, "exploreObjective": null, "prompt": "

$R$ = [[0]]

$\\theta$  = [[0]] measured [[1]] from the [[2]].