// Numbas version: exam_results_page_options {"name": "Carnot cycle efficiency", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"tags": [], "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

", "parts": [{"precisionPartialCredit": "50", "mustBeReduced": false, "minValue": "siground(efficiency,3)-siground(abs(efficiency/100),3)", "precisionMessage": "You have not given your answer to the correct precision.", "marks": "2", "extendBaseMarkingAlgorithm": true, "strictPrecision": true, "maxValue": "siground(efficiency,3)+siground(abs(efficiency/100),3)", "showPrecisionHint": true, "prompt": "

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

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

", "precision": "3", "variableReplacementStrategy": "originalfirst", "type": "numberentry", "showFeedbackIcon": true, "notationStyles": ["plain", "en", "si-en"], "unitTests": [], "correctAnswerFraction": false, "precisionType": "sigfig", "scripts": {}, "mustBeReducedPC": 0, "customMarkingAlgorithm": "", "showCorrectAnswer": true, "allowFractions": false, "correctAnswerStyle": "plain", "variableReplacements": [{"must_go_first": true, "variable": "efficiency", "part": "p0"}]}], "name": "Carnot cycle efficiency", "variable_groups": [], "rulesets": {}, "preamble": {"js": "", "css": ""}, "advice": "

a)

\n

$Efficiency = (1-\\frac{T_c}{T_h})$ = 1-({tc}/{th}) = {siground(efficiency/100,3)}

\n

So the efficiency of the carnot cycle is {siground(efficiency,3)} %.

\n

b)

\n

$Efficiency = \\frac{useful\\,energy}{total\\,energy} = \\frac{work}{heat\\,from\\,hot\\,reservoir}$

\n

$Q_h = \\frac{W}{eff} =$ {work} / {siground(efficiency/100,3)}

\n

So the heat extracted from the hot reservoir is {siground(q_h,3)} J.

", "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"], "functions": {"draw_block": {"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;", "parameters": []}}, "variables": {"v1": {"description": "", "name": "v1", "definition": "random(8.5..15.0#0.1)", "group": "Ungrouped variables", "templateType": "anything"}, "r": {"description": "", "name": "r", "definition": "0.082", "group": "Ungrouped variables", "templateType": "anything"}, "hcr": {"description": "", "name": "hcr", "definition": "1.6", "group": "Ungrouped variables", "templateType": "anything"}, "w_23": {"description": "", "name": "w_23", "definition": "((p3*v3)-(p2*v2))/(1-hcr)", "group": "Ungrouped variables", "templateType": "anything"}, "n3": {"description": "

test - should match n

", "name": "n3", "definition": "p3*v3/(r*tc)", "group": "Ungrouped variables", "templateType": "anything"}, "v3": {"description": "

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

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

v1+random(0.5..4#0.1)

", "name": "v2", "definition": "v1+random(4.5..8#0.1)", "group": "Ungrouped variables", "templateType": "anything"}, "p1": {"description": "", "name": "p1", "definition": "n*r*th/v1", "group": "Ungrouped variables", "templateType": "anything"}, "p3": {"description": "

P2V2hcr = P3V3hcr

", "name": "p3", "definition": "p2*v2^(hcr)/v3^(hcr)", "group": "Ungrouped variables", "templateType": "anything"}, "p2": {"description": "", "name": "p2", "definition": "n*r*th/v2", "group": "Ungrouped variables", "templateType": "anything"}, "th": {"description": "

random(600..950)

", "name": "th", "definition": "random(1300..1950)", "group": "Ungrouped variables", "templateType": "anything"}, "q_h": {"description": "", "name": "q_h", "definition": "work/(efficiency/100)", "group": "Ungrouped variables", "templateType": "anything"}, "efficiency": {"description": "", "name": "efficiency", "definition": "(1-(tc/th))*100", "group": "Ungrouped variables", "templateType": "anything"}, "tc": {"description": "

th-random(50..300)

", "name": "tc", "definition": "th-random(400..600)", "group": "Ungrouped variables", "templateType": "anything"}, "w_34": {"description": "", "name": "w_34", "definition": "n*R*Tc*ln(v4/v3)", "group": "Ungrouped variables", "templateType": "anything"}, "w_41": {"description": "", "name": "w_41", "definition": "((p1*v1)-(p4*v4))/(1-hcr)", "group": "Ungrouped variables", "templateType": "anything"}, "n": {"description": "", "name": "n", "definition": "random(0.1..5.0#0.1)", "group": "Ungrouped variables", "templateType": "anything"}, "p4": {"description": "", "name": "p4", "definition": "n*r*tc/v4", "group": "Ungrouped variables", "templateType": "anything"}, "v4": {"description": "", "name": "v4", "definition": "(th*(v1^(hcr-1))/tc)^(1/(hcr-1))", "group": "Ungrouped variables", "templateType": "anything"}, "w_12": {"description": "", "name": "w_12", "definition": "n*R*Th*ln(v2/v1)", "group": "Ungrouped variables", "templateType": "anything"}, "work": {"description": "", "name": "work", "definition": "siground(w_12+w_23+w_34+w_41,3)", "group": "Ungrouped variables", "templateType": "anything"}}, "extensions": ["jsxgraph"], "metadata": {"licence": "Creative Commons Attribution 4.0 International", "description": "

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

"}, "variablesTest": {"maxRuns": 100, "condition": ""}, "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/"}]}