{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Chapter 2: Measurement Errors" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 2.1: resistance_at_a_given_temparature.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//example 2-1 in page 16\n", "clc;\n", "//given data\n", "Rmin=1.14;// minimum resistance 1.14 k-ohm\n", "Rmax=1.26// maximum resistance 1.26 k-ohm\n", "R=1.2;//stated value\n", "dT=75-25;//change in temperature from 25 to 75 degree celsius\n", "// calculation\n", "ab=Rmax-R;//Absolute maximum error\n", "abmin=Rmin-R;// Absolute minmum error\n", "T=(ab/1.2)*100;// Tolerance\n", "Rlarge=R+ab;//largest resistance possible at 25 degree celsius \n", "dR_per_C=(1.26/10^6)*500;// resistance change per degree celsius dR_per_C\n", "dR=dR_per_C*dT;// total resistance increase\n", "R_75=Rlarge+dR;//maximum resistance at 75 degree celsius\n", "printf('Percentage Tolerance to be stated=+/- %d percent \n',T);\n", "printf('Maximum resistance at 75 degree celsius=%.4f K-ohm',R_75);\n", "//result\n", "//Tolerance=5%\n", "//maximum resistance at 75 degree celsius=1.2915 kohm" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 2.2: error_in_sum_voltage.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//example 2-2 in page 20\n", "clc;\n", "//given data\n", "V1=100;//stated voltage one\n", "V2=80;//stated voltage two\n", "e1=(1/100)*V1;//absolute error of v1\n", "e2=(5/100)*V2;//absolute error of v2\n", "//calculation\n", "e=e1+e2;//absolute error for the sum of the voltages\n", "E=V1+V2;// sum voltage\n", "emax=(e/E)*100;//maximum percentage error\n", "printf('E=%d V +/- %.1f percent',E,emax);\n", "//result\n", "//E=180 V +/- 2.8 percent " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 2.3: error_in_difference_voltage.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//example 2-2 in page 20\n", "clc;\n", "//given data\n", "V1=100;//stated voltage one\n", "V2=80;//stated voltage two\n", "e1=(1/100)*V1;//absolute error of v1\n", "e2=(5/100)*V2;//absolute error of v2\n", "//calculation\n", "e=e1+e2;//absolute error for the sum of the voltages\n", "E=V1-V2;// difference voltage\n", "emax=(e/E)*100;//maximum percentage error\n", "printf('E=%d V +/- %d percent',E,emax);\n", "//result\n", "//E=20 V +/- 25 percent " ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 2.4: power_dissipated_and_accuracy.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//Theory problem" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 2.5: average_voltage_and_deviation.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "// example 2-5 in page 25\n", "clc;\n", "//given data\n", "V=[1.001 1.002 0.999 0.998 1.000];// 5 digital voltmeters reading in volts\n", "//calculation\n", "Vav=sum(V)/5;// average of 5 readings in volts\n", "D=abs(V-Vav);//deviation of each reading from the average voltage\n", "Dav=sum(D)/5;//average of deviation in volts\n", "printf('Average measured voltage=%d V\n',Vav);\n", "printf('Average deviation=%.4f V',Dav);\n", "//result\n", "//the Average measured voltage=1 V\n", "//The Average deviation=0.0012 V" ] } , { "cell_type": "markdown", "metadata": {}, "source": [ "## Example 2.6: standard_deviation_and_probable_error.sce" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": true }, "outputs": [], "source": [ "//To determine the standard deviation and probable measurement\n", "//example 2-6 in page 26\n", "clc;\n", "//given data\n", "V=[1.001 1.002 0.999 0.998 1.000];// 5 digital voltmeters readings in matrix V in volts\n", "//calculation\n", "Vavg=sum(V)/5;// average of 5 readings in volts\n", "D=abs(V-Vavg);//deviation of each reading from the average in volts\n", "D1=D.*D;// get the square of each deviation\n", "x=sum(D1);// sum of the squares of the deviation\n", "sigma=sqrt(x/5);// standard deviation in volts\n", "printf('standard deviation=%.4f V\n',sigma);\n", "eP=0.6745*0.0014;//probable error in volts and sigma=0.0014 V\n", "printf('probable error=%.2f mV',eP*1000);\n", "//result\n", "//standard deviation=0.0014 V\n", "//propable error=0.94 V" ] } ], "metadata": { "kernelspec": { "display_name": "Scilab", "language": "scilab", "name": "scilab" }, "language_info": { "file_extension": ".sce", "help_links": [ { "text": "MetaKernel Magics", "url": "https://github.com/calysto/metakernel/blob/master/metakernel/magics/README.md" } ], "mimetype": "text/x-octave", "name": "scilab", "version": "0.7.1" } }, "nbformat": 4, "nbformat_minor": 0 }