// 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)

\n

Q = m * C<sub>{'S'}</sub>  * ΔT

\n

Q = {mass2} * {water_heatcap} * ({temp1}-{temp0})

\n

Q = {siground(q_water,6)} J

\n

So the heat added to the water is {siground(q_water_kj,3)} kJ.

\n

b)

\n

The heat added to the water was taken from the {Mat_string}, so that

\n

Q<sub>{Mat_string}</sub> = -{siground(q_water_kj,3)} kJ.

\n

Q<sub>{Mat_string}</sub> = m * C<sub>{Mat_string}</sub> * ΔT

\n

so

\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

\n

c)

\n

Firstly, calculate the initial temperature of the {Mat_string} in K:

\n

T = {siground(d_temp2*(-1),3)} + {temp0} + 273.15 = {siground(temp2,3)} K

\n

Then calculate the wavelength:

\n

Wavelength = K<sub>W</sub> / T = {kw} /{siground(temp2,3)}

\n

So 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": "

\n

A 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\n\n\n\n\n\n\n\n\n\n\n\n
Solid {Mat_string}Liquid water
Specific heat capacity{solid_heatcap} JK<sup>-1</sup>kg<sup>-1</sup>{water_heatcap} JK<sup>-1</sup>kg<sup>-1</sup>
", "variablesTest": {"condition": "temp2 < phase1_temp", "maxRuns": 100}, "name": "David's copy of Balancing heating in materials + wavelength", "extensions": ["jsxgraph"], "variables": {"mass2_string": {"group": "kg or g", "name": "mass2_string", "definition": "if(mass2<1,dpformat(mass2*1000,0)+' g',dpformat(mass2,2)+' kg')", "templateType": "anything", "description": ""}, "mass2": {"group": "Random variables", "name": "mass2", "definition": "random(2.0..9.9#0.1)", "templateType": "anything", "description": ""}, "Q_water_kj": {"group": "Q values", "name": "Q_water_kj", "definition": "Q_water/1000", "templateType": "anything", "description": ""}, "wavelength": {"group": "Q values", "name": "wavelength", "definition": "kw/temp2", "templateType": "anything", "description": ""}, "mat_string": {"group": "Material values", "name": "mat_string", "definition": "material_list[wat_mat]", "templateType": "anything", "description": ""}, "d_temp2": {"group": "Q values", "name": "d_temp2", "definition": "Q_water_kj*(-1000)/(mass*solid_heatcap)", "templateType": "anything", "description": ""}, "fusion_temp_list": {"group": "Lists of values", "name": "fusion_temp_list", "definition": "[1235,933,1811,1357,1337]", "templateType": "anything", "description": ""}, "solid_hc_list": {"group": "Lists of values", "name": "solid_hc_list", "definition": "[240,900,450,390,130]", "templateType": "anything", "description": ""}, "mass": {"group": "Random variables", "name": "mass", "definition": "random(0.01..0.99#0.01)", "templateType": "anything", "description": ""}, "temp1": {"group": "Random variables", "name": "temp1", "definition": "temp0+random(1.0..10.0#0.1)", "templateType": "anything", "description": ""}, "kw": {"group": "Q values", "name": "kw", "definition": "2898", "templateType": "anything", "description": ""}, "mass_string": {"group": "kg or g", "name": "mass_string", "definition": "if(mass<1,dpformat(mass*1000,0)+' g',dpformat(mass,2)+' kg')", "templateType": "anything", "description": ""}, "solid_heatcap": {"group": "Material values", "name": "solid_heatcap", "definition": "solid_hc_list[wat_mat]", "templateType": "anything", "description": ""}, "temp0": {"group": "Random variables", "name": "temp0", "definition": "random(1.0..40.0#0.1)", "templateType": "anything", "description": ""}, "temp2": {"group": "Q values", "name": "temp2", "definition": "temp1+273.15-d_temp2", "templateType": "anything", "description": ""}, "water_heatcap": {"group": "Material values", "name": "water_heatcap", "definition": "4200", "templateType": "anything", "description": ""}, "wat_mat": {"group": "Random variables", "name": "wat_mat", "definition": "random(0..4)", "templateType": "anything", "description": ""}, "Q_water": {"group": "Q values", "name": "Q_water", "definition": "mass2*water_heatcap*(temp1-temp0)", "templateType": "anything", "description": ""}, "material_list": {"group": "Lists of values", "name": "material_list", "definition": "['Silver','Aluminium','Iron','Copper','Gold']", "templateType": "anything", "description": ""}, "phase1_temp": {"group": "Material values", "name": "phase1_temp", "definition": "fusion_temp_list[wat_mat]", "templateType": "anything", "description": ""}}, "type": "question", "contributors": [{"name": "David Rickard", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/451/"}, {"name": "Tom Stallard", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/841/"}]}]}], "contributors": [{"name": "David Rickard", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/451/"}, {"name": "Tom Stallard", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/841/"}]}