// Numbas version: exam_results_page_options {"name": "Equivalent System: two parallel forces", "extensions": ["geogebra", "quantities", "weh"], "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.

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": [{"tags": ["equivalent system", "mechanics", "moment", "statics"], "variablesTest": {"condition": "", "maxRuns": 100}, "extensions": ["geogebra", "quantities", "weh"], "statement": "

{geogebra_applet('drbgytkc',[['d',d],['ratio',ratio]])}

\n

A {L} {units[0]} long cantilever beam is loaded with vertical forces $A = \\var{force(A)}$ and $B = \\var{force(B)},$ separated by a distance $d$ = {d L} {units[0]}, as shown.

\n

Replace the two forces with a single equivalent force R and determine the distance $\\bar{x}$ from the left end of the beam to the line of action of R.

\n

", "metadata": {"licence": "Creative Commons Attribution-NonCommercial 4.0 International", "description": "

Replace two parallel forces with an equivalent single force

"}, "ungrouped_variables": ["L", "d", "ratio", "A", "B", "units"], "advice": "

Since both forces are vertical, the resultant force with also be vertical, with a magnitude

\n

\\begin{align} R &= A + B \\\\&= \\var{A} + \\var{B}\\\\ &= \\var{force(R)}\\end{align}

\n

The equivalent force R must produce the same moment about any point as the orignal system of forces did.  Chosing the left end of the beam as the moment center, and equating moments, gives:

\n

\\begin{align} M_2 &= M_1\\\\ R\\, \\bar{x} &= A \\,(L - d) + B\\, (L)\\\\ \\bar{x} & = \\dfrac{\\var{force(A)}\\cdot \\var{dist(L - d L)} +\\var{force(B)}\\,\\cdot \\var{dist(L)}} {\\var{force(R)}} \\\\ &= \\var{dist(xbar)} \\end{align}

", "preamble": {"js": "", "css": ""}, "name": "Equivalent System: two parallel forces", "variable_groups": [{"variables": ["R", "xbar"], "name": "Unnamed group"}], "functions": {"dist": {"parameters": [["d", "number"]], "type": "quantity", "definition": "siground(qty(d,units[0]),4)", "language": "jme"}, "force": {"parameters": [["F", "number"]], "type": "quantity", "definition": "siground(qty(f,units[1]),4)", "language": "jme"}}, "variables": {"xbar": {"description": "", "group": "Unnamed group", "definition": "(A *(L - d L) + B L)/R", "templateType": "anything", "name": "xbar"}, "A": {"description": "", "group": "Ungrouped variables", "definition": "random(10..100#5)", "templateType": "anything", "name": "A"}, "ratio": {"description": "

ratio of magnitude of force B to magnitude of  force A

", "group": "Ungrouped variables", "definition": "random(0.5..2#0.1)\n", "templateType": "anything", "name": "ratio"}, "units": {"description": "", "group": "Ungrouped variables", "definition": "['m', 'kN']", "templateType": "anything", "name": "units"}, "d": {"description": "

ratio of distance between A and B to length.

", "group": "Ungrouped variables", "definition": "random(0.3..0.8#0.05)", "templateType": "anything", "name": "d"}, "R": {"description": "", "group": "Unnamed group", "definition": "A + B", "templateType": "anything", "name": "R"}, "L": {"description": "", "group": "Ungrouped variables", "definition": "random(8,10,12)", "templateType": "anything", "name": "L"}, "B": {"description": "", "group": "Ungrouped variables", "definition": "ratio A\n", "templateType": "anything", "name": "B"}}, "rulesets": {}, "parts": [{"type": "gapfill", "scripts": {"mark": {"order": "instead", "script": "numbasGGBApplet0.setVisible('show',true)"}}, "gaps": [{"customMarkingAlgorithm": "", "type": "engineering-answer", "unitTests": [], "variableReplacements": [], "marks": "4", "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "scripts": {}, "settings": {"C2": "50", "correctAnswer": "Force(R)", "close": "1.0", "C3": "25", "C1": "75", "right": "0.2"}, "showFeedbackIcon": true, "showCorrectAnswer": true}, {"customMarkingAlgorithm": "", "type": "engineering-answer", "unitTests": [], "variableReplacements": [], "marks": "4", "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "scripts": {}, "settings": {"C2": "50", "correctAnswer": "dist(xbar)", "close": "1.0", "C3": "25", "C1": "75", "right": "0.2"}, "showFeedbackIcon": true, "showCorrectAnswer": true}], "marks": 0, "variableReplacementStrategy": "originalfirst", "showCorrectAnswer": true, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "prompt": "

$R$ = [[0]]  $\\qquad \\bar{x} =$ [[1]]

", "unitTests": [], "customMarkingAlgorithm": "", "sortAnswers": false, "variableReplacements": []}], "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/"}]}