// Numbas version: exam_results_page_options {"name": "B: Simple heating/phase change", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"tags": [], "parts": [{"extendBaseMarkingAlgorithm": true, "type": "numberentry", "prompt": "

Calculate the total heat absorbed by the {Mat_string} through this process in MJ to three significant figures.

", "marks": "6", "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "precisionPartialCredit": "85", "showPrecisionHint": false, "precision": "3", "precisionMessage": "You have not given your answer to three significant figures.", "customMarkingAlgorithm": "", "mustBeReducedPC": 0, "scripts": {}, "showCorrectAnswer": false, "showFeedbackIcon": true, "variableReplacements": [], "correctAnswerFraction": false, "strictPrecision": true, "correctAnswerStyle": "plain", "precisionType": "sigfig", "variableReplacementStrategy": "originalfirst", "minValue": "siground(totalheat_m,3)-siground(abs(totalheat_m/100),3)", "maxValue": "siground(totalheat_m,3)+siground(abs(totalheat_m/100),3)", "allowFractions": false, "unitTests": []}], "preamble": {"js": "", "css": ""}, "functions": {"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=\"oC\";\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;", "parameters": [], "language": "javascript", "type": "html"}, "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=\"oC\";\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;", "parameters": [], "language": "javascript", "type": "html"}}, "advice": "", "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"}, "extensions": ["jsxgraph"], "variablesTest": {"maxRuns": 100, "condition": ""}, "statement": "

{mass_string} of {Mat_string} is heated from {st_string} to {et_string}, changing in temperature and phase.

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Solid specific heatLatent Heat of fusionLiquid specific heatLatent Heat of vapourisationGaseous specific heatFusion TemperatureVaporisation Temperature
{Mat_string}{solid_heatcap} JK<sup>-1</sup>kg<sup>-1</sup>{phase1_latentheat} Jkg<sup>-1</sup>{liquid_heatcap} JK<sup>-1</sup>kg<sup>-1</sup>{phase2_latentheat} Jkg<sup>-1</sup>{gas_heatcap} JK<sup>-1</sup>kg<sup>-1</sup>{phase1_temp} K{phase2_temp} K
\n

", "rulesets": {}, "name": "B: Simple heating/phase change", "ungrouped_variables": [], "variables": {"end_temp": {"name": "end_temp", "description": "", "templateType": "anything", "group": "Random variables", "definition": "if(switcharoo>0,random(phase2_temp+10..phase2_temp+100),random(phase1_temp+10..phase2_temp-10))"}, "advice0": {"name": "advice0", "description": "", "templateType": "anything", "group": "advice", "definition": "switch(\n switcharoo=0,\"The start temperature (\"+start_temp+\" K) is lower than the melting temperature of \"+Mat_string+\" (\"+phase1_temp+\" K) but the end temperature (\"+end_temp+\" K) is lower than the fusion temperature of \"+Mat_string+\" (\"+phase2_temp+\" K), so the \"+mat_string+\" goes through one phase change, starting as a solid and melting into a liquid.\",\n switcharoo=1,\"The start temperature (\"+start_temp+\" K) is lower than the melting temperature of \"+Mat_string+\" (\"+phase1_temp+\" K) and the end temperature (\"+end_temp+\" K) is higher than the fusion temperature of \"+Mat_string+\" (\"+phase2_temp+\" K), so the \"+mat_string+\" goes through two phase changes, starting as a solid, melting into a liquid, then vaporising into a gas.\" ,\n switcharoo=2,\"The start temperature (\"+start_temp+\" K) is higher than the melting temperature of \"+Mat_string+\" (\"+phase1_temp+\" K) and the end temperature (\"+end_temp+\" K) is higher than the fusion temperature of \"+Mat_string+\" (\"+phase2_temp+\" K), so the \"+mat_string+\" goes through one phase changes, starting as a liquid, then vaporising into a gas.\" \n)"}, "phase2_latentheat": {"name": "phase2_latentheat", "description": "", "templateType": "anything", "group": "Material values", "definition": "vapour_lh_list[wat_mat]"}, "vapour_lh_list": {"name": "vapour_lh_list", "description": "", "templateType": "anything", "group": "Lists of values", "definition": "[2260000,293000,4730000,1580000]"}, "liquidheat": {"name": "liquidheat", "description": "", "templateType": "anything", "group": "Energy", "definition": "siground(switch(switcharoo=0,mass*liquid_heatcap*(end_temp-phase1_temp),switcharoo=1,mass*liquid_heatcap*(phase2_temp-phase1_temp),switcharoo=2,mass*liquid_heatcap*(phase2_temp-start_temp),0),6)"}, "mass": {"name": "mass", "description": "", "templateType": "anything", "group": "Random variables", "definition": "siground(if(random(0,1)=0,random(0.01..0.99#0.01),random(1.00..10.00#0.01)),3)"}, "solid_hc_list": {"name": "solid_hc_list", "description": "", "templateType": "anything", "group": "Lists of values", "definition": "[2100,110,390,130]"}, "advice3": {"name": "advice3", "description": "", "templateType": "anything", "group": "advice", "definition": "\"Heating the liquid: $Q = m \\\\times C_L \\\\times \\\\Delta T = \"+\nswitch(\n switcharoo=0,mass+' \\\\times '+liquid_heatcap+\" \\\\times (\"+end_temp+\" - \"+phase1_temp+\")\",\n switcharoo=1,mass+' \\\\times '+liquid_heatcap+\" \\\\times (\"+phase2_temp+\" - \"+phase1_temp+\")\",\n switcharoo=2,mass+' \\\\times '+liquid_heatcap+\" \\\\times (\"+phase2_temp+\" - \"+start_temp+\")\"\n)\n+\"= {liquidheat} J$\""}, "mat_string": {"name": "mat_string", "description": "", "templateType": "anything", "group": "Material values", "definition": "material_list[wat_mat]"}, "k_c_switch": {"name": "k_c_switch", "description": "", "templateType": "anything", "group": "Random variables", "definition": "random(0,1)"}, "phase2_temp": {"name": "phase2_temp", "description": "", "templateType": "anything", "group": "Material values", "definition": "vapour_temp_list[wat_mat]"}, "mass_string": {"name": "mass_string", "description": "", "templateType": "anything", "group": "kg or g", "definition": "if(mass<1,dpformat(mass*1000,0)+' g',dpformat(mass,2)+' kg')"}, "switcharoo_type": {"name": "switcharoo_type", "description": "", "templateType": "anything", "group": "switcharoo (phase type) values", "definition": "switcharoo_comment[switcharoo]"}, "gas_hc_list": {"name": "gas_hc_list", "description": "", "templateType": "anything", "group": "Lists of values", "definition": "[2000,135,350,110]"}, "phase1_temp": {"name": "phase1_temp", "description": "", "templateType": "anything", "group": "Material values", "definition": "fusion_temp_list[wat_mat]"}, "advice1": {"name": "advice1", "description": "", "templateType": "anything", "group": "advice", "definition": "if(switcharoo=2,\" \",\"Heating the solid: $Q = m \\\\times C_S \\\\times \\\\Delta T = \"+mass+\" \\\\times \"+solid_heatcap+\" \\\\times (\"+phase1_temp+\"-\"+start_temp+\") = \"+solidheat+\" J $\")"}, "switcharoo_comment": {"name": "switcharoo_comment", "description": "", "templateType": "list of strings", "group": "switcharoo (phase type) values", "definition": "[ \"solid_to_liquid\", \"solid_to_gas\", \"liquid_to_gas\" ]"}, "advice4": {"name": "advice4", "description": "", "templateType": "anything", "group": "advice", "definition": "if(switcharoo=0,\" \",\"Vaporising the \"+Mat_string+\": $Q = m \\\\times L_H = \"+mass+\" \\\\times \"+phase2_latentheat+\" = \"+vapourheat+\" J$\")"}, "fusion_lh_list": {"name": "fusion_lh_list", "description": "", "templateType": "anything", "group": "Lists of values", "definition": "[336000,11300,207000,63000]"}, "start_temp": {"name": "start_temp", "description": "", "templateType": "anything", "group": "Random variables", "definition": "if(switcharoo<2,random(100..phase1_temp-10),random(phase1_temp+10..phase2_temp-10))"}, "vapourheat": {"name": "vapourheat", "description": "", "templateType": "anything", "group": "Energy", "definition": "siground(if(switcharoo>0,mass*phase2_latentheat,0),6)"}, "liquid_heatcap": {"name": "liquid_heatcap", "description": "", "templateType": "anything", "group": "Material values", "definition": "liquid_hc_list[wat_mat]"}, "gas_heatcap": {"name": "gas_heatcap", "description": "", "templateType": "anything", "group": "Material values", "definition": "gas_hc_list[wat_mat]"}, "totalheat_m": {"name": "totalheat_m", "description": "", "templateType": "anything", "group": "Energy", "definition": "totalheat/10^6"}, "st_string": {"name": "st_string", "description": "", "templateType": "anything", "group": "K or C", "definition": "if(k_c_switch,start_temp+' K',(start_temp-273)+' $^\\\\circ$C') "}, "et_string": {"name": "et_string", "description": "", "templateType": "anything", "group": "K or C", "definition": "if(k_c_switch,end_temp+' K',(end_temp-273)+' $^\\\\circ$C') "}, "vapour_temp_list": {"name": "vapour_temp_list", "description": "", "templateType": "anything", "group": "Lists of values", "definition": "[373,630,2835,3243]"}, "fusionheat": {"name": "fusionheat", "description": "", "templateType": "anything", "group": "Energy", "definition": "siground(if(switcharoo<2,mass*phase1_latentheat,0),6)"}, "switcharoo": {"name": "switcharoo", "description": "", "templateType": "anything", "group": "Random variables", "definition": "random(0..2)"}, "material_list": {"name": "material_list", "description": "", "templateType": "anything", "group": "Lists of values", "definition": "['H2O','Mercury','Copper','Gold']"}, "fusion_temp_list": {"name": "fusion_temp_list", "description": "", "templateType": "anything", "group": "Lists of values", "definition": "[273,234,1357,1337]"}, "phase1_latentheat": {"name": "phase1_latentheat", "description": "", "templateType": "anything", "group": "Material values", "definition": "fusion_lh_list[wat_mat]"}, "phase_temp": {"name": "phase_temp", "description": "", "templateType": "anything", "group": "switcharoo (phase type) values", "definition": "switch(switcharoo=0,phase1_temp,switcharoo=2,phase2_temp,0)"}, "phase_latentheat": {"name": "phase_latentheat", "description": "", "templateType": "anything", "group": "switcharoo (phase type) values", "definition": "switch(switcharoo=0,phase1_latentheat,switcharoo=2,phase2_latentheat,0)"}, "totalheat": {"name": "totalheat", "description": "", "templateType": "anything", "group": "Energy", "definition": "solidheat+fusionheat+liquidheat+vapourheat+gasheat"}, "advice5": {"name": "advice5", "description": "", "templateType": "anything", "group": "advice", "definition": "if(switcharoo=0,\" \",\"Heating the gas: $Q = m \\\\times C_G \\\\times \\\\Delta T = \"+mass+\" \\\\times \"+gas_heatcap+\" (\"+end_temp+\"-\"+phase2_temp+\") = \"+gasheat+\" J$\")"}, "wat_mat": {"name": "wat_mat", "description": "", "templateType": "anything", "group": "Random variables", "definition": "random(0..3)"}, "liquid_hc_list": {"name": "liquid_hc_list", "description": "", "templateType": "anything", "group": "Lists of values", "definition": "[4200,140,490,150]"}, "solidheat": {"name": "solidheat", "description": "", "templateType": "anything", "group": "Energy", "definition": "siground(if(switcharoo<2,mass*solid_heatcap*(phase1_temp-start_temp),0),6)"}, "solid_heatcap": {"name": "solid_heatcap", "description": "", "templateType": "anything", "group": "Material values", "definition": "solid_hc_list[wat_mat]"}, "gasheat": {"name": "gasheat", "description": "", "templateType": "anything", "group": "Energy", "definition": "siground(if(switcharoo>0,mass*gas_heatcap*(end_temp-phase2_temp),0),6)"}, "advice2": {"name": "advice2", "description": "", "templateType": "anything", "group": "advice", "definition": "if(switcharoo=2,\" \",\"Melting the \"+Mat_string+\": $Q = m \\\\times L_H = \"+mass+\" \\\\times \"+phase1_latentheat+\" = \"+fusionheat+\" J$\")"}}, "variable_groups": [{"name": "switcharoo (phase type) values", "variables": ["switcharoo_comment", "switcharoo_type", "phase_temp", "phase_latentheat"]}, {"name": "kg or g", "variables": ["mass_string"]}, {"name": "Material values", "variables": ["mat_string", "phase1_temp", "phase2_temp", "gas_heatcap", "phase1_latentheat", "liquid_heatcap", "phase2_latentheat", "solid_heatcap"]}, {"name": "Energy", "variables": ["solidheat", "fusionheat", "liquidheat", "vapourheat", "gasheat", "totalheat", "totalheat_m"]}, {"name": "K or C", "variables": ["st_string", "et_string"]}, {"name": "Lists of values", "variables": ["material_list", "solid_hc_list", "liquid_hc_list", "gas_hc_list", "fusion_lh_list", "vapour_lh_list", "fusion_temp_list", "vapour_temp_list"]}, {"name": "Random variables", "variables": ["switcharoo", "wat_mat", "start_temp", "end_temp", "k_c_switch", "mass"]}, {"name": "advice", "variables": ["advice1", "advice2", "advice3", "advice4", "advice5", "advice0"]}], "type": "question", "contributors": [{"name": "Tom Stallard", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/841/"}]}]}], "contributors": [{"name": "Tom Stallard", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/841/"}]}