MECH2700
Engineering Analysis I
Important notices
Introduction
Topic guide for revision
Software & reading material
Resource CD (online copy)
Tutorial sheets

Introduction

Motivation

Problems are often presented to the engineer in the form of questions such as:

  • How much ... is needed to ...?
  • Is ... strong enough?
  • What will happen if ... ?
The problem solving process that follows is usually to formulate a mathematical model of the situation in terms of algabraic or differential equations and then obtain quantitative estimates of key parameters within the model. These parameter estimates, together with some critical judgement, are then used to provide an answer the original question.

This course is about the application of computer technology to the analysis of Mechanical Engineering problems. The course covers problem formulation, mathematical modelling and includes a discussion of some numerical methods. Implementation of solutions will involve programming in a modern high-level programming language. Various numerical methods will be introduced throughout the semester and programming applications will involve aspects of dynamics, solid mechanics, design, fluid mechanics, thermodynamics and management.

Through this course, you will develop skills and confidence in applying computers to the analysis of engineering problems and also obtain a good foundation for more advanced study in modelling of physical systems, computing and numerical analysis.

Course Sequence

Week 1
Introduction: computer-assisted problem solving and discussion of the major assignment: Apollo trajectory calculation. Algorithms and their representation. Python as a calculator. Graphical representation of data.
Tutorial activity: Sample problem and implementation in Python.
Week 2
Programming in Python. Conceptual model of a computer. Data types (numbers, strings, tuples, lists), names and namespaces. Operations on data (arithmetic, slicing, etc). Control structures for program flow: sequence, selection, iteration. Defining your own functions.
Tutorial activity: program tracing.
Week 3
Introduction to numerical methods (and types of error). Representation of numbers, floating-point arithmetic, propagation of error, machine precision.
Tutorial activity based on a selection of items from the exercise sheets.
Week 4
Solving a nonlinear equation: bisection, Newton and fixed-point iteration.
Tutorial activity: mechanical calculation tools. Bring scissors, set squares, paper.
Week 5
More on programming: multiple return values and default parameters for functions; namespaces and scope; recursive functions; program modules; files and strings. Documentation and debugging. The use of classes to organise your program (optional).
Tutorial activity: calling functions.
Week 6
Modelling dynamic systems with ordinary differential equations. Solving ODEs using Euler, Huen and Runge-Kutta methods. Taylor series and graphical descriptions.
Tutorial activity based on minor assignment 1 (golf ball trajectory).
Week 7
Solving systems of linear equations (for structural mechanics). Direct methods (Gauss-Jordan elimination) and iterative methods (Jacobi and Gauss-Siedel). Matrices and vectors in Python: lists-of-lists.
Tutorial activity: application of row operations, parallel (human) computing.
Week 8
Interpolation of data using the monomial basis and the Lagrange basis. Ill-conditioning and the selection of sample points.
Tutorial activity based on major assignment.
Week 9
Eigenvalues and eigenvectors of systems of linear equations. Power method. Linear algebra in Python: the Numeric extension.
Week 10
Quadrature using Newton-Cotes methods. Adaption based on a recursive implementation.
Tutorial activity based on selection from exercise sheets.
Week 11
Data modelling via least-squares curve fitting.
Tutorial activity based on selection from exercise sheets.
Week 12
Optimisation using the (nonlinear) simplex method and application to design.
Tutorial activity based on selection from exercise sheets.
Week 13
Some of the topics will take longer than indicated above. This schedule will be adjusted to suit.

We're going to be programming in WHAT?

One sure way to start a fight with someone involved with numerical modelling is to suggest that they implement their algorithms is language X where X is something that they have not previously used. Numerical analysis has a history that goes back much further than any particular computing language and people have implemented their numerical models in many languages, FORTRAN being one of the early favourites, with C and MATLAB becoming more popular in recent years. We shall introduce Python as our implementation language and, because this choice appears "nonstandard", it deserves a little more explanation.

For numerical analysis, Python has most of the conveniences of MATLAB --which you may (or may not) recall from your first-year studies-- and few of the disadvantages (such as licence fees and everything being a matrix). It also has the conveniences of Java and C for general computing activities without the need to deal with many low-level details that obstruct your thinking about the task at hand.

The important and difficult parts of the course, conceptually, are the modelling, analysis and interpretation activities. However, you will nearly always use the computer as an aid to do the many (boring) arithmetic details that data for interpretation. The language that you use for instructing the computer shapes your thoughts on what approaches are feasible or best and, because you will spend many hours in front of the computer, experimenting and coaxing it into doing what you want, the choice of language will become important. Python is a good language for thinking about computing activities in general. It has good structure and readable layout, convenient data representations (such as lists and complex numbers) and nice MATLAB-like extensions for matrices, linear algebra and plotting.

Just because you are introduced to Python in this course doesn't mean that you should discard your knowledge of MATLAB, Java or C. Subsequent courses will expect that you can apply your skills in analysis to problems in design, fluid mechanics and the like. You should be able to implement anything in Python, however, sometimes computational tools will be made available in MATLAB. This is fine because you will soon realize that often MATLAB code and Python code required to do a particular job are essentially the same, except for some minor changes in syntax.


Page design and layout by Maria Huynh.
Content by Peter Jacobs, updated 2005.