// Numbas version: exam_results_page_options {"name": "Moment of Inertia: rectangles", "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": [{"ungrouped_variables": ["A", "B", "add", "unit", "units"], "statement": "

Use the formula below for the moment of inertia of a rectangle about an axis passing through its base to find the moment of inertia of the composite shape about both the x- and y- axes.  Grid units are [{unit}].

\n

\$I = \\dfrac{b h^3}{3}\$  {geogebra_applet('b3fxtwx6',[['A',A],['B',B]])}

\n

", "variable_groups": [{"variables": ["b_1", "h_1", "b_2", "h_2", "b_3", "h_3", "b_4", "h_4", "Ix", "removed_x", "removed_y", "Iy"], "name": "Unnamed group"}], "extensions": ["geogebra", "quantities", "weh"], "preamble": {"css": "", "js": ""}, "variables": {"Iy": {"description": "", "group": "Unnamed group", "templateType": "anything", "definition": "MOI(b_3,h_3) + if(removed_y,-1,1) MOI(b_4,h_4)", "name": "Iy"}, "removed_x": {"description": "

remove

", "group": "Unnamed group", "templateType": "anything", "definition": "not(add)", "name": "removed_x"}, "add": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "random(true,false)", "name": "add"}, "h_2": {"description": "", "group": "Unnamed group", "templateType": "anything", "definition": "B[1]", "name": "h_2"}, "b_4": {"description": "", "group": "Unnamed group", "templateType": "anything", "definition": "abs(b[1]-A[1])", "name": "b_4"}, "removed_y": {"description": "", "group": "Unnamed group", "templateType": "anything", "definition": "add and (B[1]>A[1])", "name": "removed_y"}, "h_4": {"description": "", "group": "Unnamed group", "templateType": "anything", "definition": "A[0]", "name": "h_4"}, "A": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "vector(random(1..10),random(1..10))", "name": "A"}, "h_1": {"description": "", "group": "Unnamed group", "templateType": "anything", "definition": "A[1]", "name": "h_1"}, "unit": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "random('in', 'cm', 'ft', 'm')", "name": "unit"}, "Ix": {"description": "", "group": "Unnamed group", "templateType": "anything", "definition": "MOI(b_1,h_1) + if(removed_x,-1,1) MOI(b_2,h_2)", "name": "Ix"}, "b_3": {"description": "", "group": "Unnamed group", "templateType": "anything", "definition": "B[1]", "name": "b_3"}, "units": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "qty(1,unit+'^4')", "name": "units"}, "b_1": {"description": "", "group": "Unnamed group", "templateType": "anything", "definition": "A[0]", "name": "b_1"}, "h_3": {"description": "", "group": "Unnamed group", "templateType": "anything", "definition": "B[0]", "name": "h_3"}, "B": {"description": "", "group": "Ungrouped variables", "templateType": "anything", "definition": "vector(random(1..10),random(1..10))", "name": "B"}, "b_2": {"description": "", "group": "Unnamed group", "templateType": "anything", "definition": "abs(B[0]-A[0])", "name": "b_2"}}, "metadata": {"licence": "Creative Commons Attribution-NonCommercial 4.0 International", "description": "

Find moment of inertia wrt the x- and y- axes for a shape made up of two rectangles.

"}, "tags": ["area moment of inertia", "Area moment of inertia", "mechanics", "Mechanics", "moment of inertia", "second moment of area", "statics", "Statics"], "variablesTest": {"condition": "if(add, B[0]>A[0], B[0] B[1]", "maxRuns": 100}, "functions": {"MOI": {"language": "jme", "parameters": [["b", "number"], ["h", "number"]], "type": "number", "definition": "b * h * h * h /3"}}, "parts": [{"showCorrectAnswer": true, "type": "gapfill", "unitTests": [], "sortAnswers": false, "showFeedbackIcon": true, "gaps": [{"variableReplacements": [], "marks": "5", "showCorrectAnswer": true, "type": "engineering-answer", "unitTests": [], "customMarkingAlgorithm": "", "scripts": {}, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "settings": {"correctAnswer": "Ix units", "right": "0.2", "C3": "25", "close": "1.0", "C2": "50", "C1": "75"}}, {"variableReplacements": [], "marks": "5", "showCorrectAnswer": true, "type": "engineering-answer", "unitTests": [], "customMarkingAlgorithm": "", "scripts": {}, "extendBaseMarkingAlgorithm": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "settings": {"correctAnswer": "Iy units", "right": "0.2", "C3": "25", "close": "1.0", "C2": "50", "C1": "75"}}], "variableReplacementStrategy": "originalfirst", "variableReplacements": [], "marks": 0, "prompt": "

$I_x$ = [[0]] $\\qquad I_y =$ [[1]]

", "scripts": {}, "extendBaseMarkingAlgorithm": true, "customMarkingAlgorithm": ""}], "rulesets": {}, "advice": "

To find $I_x$ consider the shape to be made of a  $(\\var{b_1} \\times \\var{h_1})$ rectangle and a $(\\var{b_2} \\times \\var{h_2})$ {if(removed_x,'removed','')} rectangle.

\n

$\\quad I_x = \\dfrac{ (\\var{b_1}) (\\var{h_1})^3}{3} \\, \\var{if(removed_x, '–' , '+')} \\,\\dfrac{ (\\var{b_2}) (\\var{h_2})^3}{3} = \\var{siground(ix units, 4)} \\\\$

\n

To find $I_y$ consider the shape to be made of a  $(\\var{b_3} \\times \\var{h_3})$ rectangle and a $(\\var{b_4} \\times \\var{h_4})$ {if(removed_y,'removed','')} rectangle.

\n

$\\quad I_y = \\dfrac{ (\\var{b_3}) (\\var{h_3})^3}{3} \\, \\var{if(removed_y, '–' , '+')} \\,\\dfrac{ (\\var{b_4}) (\\var{h_4})^3}{3}= \\var{siground(Iy units,4)}$

", "name": "Moment of Inertia: rectangles", "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/"}]}