InputMode:=Word PrecisionDigits:=64 NotationDigits:=64 "We want to find the resistor network values to make a linear temperature sen~ sor." "This is a table of the resistance of the thermistor as a function of tempert~ ure Celsius." m:=[[-55,963749],[-54,895245],[-53,832055],[-52,773734],[-51,719877],[-50,670~ 115],[-49,624114],[-48,581565],[-47,542189],[-46,505731],[-45,471956],[-44,44~ 0652],[-43,411622],[-42,384689],[-41,359688],[-40,336470],[-39,314896],[-38,2~ 94841],[-37,276188],[-36,258833],[-35,242675],[-34,227627],[-33,213606],[-32,~ 200535],[-31,188337],[-30,176970],[-29,166333],[-28,156431],[-27,147173],[-26~ ,138514],[-25,130418],[-24,122824],[-23,115723],[-22,109119],[-21,102903],[-2~ 0,97078.5],[-19,91618.8],[-18,86498.8],[-17,81695.6],[-16,77187.7],[-15,72955~ .4],[-14,68980.3],[-13,65245.3],[-12,61734.6],[-11,58433.6],[-10,55328.4],[-9~ ,52406.5],[-8,49656],[-7,47065.9],[-6,44626.1],[-5,42326.8],[-4,40159.4],[-3,~ 38115.5],[-2,36187.5],[-1,34368],[0,32650.5],[1,31032.1],[2,29499.9],[3,28052~ .4],[4,26684.6],[5,25391.2],[6,24168.2],[7,23011.2],[8,21916.3],[9,20879.8],[~ 10,19898.3],[11,18968.6],[12,18087.6],[13,17252.6],[14,16460.9],[15,15710],[1~ 6,14997.7],[17,14321.6],[18,13679.8],[19,13070.4],[20,12491.6],[21,11941.6],[~ 22,11418.9],[23,10922],[24,10449.5],[25,10000],[26,9572.32],[27,9165.29],[28,~ 8777.79],[29,8408.68],[30,8057.31],[31,7722.43],[32,7403.29],[33,7098.42],[34~ ,6808.36],[35,6531.31],[36,6265.75],[37,6016.47],[38,5776.05],[39,5546.53],[4~ 0,5327.34],[41,5117.97],[42,4917.94],[43,4726.77],[44,4543.91],[45,4369.33],[~ 46,4200.84],[47,4040.81],[48,3889.51],[49,3743.17],[50,3603.1],[51,3467.69],[~ 52,3340.55],[53,3217.54],[54,3099.62],[55,2986.6],[56,2878.49],[57,2774.55],[~ 58,2675.2],[59,2579.52],[60,2488.2],[61,2400.36],[62,2316.05],[63,2235.13],[6~ 4,2157.43],[65,2082.84],[66,2011.18],[67,1942.35],[68,1876.21],[69,1812.65],[~ 70,1751.65],[71,1692.82],[72,1636.33],[73,1582.02],[74,1529.77],[75,1479.3],[~ 76,1430.9],[77,1384.28],[78,1339.73],[79,1296.74],[80,1255.08],[81,1215.15],[~ 82,1176.76],[83,1139.77],[84,1103.96],[85,1069.79],[86,1036.21],[87,1004.2],[~ 88,973.67],[89,943.97],[90,915.32],[91,887.69],[92,861.02],[93,835.29],[94,81~ 0.46],[95,786.54],[96,763.35],[97,741],[98,719.41],[99,698.57],[100,678.42],[~ 101,658.96],[102,640.17],[103,621.97],[104,604.39],[105,587.39]] "A good model of the resistance of a thermistor is:" r SUB t=EXP(a SUB 0+a SUB 1/t+a SUB 2/t^2+a SUB 3/t^3) "t is temperature Kelvin." "The data in the table needs to be transformed so we can fit it to the model.~ " "Transform resistance to y and temperature to x." rt=EXP(a0+a1/t+a2/t^2+a3/t^3) ;Simp(User) LN(rt)=a0+a1/t+a2/t^2+a3/t^3 t=c+273.15 x=1/t y=LN(rt) y=a0+a1*x+a2*x^2+a3*x^3 "Transform m to m1." m1:=VECTOR([1/(x SUB 1+273.15),LN(x SUB 2)],x,m) "Fit the transformed data to the model." f(x):=FIT([x,a0+a1*x+a2*x^2+a3*x^3],m1) ;Approx(#21) f(x):=-6.976689289502469431223611098003650569587269516127177141268114716*10^6~ *x^3-7.202847605003461292517331272822515126389694064366024764873334414*10^4*x~ ^2+4617.915302731585665587490621743690648498587109392037552533546245*x-5.2046~ 93178344775286271963872038032912712164209568225962458452448 "Transform back to the original data." f1(t):=EXP(f(1/(t+273.15))) "Check to error of the fit multiplied by 10000 so it is easy to see." VECTOR([x SUB 1,10000*(x SUB 2/f1(x SUB 1)-1)],x,m) "Pick four equally spaced points so the TI-83 can fit this same model." VECTOR(t,t,-55,105,(105+55)/8) ;Approx(#28) [-55,-35,-15,5,25,45,65,85,105] [-35,5,45,85] VECTOR([t,f1(t)],t,[-35,5,45,85]) "This is the table of values." ;Approx(#31) [[-35,2.426949769066949173939958476578048893167428568242522979509575514*10^5]~ ,[5,2.539641226908252205782705840511663329021866186316892670993351458*10^4],[~ 45,4367.52464901177432161355724344092364985809611068873493492617636],[85,1070~ .320602157991357022319618388484426066797519486255114581700935]] "Fit these values to see if they will give the same model when rounded to 8 p~ laces." m2:=APPROX(VECTOR([1/(t+273.15),LN(f1(t))],t,[-35,5,45,85]),8) ;Simp(#35') m2:=[[0.0041990342,12.39956],[0.0035951824,10.142363],[0.0031431714,8.3819517~ ],[0.0027921262,6.9757135]] f2(x):=FIT([x,a0+a1*x+a2*x^2+a3*x^3],m2) ;Approx(#37) f2(x):=-6.975971637427425099799276082395907998654540859869827626540463013*10^~ 6*x^3-7.203682981032733062062530061457705336739435223637103415285912215*10^4*~ x^2+4617.946602239741789891179733155987294239692031762648048908951392*x-5.204~ 731060364272349755352053758814589203954962567461791503193492 f3(t):=EXP(f2(1/(t+273.15))) "Check to error of the fit multiplied by 10000000 so it is easy to see." VECTOR([x SUB 1,10000000*(f1(x SUB 1)/f3(x SUB 1)-1)],x,m) "Construct a matrix to solve for the fit." m3:=VECTOR(APPEND(VECTOR(x SUB 1^i,i,0,3),[x SUB 2]),x,m2) ;Approx(#43) m3:=[[1,0.0041990342,1.763188821276964*10^(-5),7.4036901615996595081688*10^(-~ 8),12.39956],[1,0.0035951824,1.292533648926976*10^(-5),4.64689422603004300042~ 24*10^(-8),10.142363],[1,0.0031431714,9.87952644977796*10^(-6),3.105304498248~ 5620222344*10^(-8),8.3819517],[1,0.0027921262,7.79596871672644*10^(-6),2.1767~ 328508352271356728*10^(-8),6.9757135]] "Solve for the model." ROW_REDUCE(m3) ;Approx(#46) [[1,0,0,0,-5.204731060364272349755352053758814589203954962567461791503193492]~ ,[0,1,0,0,4617.946602239741789891179733155987294239692031762648048908951392],~ [0,0,1,0,-7.203682981032733062062530061457705336739435223637103415285912215*1~ 0^4],[0,0,0,1,-6.975971637427425099799276082395907998654540859869827626540463~ 013*10^6]] "Find three equally spaced points for the linear temperature sensor." VECTOR(t,t,0,100,(100+0)/6) ;Simp(#49) [0,50/3,100/3,50,200/3,250/3,100] ;Approx(#50) [0,16.66666666666666666666666666666666666666666666666666666666666666,33.33333~ 333333333333333333333333333333333333333333333333333333333,50,66.6666666666666~ 6666666666666666666666666666666666666666666666666,83.333333333333333333333333~ 33333333333333333333333333333333333333,100] "These are the points." [17,50,83] "Pick two points on the desired output of the linear sensor." [[0,0.3],[100,0.7]] "Solve for the line that passes through these points." f4(t):=FIT([t,a0+a1*t],[[0,0.3],[100,0.7]]) ;Simp(#57) f4(t):=t/250+3/10 "Find the voltage output and thermistor resistance at the three tempreatures.~ " APPROX(VECTOR([t,f4(t),f3(t)],t,[17,50,83]),8) ;Simp(#60) [[17,0.368,1.4324521*10^4],[50,0.5,3601.5491],[83,0.632,1140.5009]] "This is the resistor network which is the temperature sensor." "Solve for the voltage." v/rc+(v-va)/(rb+1/(1/ra+1/r))=0 ;Simp(User) v/va=rc*(r+ra)/(r*(ra+rb+rc)+ra*(rb+rc)) v=rc*(rt+ra)/(rt*(ra+rb+rc)+ra*(rb+rc)) ;Simp(User) 1/v=(ra*(rb+rc+rt)+rt*(rb+rc))/(rc*(ra+rt)) ;Expd(#67) 1/v=-rt^2/(rc*(ra+rt))+rb/rc+rt/rc+1 "Substitute the three voltages and the three resistances." ;Sub(#68) 1/v1=-r1^2/(rc*(ra+r1))+rb/rc+r1/rc+1 ;Sub(#70) 1/v2=-r2^2/(rc*(ra+r2))+rb/rc+r2/rc+1 ;Sub(#71) 1/v3=-r3^2/(rc*(ra+r3))+rb/rc+r3/rc+1 "Eliminate rb by subtraction." ;Simp(User) 1/v2-1/v1=ra^2/(rc*(r1+ra))-ra^2/(rc*(r2+ra)) ;Simp(User) 1/v3-1/v2=ra^2/(rc*(r2+ra))-ra^2/(rc*(r3+ra)) ;Fctr(#74) (v2-v1)/(v1*v2)=ra^2*(r1-r2)/(rc*(r1+ra)*(r2+ra)) ;Fctr(#75) (v3-v2)/(v2*v3)=ra^2*(r2-r3)/(rc*(r2+ra)*(r3+ra)) "Eliminate rc by division." ;Simp(User) v1*(v2-v3)/(v3*(v1-v2))=(r1+ra)*(r2-r3)/((r1-r2)*(r3+ra)) "Solve for ra." ;Expd(User') ra=(r1*r2*v3*(v1-v2)+r1*r3*v2*(v3-v1)+r2*r3*v1*(v2-v3))/(r1*v1*(v2-v3)+r2*v2*~ (v3-v1)+r3*v3*(v1-v2)) "Solve for rc." ;Simp(Solve(#76,rc)) rc=ra^2*v1*v2*(r1-r2)/((r1+ra)*(r2+ra)*(v2-v1)) "Solve for rb." ;Simp(Solve(#70,rb)) rb=-(r1*(ra*v1+rc*(v1-1))+ra*rc*(v1-1))/(v1*(r1+ra)) ;Expd(#85) rb=ra^2/(r1+ra)-ra+rc/v1-rc ;Simp(#86) rb=ra^2/(r1+ra)-ra+rc*(1/v1-1) "Substitute the three values of voltage and resistance." [[17,0.368,1.4324521*10^4],[50,0.5,3601.5491],[83,0.632,1140.5009]] "Find ra." [ra=(r1*r2*v3*(v1-v2)+r1*r3*v2*(v3-v1)+r2*r3*v1*(v2-v3))/(r1*v1*(v2-v3)+r2*v2~ *(v3-v1)+r3*v3*(v1-v2)),rc=ra^2*v1*v2*(r1-r2)/((r1+ra)*(r2+ra)*(v2-v1)),rb=ra~ ^2/(r1+ra)-ra+rc*(1/v1-1)] ;Simp(User) [ra=111122693724466357/14941694980000,rc=4932567074000*ra^2/(33*(1000*ra+1432~ 4521)*(10000*ra+36015491)),rb=205191901879441/(1000*(1000*ra+14324521))+79*rc~ /46-14324521/1000] "Find rc." ;Simp(User) [true,rc=12348253060581554680330304424851449/3587955974340583920382254375000,~ rb=79*rc/46-1591779359832686544639997/325155317241070937000] "Find rb." ;Simp(Sub(#94)) [true,true,rb=7284296100926393733236159562471227/7175911948681167840764508750~ 000] APPROX([ra=111122693724466357/14941694980000,rc=12348253060581554680330304424~ 851449/3587955974340583920382254375000,rb=7284296100926393733236159562471227/~ 7175911948681167840764508750000],8) [ra=7437.0875,rc=3441.5843,rb=1015.1038,rt=f3(t)] "Calculate the voltage v." v=rc*(rt+ra)/(rt*(ra+rb+rc)+ra*(rb+rc)) ;Sub(#100) v=3441.5843*(f3(t)+7437.0875)/(f3(t)*(7437.0875+1015.1038+3441.5843)+7437.087~ 5*(1015.1038+3441.5843)) "Compare v to the desired voltage." f4(t) ;Simp(#103) t/250+3/10