AMAT 34 Numericl Methods Instructor: Mrios M. Fyrills Emil: m.fyrills@fit.c.cy Office Tel.: 34559/6 Et. 3 HOMEWORK ASSIGNMENT ON INTERPOATION QUESTION Using interpoltion by colloction-polynomil fit method find seconddegree polynomil tht fits the dt below: f() 3.4.948 3.5.8574 3.6.77778 Verify your clcultion using second-order grnge interpoltion polynomil. Generl Eqution y α α α Step.948 α 3.4α (3.4) α (Eqution ).8574 α 3.5α (3.5) α (Eqution ).77778 α 3.6α (3.6) α (Eqution 3) Step 3.4.56.948 3.5.5.8574 3.6.96.77778.948 3.4.56.8574 3.5.5.77778 3.6.96 3.4.56 3.5.5 3.6.96.948[(3.5*.96) (3.6 *.5)].8574[(3.4 *.96) (3.6 *.56)].77778[(3.4 *.5) (3.5 *.56)] [(3.5*.96) (3.6 *.5)] [(3.4 *.96) (3.6 *.56)] [(3.4 *.5) ( 3.5*.56)].8583
Step 3 3.4.56.948 3.5.5.8574 3.6.96.77778.948.56.8574.5.77778.96 3.4.56 3.5. 5 3.6.96 [(.8574*.96) (.77778*.5)] [(.948*.96) (.77778*.56)] [(.948*.5) (.8574*.56)] [(3.5*.96) (3.6*.5)] [(3.4*.96) (3.6*.56)] [(3.4*.5) (3.5*.56)] -.4 Step 4.948 α 3.4α (3.4) α (Eqution ) α.85 α -.4 (3.4) α.948 - α - 3.4α.56α.948.85 (3.4)(-.4) α. Verify the clcultion using second-order grnge interpoltion polynomil. grnge Eqution Ρ ( ) ( )( ) ( )( ) ( )( ) 3 3 * y * y * y3 ( )( 3) ( )( 3) ( 3 )( 3 ) ( 3.5)( 3.6) ( 3.4)( 3.6) ( 3.4)( 3.5) *.948 *.8574 *.77778 (3.4 3.5)(3.4 3.6) (3.5 3.4)(3.5 3.6) (3.6 3.4)(3.6 3.5) ( 3.5 3.6.6) ( 3.4 3.6.4) ( 3.4 3.5.9) *.948 *.8574 *.77778... ( 3.5 3.6.6) *4.759 ( 3.4 3.6.4) * ( 8.574) ( 3.4 3.5. 9) *3.8889 4.759 4.489 85.9434 8.574 99.9998 349.73936 3.8889 95.8334 65.779. -.4.8583 This result grees with the previous results obtined through colloction method.
QUESTION The dt in the tble seem to fit cubic eqution. Determine by lest squres the optimum degree of polynomil. f ( ) f ( ) f ( )..9 6.6 36. 3. -48.6. 7.9 7. 3.7 4. -4..6 4.9 8. 3. 5.6-5.6.4 4.9 9..5 6. -3.5.5 34.9 9.4-3. 7.6-34.6 4. 4.7. -3. 7.9-6.4 5. 9.7.4-8.7 9. -3.8 6. 49.8. -39.5. -. The eqution hs the form y. 3 3 The objective is to find the optimum coefficients such tht this represents lest squre fit. For generl fit of the form the Norml Equtions re s follows n y n N... y n i i n i i 3 n i i i... n i iyi 3 4 n i i i... n i i i... y... y n n n n n i i i n i i i where N is the number of points nd n N. In this cse we only need the first four equtions N y 3 i i 3 i i 3 4 i i i 3 i i i 3 4 5 i i i 3 i i i 3 4 5 6 i i i 3 i i i y y y Bsed on the results of the tble on the net pge the system of eqution is s follows: 4 3.8 3.84 4745. -. 3 3.8 3.84 4745. 76836.45-346.7 3 3.84 4745. 76836.45 3 3 3845.3-677. 4745. 76836.45 3845.3 9355836.8-8994.55 The resulting eqution is s follows f 6.355 4.86 3.6. 3
SUM y..9. 7.9.6 4.9.4 4.9.5 34.9 4. 4.7 5. 9.7 6. 49.8 6.6 36. 7. 3.7 8. 3 9..5 9.4-3.. -3.4 8.7. 39.5 3. 48.6 4. 4. 5.6 5.6 6. 3.5 7.6 34.6 7.9 6.4 9. 3.8 -. 3 4 5 6 y y 3 y......9.9.9..33.464.65.7756 8.69 9.559.549.56 4.96 6.5536.48576 6.7776 39.84 63.744.994 5.76 3.84 33.776 79.664 9.976 59.76 43.44 344.76 6.5 5.65 39.65 97.6565 44.465 87.5 8.5 545.35 6.8 68.9 8.576 58.56 475.44 75.7 77.787 94.967 7.4 4.68 73.66 38.43 977.6966 54.44 83.88 476.576 37. 6.98 384.584 8445.963 55.37436 33.78 853.58 33.6538 43.56 87.496 897.4736 53.3576 8653.95 38.6 57.56 378.656 5.4 357.9 54.68 84.935 8.839 68.7 94.77 848.497 67.4 55.368 45.76 3773.9843 346.674 6.6 874. 767.784 8.8 753.57 6857.496 643.45 567869.5 86.55 697.65 5448.55 88.36 83.584 787.4896 7339.44 689869.78-9.4-73.96-574.84 3. 367.63 58.74 6855.855 8744.55-44.3-6.73-7779.3 9.96 48.544 6889.66 954.458 9497.64-37.8-379.85-45.38 48.84 85.848 53.3456 77.863 39733.959-48.9-5879.8-775.996 74.4 99.968 3359.5776 4746.443 58985.8-64.5-8468.64 778.4448 98.8 83. 3955.46 55738.367 785847.975-566.8-799.6 689.484 43.36 3796.46 594.896 93895.7978 44774.45-84.96 557.376 95895.656 59. 473.8 6789.84 8756.68 74674.3-49.5-795.95 785.75 39.76 545.776 9595.576 68874.34 9786.55-68.96 77.696 8863.4496 3.4 5735.339 66.568 837659.969 38943.44-93.56-554.74-9459.5596 364.8 6967.87 3386.336 54949. 48556.7-63.58-534.378-9656.698 4 8 6 3 64 - -44-88 3.8. 3.84 4745. 76836.45 3845.3 9355836.8 346.7 677. 8994.55
QUESTION 3 Hlf-wve rectifier: A sinusoidl voltge Esin( ω t), where t is time, is pssed through hlf-wve rectifier tht clips the negtive portion of the wve. The resulting function is if / < t < u Esin( ωt) if < t < /. Determine for the cse E nd ω nd plot the function. b. Find the Fourier series of the resulting periodic function by direct integrtion. c. Find the finite Fourier series by discretizing the function in 8, 6 nd 3 points. Ft () k cos kt bksin kt k where is the period of the signl nd the coefficients nd b re given by k F() t cos kt dt bk F() t sin kt dt k k ω κ f ( t)cos( κt) dt b f ( t)sin( κt) dt,,, f( tdt ) f( t)cos( tdt ) b f( t)sin( tdt ) κ / / cos( t) cos( ) f( tdt ) f( tdt ) sin( tdt ) / / / f ( t)cos( t) dt f ()cos( t t) dt sin( t)cos( t) dt / / / b f ( t)sin( t) dt f ( t)sin( t) dt sin ( t) dt / /
QUESTION 4 The dt in the tble seem to fit qudrtic eqution. Determine by lest squres the optimum coefficients if you know tht the curve must pss through the point (,). f ( ) f ( ) f ( ).5.956.46.57.8.36..89.5.539.98.4.5.83.7.378.7.4.3.77.74.37 If the line must pss form the point (,), then it must be of the form y, i.e.. The Norml Equtions re s follows y 3 i i i i i 3 4 i i i i i y QUESTION 5 In n eperiment the following set of dt were collected: f ( ) f ( ) f ( ). 9 6.6 655 3. 3. 7. 755 4. 498.6 565 8. 863 5.6 56. The dt seem to fit liner eqution. Determine by lest squres the coefficients of the eqution. We fit liner eqution of the form y hence we need only the terms tht involve nd : Substitute the results: N y i i i i iyi 9 67.6 67535 67.6 78.4 78688 Solve the bove system to find.8 nd 999.
6 4 8 6 4 4 6 8 4 6 b. Determine the liner eqution if you know tht the line must pss through the point (,). If the line must pss form the point (,), then it must be of the form y, i.e.. To determine the pproprite form of the equtions one must go bck to theory. The error between the line nd ech point is e y e y e y 3 3 etc e9 y9 9 To find the optimum line, I hve to minimize the sum of the squres of the error, i.e. minimize S( e e e... e ). At the minimum the derivtive must be zero 3 9 ds d ( y )( ) ( y )( )... ( )( y )( ) ( y )( )... ( y ) ( y )... y y...... y y... y 78688 78.4 999. i i i 3
QUESTION 6 () Using interpoltion by Direct Fit Polynomil (colloction polynomil method) find third-degree polynomil tht fits the dt below: f() - 5-9 (b) Verify your result with third-order grnge polynomil. Multiply out ech 3 term to epress in stndrd form, b c d (c) Using lest-squre regression, determine the optimum qudrtic polynomil.
QUESTION 7 Determine the Fourier Series: Ft () kcos kt bksin kt k for the rectngulr pulse shown on the figure: F() t.5.5 Solution: k F() t cos kt dt bk F() t sin kt dt The period is! 3 4 F() t dt F() t dt F() t dt dt t k F t kt dt kt dt ( ) cos cos( ) cos( ) cos ( kt) dt sin ( kt) sin ( k) sin ( ) k k bk F( t) sin kt dt sin ( kt) dt sin ( kt) dt sin ( kt) dt cos( kt) cos() cos( k) cos( k) k k k 4 Hence Ft ( ) k,3,5... sin ( kt) k kt dt t if k even, i.e.,4,6... 4 if k odd, i.e.,3,5... k
QUESTION 8 Given the function y f( ) the inverse function is defined s f ( y). Show tht the inverse function cn be pproimted to second order through the polynomil: ( y y)( y y) ( y y)( y y) ( y y)( y y) ( y y )( y y ) ( y y )( y y ) ( y y )( y y ) where (, y), (, y ) nd (, y ) re three selected points. Hence, develop second order lgorithm through which you cn obtin the root of the eqution f( ). Above eqution is in the form of second order grnge polynomil, hence it psses through the points (, y ), (, y ) nd (, y ). As we hve inverted with y, bove polynomil represents the inverse function. The eqution f( ) is ssocited with the point y of the eqution y f( ). Hence, by setting y in the bove eqution we obtin the point ( y )( y ) ( y )( y ) ( y )( y ) 3 ( y y)( y y) ( y y)( y y) ( y y)( y y). The lgorithm is s follows: y y y y y y ) n n n n n n n n n ( yn yn )( yn yn) ( yn yn )( yn yn) ( yn yn )( yn yn n