Past_Midterms

pdf

School

McMaster University *

*We aren’t endorsed by this school

Course

3SK3

Subject

Electrical Engineering

Date

Jan 9, 2024

Type

pdf

Pages

16

Uploaded by ConstableKnowledge17560

Report
CoE 3SK4 Computer-Aided Engineering Midterm 2004 February 23, 2004 McMaster University Instructor: Dongmei Zhao Department of Electrical and Computer Engineering (dzhao@mail.ece.mcmaster.ca) 1. This exam is nominally 50 minutes long. 2. Do all four problems. 3. Show all steps and justify your answers. Otherwise, only partial credit will be given. 4. Return this question paper with your solution. Problem 1. (9 Points) Consider the system A x= b where A = and (a) Is the solution to this system unique? (b) If the solution is unique, use Gauss elimination to find it. If the solution is not unique, give one solution to the system. Problem 2. (8 Points) We wish to find the value of θ that satisfies (a) Derive the iterative formula that uses Newton-Raphson Method to find θ . (b) Perform two iterations with your formula and the initial guess of θ =2.5 radians. What is the value of θ after two iterations? Calculation results should have 4 significant figures. Problem 3. (8 Points) Find the minimum value of function f ( x ) below using Golden Search method starting with and . (a) Without performing any iterations, find the value of the search interval after 10 iterations. (b) Perform the first three iterations. Problem 4. (5 Points) Given function Find the 2nd and 3rd order McLaurin series expansions of f(x) . ú ú ú û ù ê ê ê ë é - - 2 1 1 2 / 1 2 / 3 3 3 1 2 ú ú ú û ù ê ê ê ë é = 0 4 / 13 2 / 11 b p q q = - ) sin ( 2 3 0 . = l x 2 . = u x 2 5 . 0 ) ( x xe x f - - = l u x x - 20 sin 2 ) ( 4 - - = x x x f
CoE 3SK3 Computer Aided Engineering Midterm Test February 10, 2009 McMaster University Instructor: Dongmei Zhao Department of Electrical and Computer Engineering (dzhao@mail.ece.mcmaster.ca) 1. This test is nominally 50 minutes long. 2. For problems 1-3, show all steps and justify your answers. Otherwise, only partial credit will be given. No justification is required for problem 4. 3. Return this question sheet with your solutions. Problem 1. (8 Points) Given AX = b , where and (a) Find X using LU decomposition. (b) Is it possible to use the Gauss-Seidel iterative method to find X ? Why? Problem 2. (10 Points) Given the function , (a) Write an iterative formula to estimate x using the Newton-Raphson method. Given the initial guess as x 0 =3, find x using the first 3 iterations and comment on the convergence. (b) Is it possible to locate x using the bisection method with the initial values x l =2 and x u =4? If yes, find the minimum number of iterations required in order to guarantee an absolute error less than 0.0001? If no, why? Problem 3. (8 Points) Consider a 8-bit floating point representation. For , 1 bit is used for representing s , 4 bits for c ( c = e +7), and 3 bits for f , where c is between 0 and 7 and . No binary sequences are reserved for special numbers. (a) What are the smallest and largest positive numbers that can be represented accurately using this representation? (b) What is the machine precision if this representation is used by a computer? (c) How many base-10 numbers can be accurately represented using this method? Problem 4. (4 Points) Briefly answer the questions below. No justification is required. (a) Given x >0 and fl(1+ x )=1, what is the range of x ? fl( x ) is the floating point representation of x in a computer. (b) A matrix is singular if it has an eigenvalue equal to zero. Is this statement true? (c) If a matrix is singular, its condition number is zero. Is this true? (d) Given an eigenvalue of a matrix, the corresponding eigenvector is uniquely determined. Is this true? ú ú ú û ù ê ê ê ë é - - - - - - - = 5 3 1 3 6 2 1 2 4 A ú ú ú û ù ê ê ê ë é - = 16 7 7 b x e x 5 = ) 1 ( 2 ) 1 ( f x e s + - = 1 0 < £ f
Test 2004 A 'u=o , 12 ' ) 13 ' ) Pt : (a) 11+1--151=0 , unique solution 2 I 3 1 " 12 (b) ( O 1.5 3.5 I 2.75 12 1 3 : "kf o o i - s ) 3 312 -1/2 I 1314 -1 I z i o Back substitution : First round elimination : (3) 113=-5/-5--1 (2) ' (2) - (1) Zz = [ 0 0 -5 - 5) (2) Xz = (2.75-3.573)/1.5=-0.5 (3) (3) - (1) ¥ : [ 0 1.5 3.5 2.75 ] (1) 1=(1/2-371-112) / 2=1.5 { 2 I 3 ' " Iz O O -5 ! -5 I 0 1.5 35 : 2.75 ]
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
P2 . P 4 & 10 - since ) = a , 0 = ? f- 1 × 7=2 × 4 - Sin - 20 , f- 101=-20 f- (a) = 3-210 - Sino ) - TI = 0 f- ' 1 × 1=8 × 3 - cos , f- ' lo ) = - I find 0 ? f- " 1 × 1=24 × 2-1 sin , f- " 101=0 f ' 101=3-211 - cos 0 ) f- " ' 1 × 1=48 × -1 cos , f- " 101=1 3-210 ; - Sin O ;) - IT Oi -11 = Oi - zz ( , - ago ;) FIX )= Éof" X " = f- ( O ) + f- To ) - + f" ¥ 2 Do = 2.5 . = -20 - X 01 = 2 . 607 fix )= t.E.oftif.to ? -Xi=-zo-x+-, ? Oz = 2 605 = -20 - + g- 3
2009 " " " * 1 ; ; ;) & ; ; ;) . "=|÷) d=/÷s ) -2 -6 -3 19-5 4 -2 -1 UX=d . =\ ? , ) 12 ) - a) ( o -7 -3.5 ) 3 13 ) - (1) 0 -3.5 4.75 (b) ; Yes , sufficient condition satisfied . 4 -2 -1 µ -7 - =U (3) - (2) →¥ y o o 6.5
Pz (b) . Xe=z . u=4 (a) e =5X , ex - 511=0 Find root for ftx )=e _5 ftxe ) = -2.61<0 Xiu = X ; - -511 ftxu )= 34.60>0 e " -5 Bisection method works . No =3 , Xu < 0.0001 1=2.663 , 2 " 115-2553 n = 13 3=2-543 114--2.543 converges .
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
P . 3 } , " P -4 , c : (a) < Emach e -17 =L -1 } . Ze - ( it f) z (b) (a) C :O v15 smallest positive : ? (1+0)=2-7 14 Largest " : 215 ? / 1.11112--2%1.875 (d) (b) Chopping . Emaoh = @ . 001 ) , = 2-3 rounding , Emach = 2- " (c) 28
Name_____________________________________ Student Number____________________________ CoE 3SK3 Computer Aided Engineering Midterm Test February 24, 2014 McMaster University Instructor: Xiaolin Wu Department of Electrical and Computer Engineering (xwu@mail.ece.mcmaster.ca) THIS EXAMINATION PAPER INCLUDES 2 PAGES AND 3 PROBLEMS. YOU ARE RESPONSIBLE FOR ENSURING THAT YOUR COPY OF THE PAPER IS COMPLETE. BRING ANY DISCREPANCY TO THE ATTENTION OF YOUR INVIGILATOR. 1. This test is 50 minutes long. 2. A cheat-sheet (letter-size, both sides) and the standard McMaster calculator are allowed. 3. Return this question sheet with your solutions. Problem 1 (8*5=40 Points) Answer the following multiple choice questions: 1. Given x > 0 and fl(1 + x ) = 1, what is the range of x ? fl( x ) is the floating point representation of x in a computer. (1) x is smaller than machine precision (2) x < 10 -8 (3) x < 10 -16 (4) x < 2 -16 (5) x < 2 -16 2. About different root-finding methods, which of the following statements is correct? (1) The absolute error of the bisection method is monotonically deceasing in the number of iterations. (2) The absolute error of the Newton method is monotonically deceasing in the number of iterations. (3) The Secant method is preferred when the derivative can be easily computed. (4) The Secant method works in the same principle as the Newton method but it does not need to compute the derivative of function ( ) f x . (5) The bisection method can find repeated roots. 3. To solve a linear system AX = b using Cholesky decomposition, where A is a positive definite n × n symmetric matrix, (1) O( n 2 ) arithmetic operations are required. (2) O( n 2 log n ) arithmetic operations are required. (3) O( n 3 ) arithmetic operations are required. (4) O( n 4 ) arithmetic operations are required. (5) O( n log n ) arithmetic operations are required.
4. To solve m linear systems AX = b 1 , AX = b 2 , … AX = b m using the LU decomposition, where A is an invertible n × n matrix, (1) O( mn 2 ) arithmetic operations are required. (2) O( mn 2 log n ) arithmetic operations are required. (3) O( n 3 + mn 2 ) arithmetic operations are required. (4) O( mn 3 ) arithmetic operations are required. (5) O( mn log n ) arithmetic operations are required. 5. Which of the following statements is true: (1) Condition number of a matrix is the number of nonzero elements in the matrix. (2) Condition number of a matrix is always relative to its largest eigenvalue. (3) If a matrix is singular, its condition number is zero. (4) Given an eigenvalue of a matrix, the corresponding eigenvector is uniquely determined. (5) The numerical solution to a linear system AX = b is more stable if the condition number of A is close to 1. Problem 2 (30 points) Given 2 2 3 1 1 0 1 2 1 ª « « « ¬ A , b = [9, 4, -3] T . (a) Compute the inverse matrix of A using LU decomposition (you need to present both matrices U and L ). (b) Consider the numerical solution of the linear systems A -1 X = b . Suppose that b has errors û b = [0.1, 0.1, -0.1] T , bound the relative errors in the solution of X , in term of 1-norm. Problem 3 (30 Points) Given the data below: x i 0.865 2.010 3.023 3.498 4.872 y i 3.163 0.049 -1.030 -0.072 2.935 (a) What is the best mathematical model y = f ( x ) that you can think of to fit the above data? (b) Describe how to construct your model y = f ( x ) using least squares regression. (Note: you only need to describe the algorithm to compute the model parameters. No need to find the numerical solutions).
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
Name_____________________________________ Student Number____________________________ CoE 3SK3 Computer Aided Engineering Midterm Test February 26, 2014 McMaster University Instructor: Xiaolin Wu Department of Electrical and Computer Engineering (xwu@mail.ece.mcmaster.ca) THIS EXAMINATION PAPER INCLUDES 2 PAGES AND 4 PROBLEMS. YOU ARE RESPONSIBLE FOR ENSURING THAT YOUR COPY OF THE PAPER IS COMPLETE. BRING ANY DISCREPANCY TO THE ATTENTION OF YOUR INVIGILATOR. 1. This test is 50 minutes long. 2. A cheat-sheet (letter-size, both sides) and the standard McMaster calculator are allowed. 3. Return this question sheet with your solutions. Problem 1 (8*4=32 Points) Multiple choice questions: 1. Comparing the false-position method and the bisection method, which of the following statements is correct? (1) The two methods are the same if the function f ( x ) is linear. (2) The false-position method converges faster in all cases. (3) The bisection method converges faster in all case. (4) There are cases the false-position method can find a root but the bisection method cannot. (5) There are cases the bisection method can find a root but the false-position method cannot. 2. Pivoting in Gaussian elimination aims to (1) speed up the algorithm (2) rotate the coefficient matrix (3) transpose the coefficient matrix (4) swap two rows of the coefficient matrix (5) swap two columns of the coefficient matrix 3. To solve a linear system AX = b using the LU decomposition, where A is an invertible n × n matrix, (1) O( n 2 ) arithmetic operations are required. (2) O( n 2 log n ) arithmetic operations are required. (3) O( n 3 ) arithmetic operations are required. (4) O( n 4 ) arithmetic operations are required. (5) O( n log n ) arithmetic operations are required.
4. To solve m linear systems AX = b 1 , AX = b 2 , … AX = b m using Cholesky decomposition, where A is a positive definite n × n symmetric matrix, (1) O( mn 2 ) arithmetic operations are required. (2) O( mn 2 log n ) arithmetic operations are required. (3) O( n 3 + mn 2 ) arithmetic operations are required. (4) O( mn 3 ) arithmetic operations are required. (5) O( mn log n ) arithmetic operations are required. Problem 2 (18 Points) Consider a computer that uses 8 bits to represent floating-point numbers, 1 bit for the sign s , 3 bits for the exponent c ( c = e +3), and 4 bits for fractional part f . In terms of s , e , and f , the base 10 numbers are given by ) 1 ( 2 ) 1 ( f x e s ° , c is non-negative, and 1 0 d f . This is the same design as IEEE floating-point representation with a much shorter machine word length. (a) What are the smallest and largest positive (non-zero) numbers that can be represented accurately (without any chopping/rounding error) on this computer? (b) Is the machine precision of the above scheme less than 1%? If not, how many bits are required for the fractional part f to achieve the machine precision of 1%? Problem 3 (25 points) Find the root of the equation 0 x e x using Newton-Rhapson method. (Initialize the iteration at x = 1; the absolute error should be less than 0.001) Problem 4 (25 Points) Given the data below: x i 1.0294 1.5888 2.3931 2.9136 3.3093 4.6325 4.9993 5.2398 y i 7.1512 9.7198 9.1231 7.3526 5.9032 4.7453 7.1478 9.2528 (a) What is the best mathematical model y = f ( x ) that you can think of to fit the above data? (b) Describe how to construct your model y = f ( x ) using least squares regression. (Note: you only need to describe the algorithm to compute the model parameters. No need to find the numerical solutions).
! % & & O C D ˛ Zvg˛ ˚ƒ § \ ˛ B fi ¢ ¸ / ´ ˛ . iZ1pB} yz a ˛ # ) Q ˛ , ¤ ˛ J ^ ¨ ˛ m u # t ˛ p q 0 ˛ _ L ˛ R ; - 7;_Cs<8 ) ! A 5 L t . E N U ˛ 9*S^\ldV 3 T , Ho~˛ ¡%<£™“+˛ ? % + fl ˛ ( % ) & K : ; ¥l¿˝˛ M T ˛ f / | G ˛ 1 ˛ ˆ ˛ * ˛ "& Ab˛ ˘}h¶˛ 3 ˛ ) $2qIn~ V @ ˛ / Y ˛ ˛ 4x{˛ ) Q ] J : ˛ [ K r # b 9 ˛ 8 r ' ˛ · 6 ˛ «˛ " I j ² ˛ $ ) Pw!˛ R˜˛ ) [zk- j w c k ! e f g( U 2 ˛ W X & ) ) = ) ˛ ` ˛ ) S 7 ˛ ) »˛ F o { m ˛ ei ˙ ˛ x ¯˛ X $ ? ( ˛ ) @ > N 0 O = a D 6 M W ˛ ) hv|P &u ˛ ) d & c n ˛ y s ˛ F ˛ " ) & 5 ˛ " # $ & & & >]˛ & 4 & ) ) & ) & G H Y
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
>%3? ? ? ;? ? ? :0? -*8’? .? ( ? <1? =!? +? # ? " 6 4 ? ? ,)7&? / ? ? 5$2? ? ? ? 9 ? ?
" J P $ P - 9 0 P ’:BP , ( - ( > F < @ 3 " P $ P " $ P - ! P - & D P $ !&- $%A1=-.P / P P " + - ) P " ) - " " - - " $ $ $ ! $ - " $ - , 4 P - P - I P % - $ - " # - " - $ 6 P $ # $ 2KGP " " " - ! " ? P L +M P * - $ - P P # P * ; E P H 5 7 8 O P NP CP $ $ $ - $
+ & , 8 8 $ , % * 8 / $ 0 4 2 5 3 8 # , , *, 8 ( , , - 8 8 $ % (18 , ) 8 ’8 , ) , " , # 8 & , , % , ! 8 , , , " + , 8 , ! & 8 ! , , , , , , 8 , 7 8 , " 8 8 8 8 , . 6 8 , , , , 8 # , ,
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
#!) ¯ ) B = ] ˘S S 6 » ( S S y C 0 ^ ; _ fl¶ H:Z[O] & F > 6 ] £ C S iS E X ] B D C _ 3-] ; 1 S EFMZ_ ‡} . X _ ¡ l . S S > - ] _ d " S _ B > _ [R_ J5] UQ] `S B fl S 2 3 S ; ] % 2 x z S \ K _ O#S Q æ = S c > c G * S b0S t ^ ] û ˆ { \ Æ o N S p S \ æ aLs[~ , @ \ ] ]S fi # ·)S º-£S - 2 ( ] W ] _ 7 _ 2 S ) 2 2 ´ª Y 8 N G ] { % ) ( ) # ] 4 ] 1 ] S ! 2 G S 9_ r ¸ ˝ I 2 D ] . $ " L ? M 5S . ˜ S L e S D S y + S C R a $ S / S 1 2 2 ] $ ] @A5 k l 3 ™E | J S , S I S _ ) G _ x 8 $ S X ) i * ; < = d , 2 F J # 9 , N ¡ % K ² # S ø4S F E S " ) n E 7 * S ) 8 b ¤| . 2 Y „/… ² OE ¥ V ( 2 q r S ´%S L @ 8 - S 3 8 _ _ 2 ) /Oh1S 1 _ }S S L ] S ) = _ ATW_ · ˛ º ¿ $ ) S 2 _ g NDS ) S P _ # _ " 2 Q + M B S ı w’S I ( S S /M7] ¨S ¥ oe ˛ ¸ > S S ¿ S . P ] A S ˙S ’) ) Q_ ƒw 6!<_ e ( S 7 ˚’S F S H j ˚ Ø S O « M § S I _ fi J K ˆ S @ OE S ƒ û ˇ V S S ü 0 ' W S / S % ] A S :7S f ¯ t S S S / _ 2 H _ _ 4@_ ] & ? ] GS q'‰ uZ6 5 6 P ¤ S U 0 1 » _ S 2 S 0 2 h 2 2 P]TW 2 ol )*% _ / 2 K * ] OR: 2 ~ ) S ™–›HS U ( + & _ < Q H j Z S u R S " ] ) vØS ¢ + ] , $ _ _T3S 9fS ø›˘ S :ı,S L J D _ N _ Æ ! " ¢!ª•?‚P2S ) & S 2 5 _ ˝&4S C K ] 2 9kS ) ] ] " _ : _ ] z n S ] ) 2 2 « ^U%S 0 ] ? _ ü &) L p / ˇ ` § m * 2 2 s ˜ 2 & 2 + X Y S V ] g S ! S l m S [ I R 9 < ] !] YV-_ ; S < = S 4 ? ˙v ] 2 T ] S A ] ¨oe $ 2 + 2 _ _ 2 ] _ 2 2