ENGINEERING COMPUTATION Second Year Lectures Stephen Roerts Michaelmas Term Engineering Computation ENGINEERING COMPUTATION Second Year Lectures Stephen Roerts Michaelmas Term The handouts are rief lecture notes, not a tet ook! You must come to the lectures, read tetooks, do the tutorials and Matla eercises to understand this course. Engineering Computation
Introduction hat is this course for? Throughout your career as engineers, you will e turning mathematical models of engineering systems into numerical results. This course provides Engineering Tools in the form of Numerical Methods to do this using Computers. The study of these methods is called NUMERICAL ANALYSIS Real world engineering design and analysis prolems are usually too comple to solve analytically! Numerical analysis provides algorithms (a sequence of operations) to solve prolems numerically Computer packages (e.g. MATLAB, Mathematica NAG liraries, IDEAS for Computer Aided Design (CAD), FLUENT for Computational Fluid Dynamics (CFD))) have uilt in algorithms making it easier for engineers to solve prolems these can need handling with care. The Engineering Computation Laoratory allows you to investigate some of these methods using MATLAB in more depth. Engineering Computation Themes Numerical analysis is not principally concerned with computer algorithm implementation and optimisation of speed of implementation of algorithms (computer science issues). It is also, not just an infinite set of methods (recipes) that one has to just memorise. In practice, there are a finite numer of useful numerical methods. These can e compared in terms of Convergence rate/accuracy Roustness/staility/conditioning (we are going to have to define measures for these properties efore we do this of course.) Engineering Computation
Recommended tet: Burden R.L. and Faires, J.D., Numerical Analysis, 6 th Edition. Kreyzig, E. Advanced Engineering Mathematics, th Ed. Chapters 8- Further reading: Johnson, L.. and Riess R.D., Numerical Analysis, Addison-esley. Curtis, F. and heatley, P.O., Applied Numerical Analysis, Addison-esley Press et al, Numerical Recipes for C, Camridge University Press. Plus many ooks on numerical analysis in college liraries and the departmental lirary. If you find a good one let me know and I ll advertise it.. Engineering Computation Lecture Course Contents (8 lectures):.linear simultaneous equations A: rank; nullity; kernels and echelon form..conditioning of simultaneous equations: ill-conditioning; vector norms; matri norms; condition numer..iterative solution of simultaneous equations A: Jacoi and Gauss-Siedel algorithms; convergence..computation of matri eigenvalues and eigenvectors: power method; Rayleigh quotient, deflation of matrices..approimate representations of data: regression, overfitting, functional approimation, using orthonormal polynomials as a asis, Cheyshev polynomials, stale regression. 6.Computing derivatives and integrals: difference methods; trapezium method; Simpson s rule and advanced quadrature methods..computing Solutions of Ordinary Differential Equations: Euler method; modified Euler; Higher order equations. 8.Computing Solutions of Partial Differential Equations: elliptical (e.g. Laplace s), paraolic (e.g. diffusion) and hyperolic (e.g.wave) equations. Engineering Computation 6
Linear simultaneous equations (LSEs) A () Some useful definitions (rank, nullity) () Solving general LSEs Etra reference: Elementary Linear Algera, H. Anton, John-iley 8 th Ed,. Engineering Computation Linear Simultaneous Equations Many engineering prolems come as Linear simultaneous equations. e.g. electrical circuit analysis. consider the equation for Node on the right. The Ys are admittances: ( V V ) Y + ( V V ) Y + ( V V ) Y For all nodes, this is a set of equations of the form V V Y, i,,,... ( i j ) i j ij At first glance these equations appear homogeneous of the form.epression... However, on the left hand side we have an etra inhomogeneous equation defining the input: V V in. the complete set can e written as a matri equation A, In this case ( V,...V ) T, ( V in,,... )T and A is a matri of admittances of the form Y ij. Solving the matri equation A calculates the voltages in the circuit. Engineering Computation 8
Structural analysis (e.g. Computer aided design CAD ) also gives rise to Linear simultaneous equations, if the components of the forces into nodes of a truss structure (such as the Sydney Harour ridge elow ) are summed. Let us look at formal ways to solve general linear simultaneous equations of this kind Engineering Computation 9 Rank and Nullity Last year you solved A when A M N is square, or M N. How? i.e. numer of equations numer of variales hat if this isn t so? hat if matrices are rectangular rather than square? Two Cases:. Portrait M > N More equations than variales. Either equations are inconsistent no eact solution. Perhaps look for Optimal solution which most nearly satisfies the equations? Or there is some redundancy e.g. one equation is the sum of two others, and a solution may still eist!. Landscape M < N More variales than equations. hole family of solutions. Can we incorporate other knowledge and find some optimal solution? Need tests to determine redundancy and consistency in sets of linear simultaneous equations Engineering Computation
6 Engineering Computation Rank r of a Matri A matri T T T... M N M a a a A is made up of M row-vectors T m a, m,,...m. Each row vector is the set of coefficients of left hand side of the equations A. ( ) A rank r is defined as the numer of linearly independent vectors of the set T m a of the rows of A. A vector a m is linearly dependent on a, a,....., a m- if there eist constants µ, µ,....,µ m- such that a m µ a + µ a +.....+ µ m- a m- How do we determine rank? Engineering Computation Eamples - y-eye approach : has rank.,, and and have rank. hat are the determinants of these matrices? Is this relevant? Let s try some further eamples: hat is the rank of (i), (ii) 9 (iii) 8??
Nullity of a Matri A complimentary measure to rank of A,the numer of effective constraints on in A, is the nullity. Define n nullity(a) numer of degrees of freedom remaining in. So: n nullity M N ( A ) N r (rememer, N is the numer of columns, or variales ) hat are the nullities of the eamples aove. Engineering Computation The further eamples: (i), r, N, nn-r- (ii), r, N, nn-r- 9 (iii), r, N, nn-r- 8 Engineering Computation
Eample of an indeterminate structure Resolving forces horizontally and vertically, plus taking moments, gives equilirium equations, in matri form: A or X Y X Y You can see that the rows of A are independent A has rank r. But numer of columns numer of variales N. So nullity n -. Since n >, the forces [ X ] T, Y, X, Y are not uniquely determined. Of course this is ecause the horizontal forces are indeterminate and can e made any magnitude, suject to the constraint in the second equation, i.e. X + X Nullity can e useful in determining whether engineering prolems have real solutions. Engineering Computation The general solution of a linear simultaneous equations A Engineering Computation 6 8
The Kernel of a Matri hat can we do aout finding the many solutions to indeterminate sets of simultaneous linear equations? Rememer the solutions to a differential equation such as & y&+ y& + y cos? The full solution was one particular solution of the full equation plus a complimentary function solving & y + y& + y. e use a similar idea: The general solution of A has two parts: () A particular solution such that A and () a kernel of A, defined as a vector space ( A ) { : A } ker where : here means such that The Kernel is thus the set of many vectors for which A. Note is a vector! Engineering Computation The general solution is then +, for all ker( A), where reads contained in. For eample, in the indeterminate structure aove, one particular solution (y inspection) is [ / / ] T and ker( A ) [ ] T where R is any real-valued constant. This makes sense in physical terms, and gives a complete solution (of course, many solutions!) + [ / / ] hat aout a more general approach! Engineering Computation 8 9
Engineering Computation 9 Echelon Form e can t continue to solve all these prolems y inspection! e need a systematic, roust engineering method for computing rank, nullity, the kernel and particular solutions. Use Gaussian elimination you used in the first year to generate the Echelon Form of the matri: Gaussian elimination Eample: Add multiples of one row to others to reduce matri to an upper triangular form. row row - row - row row row - 6 Note that these row operations preserve the determinant and the rank of the matri. The rank is then just the numer of non-zero rows ( ). The determinant is the product of the diagonal terms ( -). This looks useful! Engineering Computation Echelon form Eample: Apply similar row-operations to non-square matrices to determine their rank and nullity. Use our structure eample again. No zero rows, so rank r. Nullity - as efore. In the prolem A, or, There is one free variale,, not on the leading terms of the echelon. so set, any real numer, and ack solve to give,, + giving ( ) [ ] T ker A as efore.
Engineering Computation General solution to static indeterminacy prolem A slight variation on what we have done just now. Reduce what is known as the augmented matri to Echelon form in the same fashion as you did with Gaussian elimination: Represent A y the augmented matri [ ] A Get a particular solution y setting free variale and ack solve for remaining key variales: [ ] T / /, /, / General solution is [ ] [ ] T T / / + [As efore] Engineering Computation Eample with two dimensional kernel (ie free variales). A and Echelon form ecomes [ ] [ ] A A 6
Engineering Computation Proceed in three steps:. Consistency. in [ ], A is linearly dependant on the columns of A, so at least one solution eists.. Kernel. Identify free variales, and solve A to give ( ), ker A. Particular solution Set free variales and solve A to give. Engineering Computation The full solution is the sum of these: + + + for any values of and.