// Numbas version: finer_feedback_settings {"name": "David's copy of Balancing heating in materials + wavelength", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"ungrouped_variables": [], "parts": [{"minValue": "siground(Q_water_kj,3)-siground(abs(Q_water_kj/100),3)", "showFeedbackIcon": true, "marks": "1", "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "maxValue": "siground(Q_water_kj,3)+siground(abs(Q_water_kj/100),3)", "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "showCorrectAnswer": true, "prompt": "
Calculate the total heat absorbed by the water through this process, in kJ, to three significant figures.
", "variableReplacements": [], "type": "numberentry"}, {"minValue": "siground(d_temp2,3)-siground(abs(d_temp2/100),3)", "showFeedbackIcon": true, "marks": "2", "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "maxValue": "siground(d_temp2,3)+siground(abs(d_temp2/100),3)", "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "showCorrectAnswer": true, "prompt": "Calculate the change in temperature of the {Mat_string} in the water, to three significant figures.
", "variableReplacements": [{"variable": "q_water", "must_go_first": true, "part": "p0"}], "type": "numberentry"}, {"minValue": "siground(wavelength,3)-siground(abs(wavelength/100),3)", "showFeedbackIcon": true, "marks": "2", "correctAnswerFraction": false, "variableReplacementStrategy": "originalfirst", "maxValue": "siground(wavelength,3)+siground(abs(wavelength/100),3)", "allowFractions": false, "notationStyles": ["plain", "en", "si-en"], "scripts": {}, "correctAnswerStyle": "plain", "showCorrectAnswer": true, "prompt": "Assuming the {Mat_string} is a perfect blackbody, what was the peak wavelength of emission for the {Mat_string} when it was fully heated in the flame, in microns (μm), to three significant figures. Assume Wien's displacement constant k<sub>W</sub> = {kw} μmK.
", "variableReplacements": [{"variable": "d_temp2", "must_go_first": true, "part": "p1"}], "type": "numberentry"}], "advice": "a)
\nQ = m * C<sub>{'S'}</sub> * ΔT
Q = {mass2} * {water_heatcap} * ({temp1}-{temp0})
\nQ = {siground(q_water,6)} J
\nSo the heat added to the water is {siground(q_water_kj,3)} kJ.
\nb)
\nThe heat added to the water was taken from the {Mat_string}, so that
\nQ<sub>{Mat_string}</sub> = -{siground(q_water_kj,3)} kJ.
\nQ<sub>{Mat_string}</sub> = m * C<sub>{Mat_string}</sub> * ΔT
\nso
\nΔT = Q<sub>{Mat_string}</sub>/(m * C<sub>{Mat_string}</sub>)
\nΔT = -{siground(q_water,3)}/({mass} * {solid_heatcap})
\nΔT ={siground(d_temp2,3)} K
\nc)
\nFirstly, calculate the initial temperature of the {Mat_string} in K:
\nT = {siground(d_temp2*(-1),3)} + {temp0} + 273.15 = {siground(temp2,3)} K
\nThen calculate the wavelength:
\nWavelength = K<sub>W</sub> / T = {kw} /{siground(temp2,3)}
\nSo the {mat_string} was glowing with a peak at {siground(wavelength,3)} μm.
", "metadata": {"description": "A random heating question, that randomly picks a material, and then heats it through either one or two phase changes, provides an example graph of the heating with scaled temperature ranges (though not with scaled latent and specific heats), and a table with the suitable constants.
", "licence": "Creative Commons Attribution 4.0 International"}, "rulesets": {}, "functions": {"onestep": {"definition": "// Takes variables\n\n// showing K or C?\nk_c = Numbas.jme.unwrapValue(scope.variables.k_c_switch);\n\nif (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\nst = Numbas.jme.unwrapValue(scope.variables.start_temp)+k_c_corr;\net = Numbas.jme.unwrapValue(scope.variables.end_temp)+k_c_corr;\npt = Numbas.jme.unwrapValue(scope.variables.phase_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('500px','300px',\n {boundingBox: [-4,et+10,20,st-10],\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\nvar yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\nvar yticks = board.create('ticks',[yaxis,parseInt((et-st)/50.)*10],{\ndrawZero:true,\ndrawLabels: true,\nlabel: {offset: [20, 0]},\nminorTicks: 0\n});\n\n//\n//slope 1\nvar slope1 = board.create('line',[[4,st],[((pt-st)/((pt-st)+(et-pt))*8)+4,pt]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar slope2 = board.create('line',[[((pt-st)/((pt-st)+(et-pt))*8)+4,pt],[16-((et-pt)/((pt-st)+(et-pt))*8),pt]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar slope3 = board.create('line',[[16-((et-pt)/((pt-st)+(et-pt))*8),pt],[16,et]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n\nvar dash1 = board.create('line',[[((pt-st)/((pt-st)+(et-pt))*8)+4,st-5],[((pt-st)/((pt-st)+(et-pt))*8)+4,et+5]], {dash:2, strokewidth:1, straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar dash2 = board.create('line',[[16-((et-pt)/((pt-st)+(et-pt))*8),st-5],[16-((et-pt)/((pt-st)+(et-pt))*8),et+5]], {dash:2, strokewidth:1, straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n\n\n//label the y-axis\n var label = board.create('text',[-2,(et+st)/2,k_c_str]);\n\n\n// and return the container div\nreturn div;", "type": "html", "parameters": [], "language": "javascript"}, "twostep": {"definition": "// Takes variables\n\n// showing K or C?\nk_c = Numbas.jme.unwrapValue(scope.variables.k_c_switch);\n\nif (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\nst = Numbas.jme.unwrapValue(scope.variables.start_temp)+k_c_corr;\net = Numbas.jme.unwrapValue(scope.variables.end_temp)+k_c_corr;\npt1 = Numbas.jme.unwrapValue(scope.variables.phase1_temp)+k_c_corr;\npt2 = 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('500px','300px',\n {boundingBox: [-5,et+(et-st)/10.,28,st-(et-st)/10.],\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\nvar yaxis = board.create('line',[[0,0],[0,1]], { strokeColor: 'black', fixed: true });\nvar yticks = board.create('ticks',[yaxis,parseInt((et-st)/50.)*10],{\ndrawZero:true,\ndrawLabels: true,\nlabel: {offset: [20, 0]},\nminorTicks: 0\n});\n\n\n// full size of the five slopes\nvar allslope=(et-st);\nvar s1sz=(8*(pt1-st)/allslope);\nvar s3sz=(8*(pt2-pt1)/allslope);\nvar s5sz=(8*(et-pt2)/allslope);\n\n\n//\n//slope 1\nvar slope1 = board.create('line',[[4,st],[s1sz+4,pt1]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar slope2 = board.create('line',[[s1sz+4,pt1],[s1sz+8,pt1]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar slope3 = board.create('line',[[s1sz+8,pt1],[s1sz+s3sz+8,pt2]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar slope4 = board.create('line',[[s1sz+s3sz+8,pt2],[s1sz+s3sz+12,pt2]], {straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar slope5 = board.create('line',[[s1sz+s3sz+12,pt2],[s1sz+s3sz+s5sz+12,et]], {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\nvar dash1 = board.create('line',[[s1sz+4,st-10],[s1sz+4,et+10]], {dash:2, strokewidth:1, straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar dash2 = board.create('line',[[s1sz+8,st-10],[s1sz+8,et+10]], {dash:2, strokewidth:1, straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\nvar 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 });\nvar 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\n var label = board.create('text',[-2,(et+st)/2,k_c_str]);\n\n\n// and return the container div\nreturn div;", "type": "html", "parameters": [], "language": "javascript"}}, "variable_groups": [{"name": "kg or g", "variables": ["mass_string", "mass2_string"]}, {"name": "Material values", "variables": ["mat_string", "phase1_temp", "solid_heatcap", "water_heatcap"]}, {"name": "Lists of values", "variables": ["material_list", "solid_hc_list", "fusion_temp_list"]}, {"name": "Random variables", "variables": ["wat_mat", "temp0", "temp1", "mass", "mass2"]}, {"name": "Q values", "variables": ["Q_water", "Q_water_kj", "d_temp2", "temp2", "wavelength", "kw"]}], "tags": [], "preamble": {"css": "", "js": ""}, "statement": "\nA room is in complete thermal equilibrium at {temp0} °C. A {mass_string} lump of {Mat_string} is heated in a flame for several minutes. The {Mat_string} is then transferred quickly into {mass2_string} of water, and the water and {Mat_string} both reach {temp1} °C.
\n\n\n | Solid {Mat_string} | \nLiquid water | \n
Specific heat capacity | \n{solid_heatcap} JK<sup>-1</sup>kg<sup>-1</sup> | \n{water_heatcap} JK<sup>-1</sup>kg<sup>-1</sup> | \n