MATLAB in Engineering Mechanics
wb1443
(Fall 2014, Q2)


Instructor: Arend L. Schwab

Delft University of Technology 

Description: MATLAB in Engineering Mechanics is an introductory course in technical computing, MATLAB, and numerical methods. The emphasis is on informed use of mathematical software. We want you to learn enough about the mathematical functions in MATLAB that you will be able to use them correctly, appreciate their limitations, and modify them when necessary to suit your own needs.

Goal: By the end of the course you will be competent at writing your own MATLAB code to solve a technical computing problem in Engineering Mechanics on graduate level.

Homework: There will be weekly homework assignments and a final project. The homework is due a week after hand out and will be graded. Hand in your homework at the start of class at the front. The homework is strictly individual but in doing the homework I encourage you to work together within the rules and regulations.

        Rule and Regulations:
        To get credit, on every homework assignment please do the following things:

The graded work can be picked up at the end of class or at TA's office.

Grading: Total course grading is 70 % homework and 30 % final project. Homework is the average of the weekly homework assignments. Final project is the grading of the written report on the final project (individual!. There is no written or oral exam.


News
- 19 Feb: Posted homework and final grades:
- Grades-wb1443-2014-2015.pdf
- 1Dec: Posted the homework grades.

Hand-Outs
- The course contents, please read closely!
- Course text: Cleve Moller, `Numerical Computing with MATLAB,' SIAM, 2004.
   Free at: http://www.mathworks.com/moler/chapters.html
- Lecture 1 m-files: Lecture1.zip
- Lecture 3 m-files: Lecture3.zip
- File form Lecture4 example: exinvpend.m
- Extra assignment for HW4 which is NOT in the book: exercise5xx.txt
- Lecture 5 m-files: Lecture5.zip
- Lecture 6 m-files: Lecture6.zip

Homework
The assignment numbers are according to the web based course text:  http://www.mathworks.com/moler/chapters.html.
Unfortunately the SIAM published course text sometimes shows a different numbering.
Please, hand-in your homework on paper at the start of class or BEFORE class in my BmechE papermailbox at 3mE tower E, first floor.

- HW Set 1: [1.2, 1.3, 1.4, 1.8, 1.19 1.20 1.25, 1.35, 1.38, 1.39]   Due: Thu 20 Nov 17:00 h Papermailbox 
- HW Set 2: [2.1, 2.2, 2.3, 2.5, 2.9, 2.19, 2.21, 2.22, 2.23, 2.25]   Due: Thu 27 Nov 15:45 h at the start of class
- HW Set 3: [3.1, 3.2, 3.3, 3.11, 3.16, 3.18, 8.1, 8.7, 8.8]             Due: Thu  4 Dec 15:45 h at the start of class
- HW Set 4: [4.1, 4.2, 4.3, 4.4, 4.9, 4.14, 4.16, 5.8, 5.12, 5.xx]    Due: Thu 11 Dec 15:45 h at the start of class
- HW Set 5: [7.1, 7.2, 7.3, 7.5, 7.6, 7.7, 7.14, 7.15, 7.20]             Due: Thu 18 Dec 15:45 h at the start of class
- HW Set 6: [10.6, 10.7, 10.13, 10.15, 10.16, 7.8, 7.9, 7.10, 7.11]  Due: Mon 12 Jan 2015, 2012, 17:00 h.
  Please hand in HW6 ON PAPER in my papermailbox. Use this walkers.mat file for assignment 10.13.

Homework & Final Grades
- Grades-wb1443-2014-2015.pdf

Solutions
- Homework Set 1: AnsHWSet1.pdf
-
Homework Set 2: AnsHWSet2.pdf
- Homework Set 3: AnsHWSet3.pdf
- Homework Set 4: AnsHWSet4.pdf
- Homework Set 5: AnsHWSet5.pdf

Final Projects
Choose one of the following final project:
Final Project 1: Assignment 7.23 from the course text: "The double pendulum", FinalProject1.pdf.
Final Project 2: Assignment 7.22 from the course text: "Nonlinear boundary value problem", FinalProject2.pdf.
Final Project 3: Show the Eigenmotions of an Uncontrolled Bicycle, FinalProject3.pdf.
Due date: Mon 12 Jan 2015, 17:00 h. ON PAPER in my papermailbox, next to room E-1-200.
For the do's and don'ts with the final project please read further at the bottom of this document.


 
Office Hours
TA: Robert Mooijman, r.a.mooijman@student.tudelft.nl
, Tue 8:45-10:30 h, room F-0-010 (Bicycle Lab).
TA: Max van der Kolk, m.vanderkolk@student.tudelft.nl, Tue 8:45-10:30 h, room F-0-010 (Bicycle Lab).
TA: Joost de Thije, joost.detheije@gmail.com, Tue 8:45-10:30 h, room F-0-010 (Bicycle Lab).
Instructor: Arend L. Schwab:  Mon. 15-17 h.,  room F-0-010, 015 278 2701.


Log

Week 1

Thursday, 13 Nov 2014, 15:45-17:30 u, room CT-CZ A.

In the weekly lecture hour I will not repeat the course text. Instead, I will demonstrate the topic by means of an Engineering Mechanics example. This week, for introduction, I talked about the steady curving of a bicycle. In particular: given the lean angle of the bike, the steering angle and the forward velocity of the rear wheel what is the steady curve negotiated by the bicycle? It turns out to be a tricky 3D geometry problem. With the help of Mathworld for the plane plane intersection and the definition of the rotation matrix in terms of axis-angle, I showed how you can work out such a problem. Next, I demonstrated the coding in MATLAB to get numbers and graphs. I would like to use a 2 stage technique: first ad-hoc numeric, then use these expressions to repeat these calculations and make a graph and finally use symbolic math to get some expressions, but time was running out. The m-files showed: Lecture1.zip. Read the course contents, read Chapter 1 of the course text and do Homework Set 1.

Bonus Question: When the lean angle approaches 90 degrees the steer angle on the ground, beta, seems to approach a constant value for any steer angle delta.  Determine this value of beta for alpha=70 degrees and prove this result in general for any alpha. Good for 1 Bonus point on HW1.

Week 2

Thursday, 20 Nov 2014, 15:45-17:30 u.  NO LECTURE, I'M TRAVELING ABROAD

There is no lecture this week. I'm traveling abroad. Please hand in your Homework Set 1 in my papermailbox at BmechE, block E first floor by Thu 20 Nov 17:00 h the latest. And for this weeks work: Read Chapter 2 on Linear Equations and do Homework Set 2.

Week 3

Thursday, 27 Nov 2014, 15:45-17:30 u, room CT-CZ A.

Presented a case study, the use of measured cam-follower data for dynamic analysis of a cam drive system. It shows some drawbacks of piecewise cubic interpolation. A finite Fourier representation seems more applicable. See m-files in: Lecture3.zip. Read Chapters 3 and 8 of the course text and do Homework Set 3.

Bonus Question: In the cam-follower example we read the cam data from a text file cam.dat, where the first two lines start with a % and are treated as comment. What if you would like to read a file into matlab with lines of text, where the first character can be a %? Write a small matlab program that reads a textfile  line by line and put in a matlab data structure, for instance a struct array of strings. Good for 1 Bonus point on HW3.

Week 4

Thursday, 4 Dec 2014, 15:45-17:30 u, room CT-CZ A.

I presented a case study of a spring-loaded inverted pendulum. I derived the equilibrium points and classified the stability of these equilibria. This shows the use of finding zeros of functions. The final results is the so-called bifurcation diagram. Look at the m-file exinvpend.m. I shortly discussed the problem of curve fitting, Chapter 5. Please take a look at this Chapter, in particular 5.8: Separable Least Squares. This example is also one of the Homework problem, numbered 5.xx (not in the book as a regular exercise). Read Chapters 4 and 5 of the course text and do Homework Set 4.

Week 5

Thursday, 11 Dec 2014, 15:45-17:30 u, room CT-CZ A.

Started with the numerical integration of the equation of motion of a single forced Mass-Spring-Damper system. Showed how to get from a second order ODE to a set of first order ODE's. Analyzed the MSD system by numerical integration in Matlab. Demonstrated various handy things, like phaseplot etc. Changed the viscous damping in Coulomb friction. See m-files in: Lecture5.zip. Discussed the contents of Chapter 7 in brief.  Read Chapters 7 of the course text and do Homework Set 5.

Bonus Question: Write a Matlab function odeanima.m which animates the motion of the mass during the numerical integration just like odephas2.m behaves in:
  opts = odeset('reltol',1e-6,'abstol',1e-6,'outputfcn',@odephas2);
  [T,Y] = ode45(@singlemasseqn,tspan,y0,opts,pars);
for the
single forced Mass-Spring-Damper system as demonstrated during lecture. Also show during the animation the forcing cos(w*t) as a growing and shrinking red arrow. If your are really proud of your work then please don't hesitate to submit this function by email to me, so I can run it. Good for 1 Bonus point on HW5.

Week 6

Thursday, 18 Dec 2014, 15:45-17:30 u, room CT-CZ A.

Showed the origin of the eigenvalue problem: linear ODE with constant coeff. Lagrange was the first to formulate this problem (1726). The term 'eigenvalue' comes from Hilbert. In 1904 he introduced the German term 'eigenwert' which later got translated into 'eigenvalue'. As an example I started with the solution of 1 ODE and showed that the solution of a set of n ODE's involves an eigenvalue problem. Demonstrated a 2 by 2 case.  Demonstrated the stability analysis of an uncontrolled bicycle. This system has 2 degrees of freedom at a fixed forward speed v, namely the lean angle and the steering angle. The eigenvalue problem is 4 by 4, (two 2nd order differential eqn's).  At the end I talked  a little bit about the Lorentz attractor and chaos in dynamical systems. If you like to read more about chaos in dynamical systems then I highly recommend the books by Steven Strogatz "Nonlinear Dynamics and Chaos" and Florin Diacu and Philip Holmes "Celestial Encounters; the origin of chaos and stability". Here are some my m-files Lecture6.zip from this lecture. This was the last lecture for this course, remains to read Chapter 10, do HW Set #6 and the Final Project, please read further at Final Projects at teh top of this page.

You were a fine class, I enjoyed teaching the course this year!

Final Project.

The final project is strictly individual. To get full credit on the final project please do the following things:

Hand in your final project ON PAPER in my papermailbox. The due date is Mon 12 Jan 2015, 17:00 h. After about three weeks you can pick up the graded work at my office, again during office hours. There will be no exam. The final grade for the course will be 70% on the homework and 30% on the final project.