25 views

Uploaded by michaelfoley98

- Gid Data code
- Automated State Model Generation Algorithm for Power Circuits and Systems
- Lab1
- Level 1 Course Notes
- Ch02_Environment_3rd_ed.ppt
- m13554
- Matlab
- 18 Matrix Math
- 1-s2.0-S037704270200479X-main samir sir2
- MATLAB
- Arc Length of a Pipe Needed for a Directional Drill
- JoshiReport1
- cubicinMatlab
- Ucla Pso Manual
- Capacity Reduction Factor
- 20WSeL4tz2k
- pc_processing_with_saga.pdf
- Adams Bash Forth Proof
- IRJET-Test variables selection and multiple parametric faults detection in nonlinear analog circuits
- Exam_exam_1_ (1)

You are on page 1of 7

SAMPLE PAPER

SUMMER EXAMINATION, 2010

Applied Mathematics - AM2032 Numerical Methods and Programming Professor Oliver M. O Reilly Professor A. Pokrovskii Dr. J.J. Grannell

Answer one question from Section A and two questions from Section B Full marks for three questions All questions carry equal marks Calculators are allowed

Section A

1. (a) Consider the MATLAB expression 2*3+2-72/4^2. Explain the order in which the exprerssion is evaluated. What value would MATLAB obtain for the expression? (b) Let x = [2 1 4] and y = [1 3 2]. Which of the following expressions are legitimate MATLAB expressions? i. x*y ii. x*y iii. x.*y Explain how it would evaluate each legitimate expression and what result it would obtain. (c) Write MATLAB instructions to plot the functions x = 3e t and y = 2 2e 4t in the same window using the MATLAB subplot command. Both functions should be plotted for 0 < t < 1 using 101 equally spaced points. The graphs should be side by side with the graph of x(t) on the left. (d) For each of the following, write a single MATLAB instruction to implement it: i. ii. iii. iv. v. create a 2 4 matrix A of zeros, create a 2 2 matrix B of ones, create the 2 2 identity matrix I, change A to a matrix, all of whose entries are equal to 2. Construct the matrix C from the matrices A, B and I, where 1 0 2 C= 2 1 1 0 1 2 2 1 1 1 1 2 2 1 0 1 1 2 2 0 1

(e) Write a recursive function which computes the k th term of the sequence tn = rtn 1 + a; n = 1; 2; :::; k where t0 = 0 The arguments of the function are the values of r, a and k. (f) Consider thet MATLAB instruction: mesh(X,Y,Z). What arguments does the mesh command take and what does it do? What is the dierence between the MATLAB commands mesh, surf and sur ?

2. (a) The bisection method for the solution of the nonlinear equation f (x) = 0 is applicable if the equation has a single root in an interval (a; b), if the function f is continuous on (a; b) and if the function f changes sign at the root. The method involves comparing the sign of f at one end, say a, with that at the midpoint c = (a + b)=2. If the sign of f at a is opposite to that at c the root lies between a and c. Otherwise it lies between c and b. Thus, a new interval has been found in which the root lies. The new interval is half the length of the previous interval. The mid-point of the new interval is the new estimate of the root and it lies no more than half the length of the new interval from the root. The procedure is repeated until the root is located in a su ciently small interval. Write a MATLAB function called BIS which implements the bisection method to nd an estimate of the root of the equation, assuming the above conditions are statised. The arguments of the function BIS should be the values of a and b, the accuracy to which the root is required and a function handle for f . The function BIS should return the nal estimate of the root, the error bound on this estimate and the number of iterations taken to nd the root. (b) The Heun second-order Runge-Kutta method for the solution of the initial value problem: dy = f (x; y); x > 0 dx y(0) = y0 where f is a known function of its arguments and y0 is a known number, is given by: zj+1 z0 h = zj + [f (xj ; zj ) + f (xj+1 ; zj + hf (xj ; zj ))]; j = 0; 1; 2; :::; n 2 = y0

where h is the step size and nh is the nal value of x at which the value of y is needed. Write a MATLAB function called HEUN to implement the Heun method. The arguments of HEUN should be the number of steps, n, the step size, h, the value of y0 and a handle for f . The function HEUN should return a vector consisting of the values [z0 , z1 , :::, zn ].

Section B (NOTE - there will be only FOUR questions in Section B in the examination, but I have given examples of questions on each of the six numerical topics studied)

3. (a) Give a graphical derivation of Newton method s xn+1 = xn f (xn ) ; n = 1; 2; ::: f 0 (xn )

for the numerical solution of the nonlinear equation f (x) = 0 (b) Consider the nonlinear equation x2 2=0

Apply Newton method with initial estimate x1 = 1 and compute s estimates until jxn+1 xn j < 10 2 (c) Show that the function x2 2 is strictly increasing for x > 0. Hence, show that the error in your nal estimate is less than 10 2 in magnitude.

4. (a) Let a = x1 , x2 , ... , xn 1 , xn = b be a mesh of nodes on the interval (a; b). The function f (x) is dened on the interval (a; b). Show that the polynomial of degree n 1 which has the value unity at node xi and is zero at all the other nodes is given by `n i

1

(x) =

n Yx x j=1 i j6=i

xj xj

Hence, show that the Lagrange interpolating polynomial (which equals f at the nodes) is given by: pn

1 (x)

n X i=1

f (xi )`n i

(x)

(b) Find the Lagrange interpolating polynomial of degree n = 2 which interpolates e x at the nodes 0, 0:5 and 1. Make use of your interpolating polynomial to estimate e 0:25 .

f (x) dx

to an integral over the standard interval (0; 1). (b) Derive the Gaussian 2-point quadrature rule: Z 1 1 1 g(x) dx ' g( p ) + g( p ) 3 3 1 (c) Apply the Gaussian 2-point rule to nd an approximate value of the integral Z 1=2 1 dx 1 + x2 0 6. (a) A least squares approach to the approximation of the function f (x) on the interval (0; 1) by a a linear combination

n X j=1

cj

j (x)

of special functions 1 (x), 2 (x) , ..., n (x) is to choose the coe cients c0 , c1 , ..., cn so that the least square error Z 1 En = e2 dx n

0

n X j=1

cj

j (x)

where

Show that this approach leads to the following equations for the coe cients: n X Mij cj = bi ; i = 1; 2; :::; n

j=1

Mij bi

= =

1 i j 1

dx

dx

i (x)

= xi

; i = 1; 2; :::; n 1,

0

dx

(c) Make use of the above formulae to nd a least square approximation to sin x on (0; 1) by a polynomial of degree 1 (a straight line). 7. (a) Derive the Gauss-Seidel Method 2 i 1 X 1 4 xnew = bi aij xnew i j aii j=1

j=i+1

n X

(b) Apply the method to the numerical solution of the system: 4x1 x2 x1 + 4x2 x3 x2 + 4x3 = 3 = 2 = 3

taking (x1 , x2 , x3 ) = (0:9; 0:9; 0:9) as initial estimate. Terminate the iterations when xnew i xold < 0:05 ; i = 1; 2; 3 i

8. (a) Consider the initial value problem dy = f (x; y); x > 0 dx y(0) = y0 where f is a known function of its arguments and y0 is a known number. Derive the Crank-Nicholson method zj+1 z0 h = zj + [f (xj ; zj ) + f (xj+1 ; zj+1 )] ; j = 0; 1; 2; ::: 2 = y0

(b) Apply the Crank-Nicholson method to the numerical solution of the problem dy = y; x > 0 dx y(0) = 1 Use a step size of h = 0:05 and compute z1 and z2 . (c) Give a brief explanation of how the Crank Nicholson method could be applied to nonlinear initial value problems.

- Gid Data codeUploaded bydiv53
- Automated State Model Generation Algorithm for Power Circuits and SystemsUploaded byMichael Calizo Pacis
- Lab1Uploaded byAtif Imtiaz
- Level 1 Course NotesUploaded byybeltagy3111
- Ch02_Environment_3rd_ed.pptUploaded bySoso Qe'war
- m13554Uploaded byCA Fao
- MatlabUploaded byEstrellita Sy Viduya
- 18 Matrix MathUploaded byHanafiahHamzah
- 1-s2.0-S037704270200479X-main samir sir2Uploaded byJishan Ahmed
- MATLABUploaded byRhea Mamba
- Arc Length of a Pipe Needed for a Directional DrillUploaded byshin_malaq
- JoshiReport1Uploaded byAnkit Joshi
- cubicinMatlabUploaded byGeorge Be
- Ucla Pso ManualUploaded byYJohn88
- Capacity Reduction FactorUploaded byFauziah Aziz
- 20WSeL4tz2kUploaded byDaniel
- pc_processing_with_saga.pdfUploaded byDavide Schenone
- Adams Bash Forth ProofUploaded byAhmad Sadam Syaerozi
- IRJET-Test variables selection and multiple parametric faults detection in nonlinear analog circuitsUploaded byIRJET Journal
- Exam_exam_1_ (1)Uploaded byMichael Fried
- JEE_23(5)_771-792_(2019)Uploaded byjuanarcos_778612
- Brauer, Weyl - Spinors in n dimensionsUploaded byMarco Piazzi
- Get_Summary_2005_08_15Uploaded byOscar Franco M
- lemh1psUploaded byRaymond Baker
- Clusters, Networks, And Firm InnovativenessUploaded byHenry Dong
- Maths D (Normal Track) Year 10 (3 YEARS)Uploaded byYenny Tiga
- Case Tests GAUploaded byLeandro Santos
- ProposalUploaded byctwan
- MatlabInstallationMarch2016.docxUploaded byMala Rattan
- B-EI_Modules.pdfUploaded byAddisuBantayehu

- 2016-2017 algebra 1 curriclum mapUploaded byapi-229596858
- Matlab TutorialUploaded byneoiitk
- Mine Holidays HwUploaded byRashi Lal
- 23-MATHSUploaded byAzeef Ajmal
- Haitham AliUploaded byHaitham Haitham
- Chapter-5Uploaded bySimiYadav
- 2017 Contest Final VersionUploaded byp001
- Progscilab v.0.10 EnUploaded bytrescatorce20035528
- PDFF160Uploaded byKatie Surmas
- B10_34_1972_Jun_Fortran IV Program to Calculate z-Transfer Funtions for the Calculation of Transient Heat Transfer through Walls and Roofs_National Research Council Canada.pdfUploaded byLahcen Akerkouch
- Report - Spectral MethodsUploaded byArunSuthar
- WaveshapingUploaded bySrikanth Reddy
- Ramaiah Entrance Test PaperUploaded byNaren Parashar
- Sample Curricula Bachelor of Science in MathematicsUploaded bySeph Batas
- Sage TutorialUploaded byAnonymous RsPjrrzfI4
- l Scheme Iyr Syll BookUploaded bymariyathai_1
- Octave Basic module 1 nitkUploaded byManjunath Maigur
- Numerical Analysis - Chapter3.pdfUploaded byvmedeau
- Algebra basics.docxUploaded byJohn Renniel C. Betasolo
- BBA OldSyllabusUploaded byRajan Neupane
- AddMath Syllabus.pdfUploaded byAlice Lin
- Algebra TestUploaded byfer
- 2-4 Zeros of Polynomial FunctionsUploaded byIbrahim A Said
- Lecture 4 Limit LawsUploaded byMrDubster
- SGT EnglishUploaded byMadhavi Priya
- Mathematics Class IXUploaded byKulachi Hansraj Model School
- Elementary Algebra Hall KnightUploaded bymadangk
- ami99gUploaded bybekirovich
- GroupsUploaded byyashbhardwaj
- parentsguidetoqfUploaded byapi-255489156