EML3035: Programming Concepts for Mechanical Engineers

A one-credit hour course


Lectures & Assignments      Syllabus


LECTURES, HANDOUTS AND ASSIGNMENTS 

FALL 2012

Archived lectures


Week 1 August 27 and August 31, 2012

Syllabus

Homework Affidavit Sheet

Affidavit sheet of attendance and pre-reqs

Apps site to use MATLAB remotely (read about saving files)

Preview of Book: First few chapters and Chapter 30 - Go to Blackboard>EML3035>Modules.

Multitasking gets a bad rap!

Cutting the potato

Lecture M files

Assigning Numbers to Variables and Performing Math Operations (Lift Exercise) - Week 1:

[mfile] [mfile: Cell formatted] [Published Version]

 

Assigning Numbers to Variables and Performing Math Operations (Kinetic Energy Exercise) - Week 1:

[mfile] [mfile: Cell formatted] [Published Version]

 

Assigning Numbers to Variables and Performing Math Operations (Transformer Exercise) - Week 1:

[mfile] [mfile: Cell formatted] [Published Version]

 

How to Define Strings and Concatenate them (Strings Exercise) - Week 1:

[mfile] [mfile: Cell formatted] [Published Version]

 

How to Convert a Number to a String (Strings Exercise) - Week 1:

[mfile] [mfile: Cell formatted] [Published Version]

 

Raw mfile from lecture [mfile]

 

How do I buy MATLAB or do I even need to buy MATLAB?

  1. You can use the apps option to access MATLAB remotely.  Be careful where you save your files (read this).  Also, you may not be able to connect to MATLAB if too many students are accessing MATLAB at the same time.

  2. You can use MATLAB free of charge in all open access labs (http://www.it.usf.edu/services/labs) except the ones in EDU building.  The ME CAD lab in ENC also has MATLAB.  Again, you may not be able to connect to MATLAB if too many students are accessing MATLAB at the same time.

  3. You can buy the MATLAB Student Version from the USF bookstore.

How should I study for this course?

In Spring 2004, I asked students if they had any parting words of wisdom for a student who is registered for this course. This is what they had to say - they are the words of wisdom from your peers. 

Sample HWs, quizzes from past class offerings and online practice tests,  and competency tests are available.  Keep yourself updated with what was taught in the classroom via the lectures and assignments link.

Useful MATLAB Videos

Getting started with MATLAB (Video)  

Fprintf command (Video)

Strings (Video)

Publishing MATLAB Code from Editor (Video)

Useful Matrix Algebra Videos (Chapter 4)

Diagonal and Identity Matrices [YOUTUBE 5:21]

Upper and Lower Triangular Matrices [YOUTUBE 5:21]

Adding Two Matrices [YOUTUBE 4:53]

Subtracting Two Matrices [YOUTUBE 5:34]

Multiplying Two Matrices [YOUTUBE 10:06]

Inverse of a Matrix [YOUTUBE 4:53]

Setting up Equations in a Matrix Form [YOUTUBE 7:07]

Sample Homework (not to be submitted for grade)

Sample Homework Assignment Sheet

Sample HW Mfile

Sample HW Published Output

What your Full HW Submission Should Look Like? (Sample)

Practice Online Quizzes (All Quizzes Link)

Assignment

Reading and Exercise Assignment: Chapters 1-4, 30

Test 1 syllabus: Chapters 1-16, 30.

What to do if the published output cuts off at the right (BLOG)

Assignment for Grade

Assigned HW for grade: Monthly Payment on a Car Due Mon September 10 (Sec 001), Friday September 7 (Sec 002)

Attach Homework Affidavit Sheet to the HW

Apps site to use MATLAB remotely (read about saving files)

Take the online quiz on Blackboard for grade.  It is under Assignments.


Week 2 September 7, 2012 and September 10, 2012

 

Lecture M files

Performing Matrix Operations: Chapter 5: Week 2:

 [mfile] [mfile: Cell formatted] [Published Version]

 

Matrix Operations Example: Chapter 5: Week 2:

 [mfile] [mfile: Cell formatted] [Published Version]

 

Plotting Functions: Chapters 6-7: Week 2:

 [mfile] [mfile: Cell formatted] [Published Version]

 

Using Logarithmic, Trigonometric Functions and Inverse Trigonometric Functions: Chapter 8: Weeks 2:

[mfile] [mfile: Cell formatted] [Published Version]

 

Using Symbolic Operations using syms Command: Chapter 9: Week 2:

[mfile] [mfile: Cell formatted] [Published Version]   

    

Using Symbolic Operations using inline Command: Chapter 9: Week 2:

[mfile] [mfile: Cell formatted] [Published Version]   

 

Solving Nonlinear Equations

[mfile] [mfile: Cell formatted] [Published Version]

Practice Online Quizzes (All Quizzes Link)

Chapter 05 - How Do I Use Matrices?

Chapter 06 - How Do I Plot in MATLAB?

Chapter 07 - What Else Can I Do With Plots?

Chapter 08 - How Do I Use Logs and Trig Functions?

Chapter 09 - How Do I Use Symbolic Characters?

Chapter 10 - How Do I Solve a Nonlinear Equation?

Helpful Videos

Using Basic Plot Functions (5:30) 

Assignment

Reading and Exercise Assignment: Chapters 1-10, 30

Test 1 syllabus: Chapters 1-16, 30. 

Assignment for Grade

Homework Affidavit Sheet

Assigned HW for grade Exercises from Chapter 5-9 Due Mon Sep 17 (Sec 001), Fri Sep 14 (Sec 002)


Week 3 September 14, 2012 and September 17, 2012

 

Lecture M files

Polynomial Interpolation: Chapter 11:

 [mfile] [mfile: Cell formatted] [Published Version]

 

Spline Interpolation: Chapter 11:

 [mfile] [mfile: Cell formatted] [Published Version]

 

Polynomial Regression: Chapter 12:

 [mfile] [mfile: Cell formatted] [Published Version]

 

Differentiating a Mathematical Expression: Chapter 13:

 [mfile] [mfile: Cell formatted] [Published Version]

 

Integrating a Mathematical Expression: Chapter 14:

 [mfile] [mfile: Cell formatted] [Published Version]

 

Solving an Ordinary Differential Equation: Chapter 15:

 [mfile] [mfile: Cell formatted] [Published Version]

 

Practice Online Quizzes (All Quizzes Link)

Assignment

Reading and Exercise Assignment: Chapters 1-15, 30

Test 1 syllabus: Chapters 1-16, 30. 

Assignment for Grade

Homework Affidavit Sheet

Assigned HW for grade: Exercises from Chapter 11-15 Due Mon Sept 24 (Sec 001), Fri Sept 21 (Sec 002):


Week 4 September 21, 2012 and September 24, 2012

Lecture Notes

Shrink-fit problem: (pdf)): Using the Concepts of Regression, Integration,  and Nonlinear Equation Solutions to Solve a Practical Engineering Problem (pdf | pptx).

Shrink-Fit Solution: [mfile] [mfile: Cell formatted] [Published Version]

 

In-class exercises

    How Low Can You Go? (pdf)

    Mind in Gutter (pdf)

    Parachute problem statement (pdf)

Assignment

No assigned homework for a grade

Study for test one (See syllabus for dates and rules)

      Test 1 syllabus: Chapters 1-16, 30. 

      Develop one-page handwritten (your own handwriting) help guide for the test

      Redo Homework 1, 2 and 3 (not for grade or re-grade)

      Sample Competency Test (pdf of test | pdf of published format)

Assignment for Grade

None


Week 5 September 28, 2012 and October 1, 2012

COMPETENCY TEST#1

 


Week 6 October 5, 2012 and October 8, 2012

Lecture Notes

Checking a Number if it is Non-negative or Negative using If-End Statement: Chapter 19:

[mfile] [mfile: Cell formatted] [Published Version]

 

Checking a Number if it is Non-negative or Negative using If-Else-End Statement: Chapter 19:

[mfile] [mfile: Cell formatted] [Published Version]

 

Checking a Number if it is Zero or Negative or Positive using If-End Statement: Chapter 19:

[mfile] [mfile: Cell formatted] [Published Version]

 

Checking a Number if it is an Integer or Decimal Number using If-End Statement: Chapter 19:

[mfile] [mfile: Cell formatted] [Published Version]

 

Checking a Number if it is an Integer or Decimal Number using If-Else-End Statement: Chapter 19:

[mfile] [mfile: Cell formatted] [Published Version]

 

Calculating BMI of Person and Recommending the Target Healthy Weight to the Person:

Example 4

[mfile] [mfile: Cell formatted] [Published Version]

A step-by-step problem statement

Assignment

Reading and Exercise Assignment: Chapters 18-20

Chapter 17 is voluntary but will make you a better programmer for the HWs and tests

Test 2 syllabus: Chapters 18-25. 

Assignment for Grade

Taxes! O Taxes! Problem: (due Oct 12 for Friday section; due Oct 15 for Monday section)


Week 7 October 12, 2012 and October 15, 2012

Lecture Notes

Chapter 21: Custom function to find the area & perimeter of a triangle [test mfile] [function mfile]

Chapter 21: Custom function to for the BMI calculator [test mfile] [function mfile]

Chapter 22 - Exercise 7: for-end loop to find average and standard deviation [mfile]

Print odd numbers only [mfile]

Loop applications: [mfile (to include Example 3 - Chapter 22 and extras)] 

Practice Online Quizzes (All Quizzes Link)

Chapter 21 - How Do I Use Functions?

Chapter 22 - How Do I Use For-End Loops?

Assignment

Reading and Exercise Assignment: Chapters 21-22

What to do if the published output cuts off at the right (BLOG)

Test 2 syllabus: Chapters 18-25. 

Assigned Homework for Grade: Principal Stresses Function and Testing (due Oct 19 for Friday section; due Oct 22 for Monday section).


Week 8 October 19, 2012 and October 22, 2012

Lecture Notes

Loop structure mfile (for-end and corresponding while-end

Chapter 23 - Example 2 and Extras: mfile (while-end loop)

Continue and break statement structure [mfile]
Continue and break statement applications [mfile]

Finding (approximate) the area under a curve [test mfile] [function]

Finding the approximate value of pi by random numbers [test mfile] [function]

Loop with break applications: Ch 24 - Exercise 5 and Ch 25 - Exercise 2

Practice Online Quizzes (All Quizzes Link)

Chapter 23 - How Do I Use While-Loops?

Chapter 24 - What are the Break and Continue Statements?

Chapter 25 - How Can Loops Work For Me?

Assignment

Reading and Exercise Assignment: Chapters 22-25

Test 2 syllabus: Chapters 18-25. 

Assigned Homework for Grade: Series Summation (due October 26 for Sec 002; due October 29 for Sec 001)

Study for Test 2 and build your one note sheet (8.5'' x 11'')


Week 9 October 26, 2012 and October 29, 2012

COMPETENCY TEST#2

 


Week 10 November 2, 2012 and November 5, 2012

Lecture Notes

Use of Vector - Chapter 26    

Basic Examples (displaying grades, generating a vector, min and max)

Vector in class exercises (dot product, Young's modulus)

Generating Random Lotto Numbers But Not Guaranteed to be Unique

Generating Random Lotto Numbers Guaranteed to be Unique (program does NOT work - loop variable updated)

Generating Random Lotto Numbers Guaranteed to be Unique (program does NOT work - loop variable updated)

Generating Random Lotto Numbers Guaranteed to be Unique (program does work)

 

Nested loops - Chapter 27  

Structure mfile with a few examples

Practice Online Quizzes

Chapter 26 - How Do I Use Vectors?

Chapter 27 - How Can I Sort a Vector?

Assignment

Reading and Exercise Assignment: Chapters 26-27

Test 3 syllabus: Chapters 26-29. 

Assigned homework for grade: Secant method (due Nov 9 for Section 002 and Nov 19 for Section 001)


Week 11 November 9, 2012 and November 19, 2012

Lecture Notes

Vector Sorting (bubble sort method) - Chapter 27  

       Refresher on Nested loops - adding two equal sized matrices

       Vector element movement techniques (using temp variable)

       Vector sorting techniques (bubble sort method)

Special Matrix Operations - Chapter 28  

       Finding the trace of a matrix

       Is an input matrix an identity matrix?

Practice Online Quizzes

Chapter 27 - How Can I Sort a Vector?

Chapter 28 - What are Some Special Types of Matrices?

Assignment

Reading and Exercise Assignment: Chapters 27-28

Test 3 syllabus: Chapters 26-29. 

Last Assigned Homework for Grade: Condition Number of a Matrix (due November 16 for Friday Section; due November 26 for Monday Section)


 Week 12 November 16, 2012

           Review Exercises

               Diagonally Dominant Matrix (Problem Statement | Rough Mfile)

               Symmetric Matrix (Problem Statement)

               Strictly Diagonally Dominant [Problem Statement]  [Rough Mfile]

               Diagonally Dominant [Problem Statement]   [Rough Mfile]


Week 13  and November 26, 2012 and November 30, 2012

 

Lecture Notes

Chapter 29 - Reading and writing to an external file

  Reading an external file - Example 1

       input file (txt)

       basic MATLAB program (mfile)     

  Reading an external file - Example 2

       input file (txt)

       for-end loop program (mfile)  

  Reading an external file - Example 3

       input file (txt)

       while-end loop program (mfile)  

  Example of reading an external file - Crushing of a soda can

     Finite element analysis PowerPoint

  Find the value of the maximum Von-Mises stress       

       input file (txt)

       while-end loop program (mfile)

  Find the maximum energy stored in the can with the corresponding time     

       input file (txt)

       while-end loop program (mfile)

Assignment

Reading and Exercise Assignment: Chapters 29

Test 3 syllabus: Chapters 26-29. 

Assigned Homework for Grade: NONE


Week 14  Dec 3, 2012 and December 7, 2012

COMPETENCY TEST #3


Week 15 FINAL EXAM WEEK

See syllabus for day and time as they are different than class meeting days and times.