// Numbas version: exam_results_page_options {"name": "A4: Carnot cycle efficiency", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "preamble": {"css": "", "js": ""}, "statement": "

{draw_block()}

\n

A Carnot engine is in action. The temperature of its hot reservoir is {th} K, and the temperature of its cold reservoir is {tc} K

", "advice": "", "rulesets": {}, "ungrouped_variables": ["v1", "v2", "v3", "v4", "th", "tc", "n", "r", "p1", "p2", "p3", "p4", "hcr", "n3", "efficiency", "w_12", "w_34", "w_23", "w_41", "work", "q_h"], "extensions": ["jsxgraph"], "variables": {"v4": {"name": "v4", "description": "", "group": "Ungrouped variables", "definition": "(th*(v1^(hcr-1))/tc)^(1/(hcr-1))", "templateType": "anything"}, "w_23": {"name": "w_23", "description": "", "group": "Ungrouped variables", "definition": "((p3*v3)-(p2*v2))/(1-hcr)", "templateType": "anything"}, "w_12": {"name": "w_12", "description": "", "group": "Ungrouped variables", "definition": "n*R*Th*ln(v2/v1)", "templateType": "anything"}, "v2": {"name": "v2", "description": "

v1+random(0.5..4#0.1)

", "group": "Ungrouped variables", "definition": "v1+random(4.5..8#0.1)", "templateType": "anything"}, "w_34": {"name": "w_34", "description": "", "group": "Ungrouped variables", "definition": "n*R*Tc*ln(v4/v3)", "templateType": "anything"}, "work": {"name": "work", "description": "", "group": "Ungrouped variables", "definition": "siground(w_12+w_23+w_34+w_41,3)", "templateType": "anything"}, "th": {"name": "th", "description": "

random(600..950)

", "group": "Ungrouped variables", "definition": "random(1300..1950)", "templateType": "anything"}, "r": {"name": "r", "description": "", "group": "Ungrouped variables", "definition": "0.082", "templateType": "anything"}, "p4": {"name": "p4", "description": "", "group": "Ungrouped variables", "definition": "n*r*tc/v4", "templateType": "anything"}, "v3": {"name": "v3", "description": "

(Th V2(γ - 1)/Tc )1/(γ - 1)= V3

", "group": "Ungrouped variables", "definition": "(th*(v2^(hcr-1))/tc)^(1/(hcr-1))", "templateType": "anything"}, "n3": {"name": "n3", "description": "

test - should match n

", "group": "Ungrouped variables", "definition": "p3*v3/(r*tc)", "templateType": "anything"}, "p2": {"name": "p2", "description": "", "group": "Ungrouped variables", "definition": "n*r*th/v2", "templateType": "anything"}, "q_h": {"name": "q_h", "description": "", "group": "Ungrouped variables", "definition": "work/(efficiency/100)", "templateType": "anything"}, "n": {"name": "n", "description": "", "group": "Ungrouped variables", "definition": "random(0.1..5.0#0.1)", "templateType": "anything"}, "v1": {"name": "v1", "description": "", "group": "Ungrouped variables", "definition": "random(8.5..15.0#0.1)", "templateType": "anything"}, "tc": {"name": "tc", "description": "

th-random(50..300)

", "group": "Ungrouped variables", "definition": "th-random(400..600)", "templateType": "anything"}, "w_41": {"name": "w_41", "description": "", "group": "Ungrouped variables", "definition": "((p1*v1)-(p4*v4))/(1-hcr)", "templateType": "anything"}, "efficiency": {"name": "efficiency", "description": "", "group": "Ungrouped variables", "definition": "(1-(tc/th))*100", "templateType": "anything"}, "p1": {"name": "p1", "description": "", "group": "Ungrouped variables", "definition": "n*r*th/v1", "templateType": "anything"}, "p3": {"name": "p3", "description": "

P2V2hcr = P3V3hcr

", "group": "Ungrouped variables", "definition": "p2*v2^(hcr)/v3^(hcr)", "templateType": "anything"}, "hcr": {"name": "hcr", "description": "", "group": "Ungrouped variables", "definition": "1.6", "templateType": "anything"}}, "functions": {"draw_block": {"parameters": [], "type": "html", "language": "javascript", "definition": "\n//Set values\np1 = Numbas.jme.unwrapValue(scope.variables.p1);\np2 = Numbas.jme.unwrapValue(scope.variables.p2);\np3 = Numbas.jme.unwrapValue(scope.variables.p3);\np4 = Numbas.jme.unwrapValue(scope.variables.p4);\n\nv1 = Numbas.jme.unwrapValue(scope.variables.v1);\nv2 = Numbas.jme.unwrapValue(scope.variables.v2);\nv3 = Numbas.jme.unwrapValue(scope.variables.v3);\nv4 = Numbas.jme.unwrapValue(scope.variables.v4);\nth = Numbas.jme.unwrapValue(scope.variables.th);\ntc = Numbas.jme.unwrapValue(scope.variables.tc);\n\nr = Numbas.jme.unwrapValue(scope.variables.r);\nn = Numbas.jme.unwrapValue(scope.variables.n);\nhcr = Numbas.jme.unwrapValue(scope.variables.hcr);\n\nvstep12=(v2-v1)/20.0\nvstep23=(v3-v2)/20.0\nvstep43=(v3-v4)/20.0\nvstep14=(v4-v1)/20.0\n\n\nmaxp=Math.max(p1,p2,p3,p4)*1.1;\nminp=Math.min(p1,p2,p3,p4)-0.5;\n\nmaxv=Math.max(v1,v2,v3,v4)*1.1;\nminv=Math.min(v1,v2,v3,v4)-0.5;\n\n\npticks=parseInt(maxp/16)*2\nvticks=parseInt(maxv/10)\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','360px',\n {boundingBox: [-0.5,maxp,maxv,-0.5],\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.\nvar xaxis = board.create('line',[[0,0],[maxv,0]], {strokeColor: 'black', fixed: false});\nvar xticks = board.create('ticks',[xaxis,vticks],{\n drawLabels: true,\n minorTicks: 1,\n label: {offset: [-3, 20]}\n});\n\n// create the y-axis\n\nvar yaxis = board.create('line',[[0,0],[0,maxp]], {strokeColor: 'black', fixed: false});\nvar yticks = board.create('ticks',[yaxis,pticks],{\n drawLabels: true,\n minorTicks: 1,\n label: {offset: [20, -3]}\n});\n\n\n// each line needs four coordinates start x,y and end x,y - these can then all be rotated\n\n\n//\n//slope 1\n\n\nvar X12 = []\nvar Y12 = []\n\nfor (i = 0; i < 21; i++) {\n X12.push(v1+(vstep12*i));\n Y12.push(p1*v1/(v1+(vstep12*i)));\n}\n\nvar X23 = []\nvar Y23 = []\n\nfor (i = 0.0; i < 21.0; i++) {\n X23.push(v2+(vstep23*i));\n Y23.push(p2*Math.pow(v2, hcr)/Math.pow((v2+(vstep23*i)), hcr));\n}\n\nvar X43 = []\nvar Y43 = []\n\nfor (i = 0; i < 21; i++) {\n X43.push(v4+(vstep43*i));\n Y43.push(p4*v4/(v4+(vstep43*i)));\n}\n\nvar X14 = []\nvar Y14 = []\n\nfor (i = 0.0; i < 21.0; i++) {\n X14.push(v1+(vstep14*i));\n Y14.push(p1*Math.pow(v1, hcr)/Math.pow((v1+(vstep14*i)), hcr));\n}\n\n\n\n\n\n\nvar step12 = board.create('curve', [X12,Y12],{strokeColor:'red',strokeWidth:3});\nvar step23 = board.create('curve', [X23,Y23],{strokeColor:'black',strokeWidth:3, dash:2});\nvar step43 = board.create('curve', [X43,Y43],{strokeColor:'blue',strokeWidth:3});\nvar step14 = board.create('curve', [X14,Y14],{strokeColor:'black',strokeWidth:3, dash:2});\n\n//var dash43 = board.create('line',[[v1,p1],[v2,p2]], {dash:1, strokewidth:1, straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n//var dash43 = board.create('line',[[v1,p1],[v4,p4]], {dash:2, strokewidth:1, straightFirst:false, straightLast:false, strokeColor: 'black', fixed: true });\n\nboard.create('text',[v1,p1,'1'],{fontSize:20,anchorX:'middle',anchorY:'middle'});\nboard.create('text',[v2,p2,'2'],{fontSize:20,anchorX:'middle',anchorY:'middle'});\nboard.create('text',[v3,p3,'3'],{fontSize:20,anchorX:'middle',anchorY:'middle'});\nboard.create('text',[v4,p4,'4'],{fontSize:20,anchorX:'middle',anchorY:'middle'});\n\n\nboard.create('text',[maxv/2,-0.2,'Volume'],{fontSize:20,anchorX:'middle',anchorY:'middle'});\nboard.create('text',[-0.2,maxp/2,'Pressure'],{display:'internal',fontSize:20,anchorX:'middle',anchorY:'middle',rotate:90});\n\n// and return the container div\nreturn div;"}}, "parts": [{"prompt": "

Calculate the efficiency of the carnot engine, in percent to three significant figures.

", "variableReplacementStrategy": "originalfirst", "maxValue": "siground(efficiency,3)+siground(abs(efficiency/100),3)", "correctAnswerStyle": "plain", "mustBeReduced": false, "correctAnswerFraction": false, "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "showCorrectAnswer": false, "precisionType": "sigfig", "showPrecisionHint": false, "unitTests": [], "precisionPartialCredit": "50", "allowFractions": false, "minValue": "siground(efficiency,3)-siground(abs(efficiency/100),3)", "showFeedbackIcon": true, "precision": "3", "extendBaseMarkingAlgorithm": true, "marks": "2", "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [], "strictPrecision": true, "scripts": {}, "customMarkingAlgorithm": ""}, {"prompt": "

The work done by the Carnot cycle was {work} J. Calculate the amount of heat added to the system from the hot reservoir, to three significant figures.

", "variableReplacementStrategy": "originalfirst", "maxValue": "siground(q_h,3)+siground(abs(q_h/100),3)", "correctAnswerStyle": "plain", "mustBeReduced": false, "correctAnswerFraction": false, "precisionMessage": "You have not given your answer to the correct precision.", "mustBeReducedPC": 0, "showCorrectAnswer": false, "precisionType": "sigfig", "showPrecisionHint": false, "unitTests": [], "precisionPartialCredit": "50", "allowFractions": false, "minValue": "siground(q_h,3)-siground(abs(q_h/100),3)", "showFeedbackIcon": true, "precision": "3", "extendBaseMarkingAlgorithm": true, "marks": "2", "type": "numberentry", "notationStyles": ["plain", "en", "si-en"], "variableReplacements": [{"part": "p0", "variable": "efficiency", "must_go_first": true}], "strictPrecision": true, "scripts": {}, "customMarkingAlgorithm": ""}], "name": "A4: Carnot cycle efficiency", "variablesTest": {"maxRuns": 100, "condition": ""}, "tags": [], "metadata": {"description": "

Calculate the efficiency and heat from the hot reservoir in a Carnot Cycle (with carnot diagram)

", "licence": "Creative Commons Attribution 4.0 International"}, "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/"}]}