{ "metadata": { "name": "Chapter_1" }, "nbformat": 2, "worksheets": [ { "cells": [ { "cell_type": "markdown", "source": [ "

Chapter 1: Temperature

" ] }, { "cell_type": "markdown", "source": [ "

Example 1.1, Page Number: 53

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''Temperature Conversion'''", "", "#variable declaration", "c=-40.0 #Temp in degree Celcius", "", "#calculations", "k=c+273", "F=((9.0/5.0)*c)+32.0", "R=((9.0/5.0)*c)+492.0", "", "#Result", "print('\\nK=%d\u00b0K' %k)", "print('\\nF=%d\u00b0F' %F)", "print('\\nR=%d\u00b0R' %R)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "", "K=233\u00b0K", "", "F=-40\u00b0F", "", "R=420\u00b0R" ] } ], "prompt_number": 1 }, { "cell_type": "markdown", "source": [ "

Example 1.2, Page Number: 53

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''percentage Accuracy and Error'''", "", "#varable Declaration", "span=1000.0 #given value of span in \u00b0C", "accuracy=1.0/100.0 #1% accuracy", "", "#calculations", "err=span*accuracy", "max_scale=1200.0", "Range_instr=max_scale+span", "meter_reading=700.0", "per_of_err=(err/meter_reading)*100.0", "", "#result", "print('(a)\\nAs error can be either positive or negative') ", "print('\\n the probable error at any point on the scale =\u00b1 %d\u00b0C'%err)", "print('\\n(b)\\nRange of the Instrument = %d\u00b0C'%Range_instr)", "print('\\n(c)\\nPercentage of Error = \u00b1 %.2f%% '%per_of_err)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(a)", "As error can be either positive or negative", "", " the probable error at any point on the scale =\u00b1 10\u00b0C", "", "(b)", "Range of the Instrument = 2200\u00b0C", "", "(c)", "Percentage of Error = \u00b1 1.43% " ] } ], "prompt_number": 10 }, { "cell_type": "markdown", "source": [ "

Example 1.3, Page Number: 54

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''Two wire RTD'''", "", "#variable declaration", "resi_per_leg=5.0 # lead wire resistance per leg in Ohm", "temp_coeff=0.385 # Temperature coefficient of Pt 100 RTD in ohms/\u00b0C", "", "#calculation", "R_due_to_leadwires=2*resi_per_leg", "err=R_due_to_leadwires/temp_coeff", "err =round(err,0)", "temp_obj=200.0", "temp_measured=temp_obj+err", "per_of_err=((temp_measured-temp_obj)/temp_obj)*100.0", "", "#Result", "print('(a)\\nThe contribution of 10 ohms lead wire resistance')", "print('to the measurement error = %d\u00b0C' %err)", "print('\\n(b)\\nPercentage of Error = %d%%' %per_of_err)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(a)", "The contribution of 10 ohms lead wire resistance", "to the measurement error = 26\u00b0C", "", "(b)", "Percentage of Error = 13%" ] } ], "prompt_number": 3 }, { "cell_type": "markdown", "source": [ "

Example 1.4, Page Number: 54

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''Thermocouple temperature measurement'''", "", "#variable declaration", "temp=2.022 #Millivolt corresponds to reference junction temp 50\u00b0C", "millivolt_cor=37.325 #Millivolt corresponds to reference junction temp 900\u00b0C", "", "#calculation", "op=millivolt_cor-temp", "", "#result", "print('Millivolt output available = % .3f' %op)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Millivolt output available = 35.303" ] } ], "prompt_number": 4 }, { "cell_type": "markdown", "source": [ "

Example 1.5, Page Number: 54

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''Hot junction temperature of thermocouple'''", "", "#variable declaration", "millivolt_cor=2.585 #Millivolt corresponds to reference junction temp 50\u00b0C", "pot_reading=30.511 #reading on pot", "", "#calculation", "corrected_millivolt=pot_reading+millivolt_cor", "", "#result", "print('Temperature correspond to %.3f mV from the table = 600\u00b0C' %corrected_millivolt)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Temperature correspond to 33.096 mV from the table = 600\u00b0C" ] } ], "prompt_number": 5 }, { "cell_type": "markdown", "source": [ "

Example 1.6, Page Number: 54

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''Caliberation of an instrument'''", "", "#variable Declarion", "ref_jun=100.0 #reference junction temp.", "mV_100=0.645 #voltage at 100\u00b0C", "mV_1000=9.585 #voltage at 1000\u00b0C", "mV_1200=11.947 #voltage at 1200\u00b0C", "", "#calculation", "op1=mV_1000-mV_100", "op2=mV_1200-mV_100", "", "#result", "print('Millivolt to be fed checking 1000 C = %.3f mV'%op1)", "print('\\nMillivolt to be fed checking 1200 C = %.3f mV'%op2)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Millivolt to be fed checking 1000 C = 8.940 mV", "", "Millivolt to be fed checking 1200 C = 11.302 mV" ] } ], "prompt_number": 6 }, { "cell_type": "markdown", "source": [ "

Example 1.7, page Number: 55

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''Wall temperature measurement'''", "", "#variable declaration", "E_rec_pyro=0.95*0.85 #Energy received by pyrometer", "", "#calculation", "T=1100.0/E_rec_pyro", " ", "#result", "print('Pyrometer reading T = %.2f\u00b0C'%T)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "Pyrometer reading T = 1362.23\u00b0C" ] } ], "prompt_number": 7 }, { "cell_type": "markdown", "source": [ "

Example 1.8, Page Number: 55

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''Thermocouple output'''", "", "#(a)", "", "#variable declaration", "hot1_mV=41.29 # Millivolt corresponds to hot junction temp ", "cold1_mV=2.022 # Millivolt corresponds to cold junction temp ", "", "#calculation", "op1=hot1_mV-cold1_mV", "", "#(b)", "", "#variable declaration", "hot2_mV=33.096 #Millivolt corresponds to hot junction temp ", "cold2_mV=2.585 #Millivolt corresponds to cold junction temp ", "#calculation", "op2=hot2_mV-cold2_mV", "", "#(c)", "", "#variable declaration", "hot3_mV=11.947 #Millivolt corresponds to hot junction temp ", "cold3_mV=0.299 #Millivolt corresponds to cold junction temp ", "#calculation", "op3=hot3_mV-cold3_mV", "", "#result", "print('(a)\\nOutput Millivolt = %.3f'%op1)", "print('\\n(b)\\nOutput Millivolt = %.3f'%op2)", "print('\\n(c)\\nAs the wrongly formed thermocouples at J1 and J2 will always oppose')", "print('the main millivolt output, the net output will be lower than normal value.')", "print('Output mV<%.3f'%op3)" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(a)", "Output Millivolt = 39.268", "", "(b)", "Output Millivolt = 30.511", "", "(c)", "As the wrongly formed thermocouples at J1 and J2 will always oppose", "the main millivolt output, the net output will be lower than normal value.", "Output mV<11.648" ] } ], "prompt_number": 8 }, { "cell_type": "markdown", "source": [ "

Example 1.9, Page Number: 56

" ] }, { "cell_type": "code", "collapsed": false, "input": [ "'''electtronic temperature transmitter'''", "", "#variable declaration", "Rl_ind=250.0 #load resistor for indicator", "Rl_rec=250.0 #load resistor for recorder", "load_allowable=600.0 #allowable load with load independency", "", "#calculation", "load_connected= Rl_ind+Rl_rec", "max_load_controller=load_allowable-load_connected", "op_cont=600.0", "total=Rl_ind+Rl_rec+load_allowable", "extra_load=total-op_cont", "", "#result", "print('(a)\\nThe max load to the controller = %d ohms'%max_load_controller)", "print('\\n(b)\\nExtra Load = %d ohms'%extra_load)", "print('\\nAdditional Power Supply voltage required = 10 V')", "print('\\nMinimum Power Supply Voltage = 34 ')" ], "language": "python", "outputs": [ { "output_type": "stream", "stream": "stdout", "text": [ "(a)", "The max load to the controller = 100 ohms", "", "(b)", "Extra Load = 500 ohms", "", "Additional Power Supply voltage required = 10 V", "", "Minimum Power Supply Voltage = 34 " ] } ], "prompt_number": 9 } ] } ] }