// Numbas version: exam_results_page_options {"name": "Moment of Inertia: rectangles", "extensions": ["geogebra", "quantities", "weh"], "custom_part_types": [{"help_url": "", "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": [{"help_url": "", "hint": "The correct answer given as a JME quantity.", "input_type": "code", "evaluate": true, "label": "Correct Quantity.", "name": "correctAnswer", "default_value": ""}, {"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", "evaluate": true, "label": "% Accuracy for right.", "name": "right", "default_value": "0.2"}, {"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", "evaluate": true, "label": "% Accuracy for close.", "name": "close", "default_value": "1.0"}, {"help_url": "", "hint": "Partial Credit for close value with appropriate units.  if correct answer is 100 N and close is ±1%,
99  N is accepted.", "input_type": "percent", "label": "Close with units.", "name": "C1", "default_value": "75"}, {"help_url": "", "hint": "Partial credit for forgetting units or using wrong sign.
If the correct answer is 100 N, both 100 and -100 N are accepted.", "input_type": "percent", "label": "No units or wrong sign", "name": "C2", "default_value": "50"}, {"help_url": "", "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.", "input_type": "percent", "label": "Close, no units.", "name": "C3", "default_value": "25"}], "source": {"edit_page": "/part_type/19/edit", "pk": 19, "author": {"name": "William Haynes", "pk": 2530}}, "published": false}], "resources": [], "navigation": {"showfrontpage": false, "preventleave": false, "allowregen": true}, "question_groups": [{"questions": [{"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

", "ungrouped_variables": ["A", "B", "add", "unit", "units"], "preamble": {"css": "", "js": ""}, "type": "question", "variable_groups": [{"name": "Unnamed group", "variables": ["b_1", "h_1", "b_2", "h_2", "b_3", "h_3", "b_4", "h_4", "Ix", "removed_x", "removed_y", "Iy"]}], "rulesets": {}, "name": "Moment of Inertia: rectangles", "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)}$

", "parts": [{"showCorrectAnswer": true, "type": "gapfill", "marks": 0, "showFeedbackIcon": true, "gaps": [{"customMarkingAlgorithm": "", "variableReplacements": [], "scripts": {}, "type": "engineering-answer", "marks": "5", "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "unitTests": [], "settings": {"close": "1.0", "C2": "50", "C3": "25", "C1": "75", "correctAnswer": "Ix units", "right": "0.2"}, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}, {"customMarkingAlgorithm": "", "variableReplacements": [], "scripts": {}, "type": "engineering-answer", "marks": "5", "showFeedbackIcon": true, "extendBaseMarkingAlgorithm": true, "unitTests": [], "settings": {"close": "1.0", "C2": "50", "C3": "25", "C1": "75", "correctAnswer": "Iy units", "right": "0.2"}, "showCorrectAnswer": true, "variableReplacementStrategy": "originalfirst"}], "customMarkingAlgorithm": "", "variableReplacements": [], "scripts": {}, "variableReplacementStrategy": "originalfirst", "extendBaseMarkingAlgorithm": true, "unitTests": [], "prompt": "

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

", "sortAnswers": false}], "extensions": ["geogebra", "quantities", "weh"], "variablesTest": {"maxRuns": 100, "condition": "if(add, B[0]>A[0], B[0] B[1]"}, "tags": ["area moment of inertia", "Area moment of inertia", "mechanics", "Mechanics", "moment of inertia", "second moment of area", "statics", "Statics"], "metadata": {"description": "

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

", "licence": "Creative Commons Attribution-NonCommercial 4.0 International"}, "functions": {"MOI": {"language": "jme", "definition": "b * h * h * h /3", "type": "number", "parameters": [["b", "number"], ["h", "number"]]}}, "contributors": [{"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/", "name": "William Haynes"}], "variables": {"Iy": {"definition": "MOI(b_3,h_3) + if(removed_y,-1,1) MOI(b_4,h_4)", "description": "", "name": "Iy", "templateType": "anything", "group": "Unnamed group"}, "h_2": {"definition": "B[1]", "description": "", "name": "h_2", "templateType": "anything", "group": "Unnamed group"}, "b_3": {"definition": "B[1]", "description": "", "name": "b_3", "templateType": "anything", "group": "Unnamed group"}, "b_1": {"definition": "A[0]", "description": "", "name": "b_1", "templateType": "anything", "group": "Unnamed group"}, "h_1": {"definition": "A[1]", "description": "", "name": "h_1", "templateType": "anything", "group": "Unnamed group"}, "b_4": {"definition": "abs(b[1]-A[1])", "description": "", "name": "b_4", "templateType": "anything", "group": "Unnamed group"}, "unit": {"definition": "random('in', 'cm', 'ft', 'm')", "description": "", "name": "unit", "templateType": "anything", "group": "Ungrouped variables"}, "h_3": {"definition": "B[0]", "description": "", "name": "h_3", "templateType": "anything", "group": "Unnamed group"}, "A": {"definition": "vector(random(1..10),random(1..10))", "description": "", "name": "A", "templateType": "anything", "group": "Ungrouped variables"}, "Ix": {"definition": "MOI(b_1,h_1) + if(removed_x,-1,1) MOI(b_2,h_2)", "description": "", "name": "Ix", "templateType": "anything", "group": "Unnamed group"}, "h_4": {"definition": "A[0]", "description": "", "name": "h_4", "templateType": "anything", "group": "Unnamed group"}, "add": {"definition": "random(true,false)", "description": "", "name": "add", "templateType": "anything", "group": "Ungrouped variables"}, "b_2": {"definition": "abs(B[0]-A[0])", "description": "", "name": "b_2", "templateType": "anything", "group": "Unnamed group"}, "units": {"definition": "qty(1,unit+'^4')", "description": "", "name": "units", "templateType": "anything", "group": "Ungrouped variables"}, "B": {"definition": "vector(random(1..10),random(1..10))", "description": "", "name": "B", "templateType": "anything", "group": "Ungrouped variables"}, "removed_y": {"definition": "add and (B[1]>A[1])", "description": "", "name": "removed_y", "templateType": "anything", "group": "Unnamed group"}, "removed_x": {"definition": "not(add)", "description": "

remove

", "name": "removed_x", "templateType": "anything", "group": "Unnamed group"}}}], "pickingStrategy": "all-ordered"}], "contributors": [{"profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2530/", "name": "William Haynes"}]}