// Numbas version: finer_feedback_settings {"name": "Josh's copy of Block sliding down a frictionless slope (with graphic)", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"name": "Josh's copy of Block sliding down a frictionless slope (with graphic)", "rulesets": {}, "type": "question", "parts": [{"minValue": "FN-FN/100", "scripts": {}, "unitTests": [], "type": "numberentry", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "showFeedbackIcon": true, "marks": 1, "customMarkingAlgorithm": "", "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "maxValue": "FN+FN/100", "variableReplacements": [], "prompt": "

Find the normal reaction, $F_N$ between the block and the plane, in N to 3 decimal places.

", "mustBeReduced": false, "allowFractions": false, "notationStyles": ["plain", "en", "si-en"]}, {"minValue": "FP-FP/100", "scripts": {}, "unitTests": [], "type": "numberentry", "extendBaseMarkingAlgorithm": true, "showCorrectAnswer": true, "showFeedbackIcon": true, "marks": 1, "customMarkingAlgorithm": "", "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "mustBeReducedPC": 0, "maxValue": "FP+FP/100", "variableReplacements": [], "prompt": "

Find the gravitational force on the block, parallel to the plane $F_P$, in N to 3 decimal places.

", "mustBeReduced": false, "allowFractions": false, "notationStyles": ["plain", "en", "si-en"]}, {"scripts": {}, "precisionType": "dp", "precisionMessage": "You have not given your answer to the correct precision.", "marks": "1", "showCorrectAnswer": true, "showFeedbackIcon": true, "variableReplacementStrategy": "originalfirst", "correctAnswerStyle": "plain", "maxValue": "answer+answer/100", "type": "numberentry", "strictPrecision": false, "minValue": "answer-answer/100", "unitTests": [], "showPrecisionHint": false, "extendBaseMarkingAlgorithm": true, "notationStyles": ["plain", "en", "si-en"], "prompt": "

{a_string}, to 3 decimal places.

", "mustBeReducedPC": 0, "customMarkingAlgorithm": "", "precisionPartialCredit": 0, "variableReplacements": [{"must_go_first": true, "variable": "FP", "part": "p1"}], "allowFractions": false, "mustBeReduced": false, "correctAnswerFraction": false, "precision": "3"}], "statement": "

{draw_block()}

\n

A block of mass {mass} kg slides down a frictionless plane which is inclined at an angle $\\theta$ = {theta}$^{\\circ}$ to the horizontal.

\n

The acceleration due to gravity is g={g} ms$^{-2}$.

", "variablesTest": {"maxRuns": 100, "condition": ""}, "variables": {"g": {"templateType": "anything", "definition": "9.8", "description": "", "group": "constants", "name": "g"}, "FP": {"templateType": "anything", "definition": "siground(mass*g*sin(radians(theta)),3)", "description": "", "group": "calculated variables", "name": "FP"}, "a": {"templateType": "anything", "definition": "siground(random(1.1..5#0.1),2)", "description": "

The acceleration of the block down the slope.

", "group": "random variables", "name": "a"}, "mass": {"templateType": "anything", "definition": "siground(random(0.2..9.9#0.1),2)", "description": "

The mass of the block.

", "group": "random variables", "name": "mass"}, "theta": {"templateType": "randrange", "definition": "random(30..60#1)", "description": "

The angle of the slope.

", "group": "random variables", "name": "theta"}, "answer": {"templateType": "anything", "definition": "aa", "description": "", "group": "calculated variables", "name": "answer"}, "aa": {"templateType": "anything", "definition": "siground(FP/mass,3)", "description": "", "group": "calculated variables", "name": "aa"}, "FN": {"templateType": "anything", "definition": "siground(mass*g*cos(radians(theta)),3)", "description": "

The normal reaction force of the plane on the block

", "group": "calculated variables", "name": "FN"}, "a_string": {"templateType": "anything", "definition": "\"Calculate the acceration of the block in ms$^\\{-2\\}$\"", "description": "", "group": "calculated variables", "name": "a_string"}}, "tags": [], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

A block of given mass is sliding down the plane with a given acceration. Find the normal reaction force, the parallel force and the missing value of a and mu.

"}, "variable_groups": [{"variables": ["mass", "theta", "a"], "name": "random variables"}, {"variables": ["FN", "FP", "aa", "answer", "a_string"], "name": "calculated variables"}, {"variables": ["g"], "name": "constants"}], "advice": "

a)

\n

To find the normal reaction force $F_N$, we resolve the forces perpendicular to the plane.

\n

 
$F_N =$ mg cos $\\theta$,
$F_N =$ {mass} $\\times$ {g} cos( {theta}$^{\\circ}$),

\n

And so the normal force $F_N$ is {fn} N.

\n

b)

\n

To find the force $F_P$ parallel to the plane, we resolve the forces parallel to the plane.

\n

 
$F_P =$ mg sin $\\theta$,
$F_P =$ {mass} $\\times$ {g} sin ({theta}$^{\\circ}$),

\n

And so the parallel force $F_P$ is {fp} N.

\n

\n

c)

\n

To find the acceleration of the block, you must calculate divide the force down the slope by the mass.

\n

F=ma

\n

a = F{\"<sub>P</sub>\"} / m

\n

a = {FP} / {mass}

\n

So, the acceration of the block is {answer} m/s<sup>-2</sup>.

\n

", "preamble": {"js": "", "css": ""}, "functions": {"draw_block": {"parameters": [], "type": "html", "language": "javascript", "definition": "// Takes variables\n\n// showing K or C?\n//k_c = Numbas.jme.unwrapValue(scope.variables.k_c_switch);\n//\n//if (k_c = 0) {\n// var k_c_corr =0;\n// var k_c_str=\"K\";\n//} else {\n// var k_c_corr =-273;\n// var k_c_str=\"\u00b0C\";\n//}\n\n//Set values\ntheta = Numbas.jme.unwrapValue(scope.variables.theta);\nr_theta = theta * Math.PI / 180. \nm = Numbas.jme.unwrapValue(scope.variables.mass);\n//et = Numbas.jme.unwrapValue(scope.variables.end_temp)+k_c_corr;\n//pt1 = Numbas.jme.unwrapValue(scope.variables.phase1_temp)+k_c_corr;\n//pt2 = Numbas.jme.unwrapValue(scope.variables.phase2_temp)+k_c_corr;\n\n\n// The function provided by the JSXGraph extension wraps the board up in\n// a div tag so that it's easier to embed in the page.\nvar div = Numbas.extensions.jsxgraph.makeBoard('300px','260px',\n//{boundingBox: [-0.1,-0.1,1.,1.],\n {boundingBox: [1.,0.8,-0.1,-0.1],\n axis: false,\n showNavigation: false,\n grid: false\n });\n\n// div.board is the object created by JSXGraph, which you use to\n// manipulate elements\nvar board = div.board;\n\n\n\n// create the x-axis.\n//var xaxis = board.create('line',[[0,0],[1,0]], {strokeColor: 'black', fixed: true});\n//var xticks = board.create('ticks',[xaxis,20],{\n// drawLabels: true,\n// minorTicks: 0\n//});\n\n// create the y-axis\n\n//var yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\n//var yticks = board.create('ticks',[yaxis,parseInt((et-st)/50.)*10],{\n//drawZero:true,\n//drawLabels: true,\n//label: {offset: [20, 0]},\n//minorTicks: 0\n//});\n\n\n// each line needs four coordinates start x,y and end x,y - these can then all be rotated\n\n// the slope itself\n\nvar l1_x1=0.\nvar l1_x2=0.9\nvar l1_y1=0.\nvar l1_y2=0.\n\n\t// the left edge of the box \n\nvar l2_x1=0.3\nvar l2_x2=0.3\nvar l2_y1=0\nvar l2_y2=0.2\n\n\t\t// the top edge of the box \n\nvar l3_x1=0.3\nvar l3_x2=0.6\nvar l3_y1=0.2\nvar l3_y2=0.2\n\t\t\t\n\t\t\t// the right edge of the box \n\nvar l4_x1=0.6\nvar l4_x2=0.6\nvar l4_y1=0.2\nvar l4_y2=0.\n\n//centre of the block\n\nvar c_x=0.45\nvar c_y=0.1\n\n//each line must be rotated by theta to get to the correct angle\n\n\n// the slope itself\n\nvar ql1_x1=l1_x1*Math.cos(r_theta)-l1_y1*Math.sin(r_theta)\nvar ql1_y1=l1_x1*Math.sin(r_theta)-l1_y1*Math.cos(r_theta)\nvar ql1_x2=l1_x2*Math.cos(r_theta)-l1_y2*Math.sin(r_theta)\nvar ql1_y2=l1_x2*Math.sin(r_theta)-l1_y2*Math.cos(r_theta)\n\n\t// the left edge of the box \n\nvar ql2_x1=l2_x1*Math.cos(r_theta)-l2_y1*Math.sin(r_theta)\nvar ql2_y1=l2_x1*Math.sin(r_theta)+l2_y1*Math.cos(r_theta)\nvar ql2_x2=l2_x2*Math.cos(r_theta)-l2_y2*Math.sin(r_theta)\nvar ql2_y2=l2_x2*Math.sin(r_theta)+l2_y2*Math.cos(r_theta)\n\n\t\t// the top edge of the box \n\nvar ql3_x1=l3_x1*Math.cos(r_theta)-l3_y1*Math.sin(r_theta)\nvar ql3_y1=l3_x1*Math.sin(r_theta)+l3_y1*Math.cos(r_theta)\nvar ql3_x2=l3_x2*Math.cos(r_theta)-l3_y2*Math.sin(r_theta)\nvar ql3_y2=l3_x2*Math.sin(r_theta)+l3_y2*Math.cos(r_theta)\n\t\t\t\n\t\t\t// the right edge of the box \n\nvar ql4_x1=l4_x1*Math.cos(r_theta)-l4_y1*Math.sin(r_theta)\nvar ql4_y1=l4_x1*Math.sin(r_theta)+l4_y1*Math.cos(r_theta)\nvar ql4_x2=l4_x2*Math.cos(r_theta)-l4_y2*Math.sin(r_theta)\nvar ql4_y2=l4_x2*Math.sin(r_theta)+l4_y2*Math.cos(r_theta)\n\n//centre of the box\n\nvar qc_x=c_x*Math.cos(r_theta)-c_y*Math.sin(r_theta)\nvar qc_y=c_x*Math.sin(r_theta)+c_y*Math.cos(r_theta)\n\n//var block = board.create('polygon',[ [0.3,0], [0.3,0.2] , [0.6,0.2] ,[0.6,0] ] );\n\n//\n//slope 1\nvar line1 = board.create('line',[[l1_x1,l1_y1],[l1_x2,l1_y2]], {straightFirst:true, straightLast:true, strokeColor: 'black', fixed: true });\nvar line1b = board.create('line',[[ql1_x1,ql1_y1],[ql1_x2,ql1_y2]], {straightFirst:false, straightLast:true, strokeColor: 'black', fixed: true });\nvar line2 = board.create('line',[[ql2_x1,ql2_y1],[ql2_x2,ql2_y2]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar line3 = board.create('line',[[ql3_x1,ql3_y1],[ql3_x2,ql3_y2]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar line4 = board.create('line',[[ql4_x1,ql4_y1],[ql4_x2,ql4_y2]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n\n//var slope6 = board.create('line',[[4,pt1],[20,pt2]], {dash:2,straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n\n//var dash1 = board.create('line',[[s1sz+4,st-10],[s1sz+4,et+10]], {dash:2, strokewidth:1, straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n//var dash2 = board.create('line',[[s1sz+8,st-10],[s1sz+8,et+10]], {dash:2, strokewidth:1, straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n//var dash3 = board.create('line',[[s1sz+s3sz+8,st-10],[s1sz+s3sz+8,et+10]], {dash:2, strokewidth:1, straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n//var dash4 = board.create('line',[[s1sz+s3sz+12,st-10],[s1sz+s3sz+12,et+10]], {dash:2, strokewidth:1, straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n\n\n//label the y-axis\nvar label = board.create('text',[0.25,0.05,theta+'\\xB0'],{fontSize:20});\n\n//label the mass\nvar mass = board.create('text',[qc_x,qc_y, m.toFixed(1)+' kg'], {display:'internal',rotate:-theta,anchorX:'middle',anchorY:'middle',fontSize:18});\n\n\n//var tRot = board.create('transform', [6,0.1,0.15], {type:'rotate'})\n//tRot.bindTo(mass);\n//board.update();\n// and return the container div\nreturn div;"}}, "extensions": ["jsxgraph"], "ungrouped_variables": [], "contributors": [{"name": "Tom Stallard", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/841/"}, {"name": "Josh Lim", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2990/"}]}]}], "contributors": [{"name": "Tom Stallard", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/841/"}, {"name": "Josh Lim", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/2990/"}]}