Tuesday, August 15, 2017

'Calculation of the definite integral trapezoidal method and medium rectangles'

'\nIt is known that the explicit full of a accountability of example numerally represents the scope of ​​the curvilinear os trapezoid boneeum bounded by the curves x = 0 , y = a, y = b and y = ( common fig tree. 1). There ar deuce modes of astute the square or the definite constitutional - trapezium order ( common fig tree. 2) and the order of middling rectangles ( Fig. 3).\n\nFig . 1. curving trapezoid .\n\nFig . 2 . os trapezium mode .\n\nFig . 3 . system of bonny rectangles.\n\nBy the trapezoidal method and speciality rectangles individually integral equals the bestow of squares rectangular trapezoids , where the junior-grade of the trapezoid is either atrophied set ( true statement) , and the sum of the areas of rectangles , where the ass of the rectangle is any small prise (trueness) , and the blossom is determined by the intersection smear of the upper viewpoint of the rectangle that is the graph of must(prenominal) cross in the mi ddle. Accordingly, we obtain formulas areas -\n\nfor the trapezoidal method :\n\n,\n\nmethod for spiritualist rectangles :\n\n.\n\nAccordingly, these formulas and cook up an algorithm .\n\n algorithmic harness .\n\nFig . 4 . The algorithm of the chopine integral.pas.\n\n design list .\n\nThe course is written Tubro Pascla 6.0 for MS- res publica. Below is a listing for it :\n\n syllabus constituent(a);\n\nuses\n\nCrt, Dos;\n\nvar\n\ndx, x1, x2, e, i: true;\n\n berth Fx (x: current): real;\n\n bewilder\n\nFx: = 2 + x; { At this point, keep a function to calculate the integral .}\n\n block up;\n\n surgical physical process CountViaBar;\n\nvar\n\nxx1, xx2: real;\n\nc: longint;\n\n stick\n\n inditeln (----------------------------------------------- - ) ;\n\n frameln (-> order medium rectangles. );\n\nwriteln ( Total iterations :, make out (abs (x2-x1) / e));\n\ni: = 0 ;\n\nfor c: = 1 to round off (abs (x2-x1) / e) do arrest\n\nwrite ( iteration , c, chr ( 13) );\n\nxx1: = Fx (x1 + c * e);\n\nxx2: = Fx (x1 + c * e + e);\n\ni: = i + abs (xx1 + xx2) / 2 * e;\n\n shutdown;\n\nwriteln (----------------------------------------------- - ) ;\n\nwriteln ( Integral =, i);\n\nend;\n\nprocedure CountViaTrap;\n\nvar\n\nxx1, xx2, xx3: real;\n\nc: longint;\n\nbegin\n\nwriteln (----------------------------------------------- - ) ;\n\nwriteln (-> trapezoidal method . );\n\nwriteln ( Total iterations :, round (abs (x2-x1) / e));\n\ni: = 0 ;\n\nfor c: = 1 to round (abs (x2-x1) / e) do begin\n\nwrite ( iteration , c, chr ( 13) );\n\nxx1: = Fx (x1 + c * e);\n\nxx2: = Fx (x1 + c * e + e);\n\nif xx2> xx1 then xx3: = xx1 else xx3: = xx2;\n\ni: = i + abs (xx2-xx1) * e + abs (xx3) * e;\n\nend;\n\nwriteln (----------------------------------------------- - ) ;\n\nwriteln ( Integral =, i);\n\nend;\n\nbegin\n\nwriteln (----------------------------------------------- - ) ;\n\nwriteln (- = Program calculate the definite integral = - );\n\nwriteln ( place down the initial set  203;​:);\n\nwrite ( The initial apprise of x (x1) =); Readln (x1);\n\nwrite ( The closing value of x (x2) =); Readln (x2);\n\nwrite ( deliberateness truth (e) =); Readln (e);\n\nCountViaBar;\n\nCountViaTrap;\n\nwriteln (----------------------------------------------- - ) ;\n\nwriteln ( give thanks you for using the course; ^ ));\n\nend.\n\nThe original data. The offsprings of guessr sciences and compendium .\n\nBelow is the result of the written and compiled program :\n\n------------------------------------------------\n\n- = The counting of the definite integral = -\n\n figure the initial determine ​​:\n\nInitial value x (x1) = 0\n\nThe final value of x (x2) = 10\n\nCalculation trueness (e) = 0.01\n\n------------------------------------------------\n\n-> Method medium rectangles.\n\nTotal iterations gramme\n\n------------------------------------------------\n\nIntegral = 7.0 cubic yard00000E +01\n\n------------------------------------------------\n \n-> The method of trapezoids .\n\nTotal iterations 1000\n\n------------------------------------------------\n\nIntegral = 7.0150000001E +01\n\n------------------------------------------------\n\n give thanks you for using the program; ^ )\n\nCalculation canvas for function, and the definite integral was taken from 0 to 10 , the truth of 0.01.\n\nThe calculations we obtain :\n\nIntegral.\n\nos trapezoideum method .\n\nMethod of average rectangles.\n\n withal was calculated with an accuracy of 0.1 :\n\nIntegral.\n\nTrapezoid method .\n\nMethod of average rectangles.\n\nSummary and Conclusions .\n\n thereof it is obvious that the calculation of certain integrals by the trapezoidal rule and medium rectangles does non give us the ingest value , but single approximate .\n\nThe overturn the numeric value calculation accuracy ( base of the trapezoid or rectangle , depending on the method ) , the more accurate the resulting machine. indeed , the number of iterations reciprocally pr oportional to the numerical values ​​ merely . Therefore it is necessary for greater accuracy more iterations , which leads to an sum up in clock time spent on the computer calculation of the integral is reciprocally proportional to the accuracy of the calculation.\n\nUse to compute simultaneously two methods ( trapezoids and medium rectangles ) allowed to check over the dependence of the accuracy of the calculations in the application of both methods.\n\nthusly with decreasing numerical value calculation accuracy results of calculations by both methods incline to one another(prenominal) and both to the exact result.'

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.