EML3035: Programming Concepts for Mechanical Engineers

A one-credit hour course


Lectures & Assignments      Syllabus


LECTURES, HANDOUTS AND ASSIGNMENTS 

FALL 2013

Archived lectures


Week 1 August 26 and August 30, 2013

 

Handouts

Syllabus

Affidavit Sheet to be attached to every HW

Affidavit Sheet of attendance and pre-reqs (to be returned in next class)

Preview of Book: First few chapters and Chapter 30 - Go to CANVAS> Go to the EML3035 Course> Look Under Files

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)

  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. 

  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

Affidavit Sheet to be attached to every HW

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

Practice Online Quizzes (Quizzes Link for Whole Course)

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 or come out too small in print (BLOG)

Assignment for Grade

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

Attach Homework Affidavit Sheet to the HW

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


 

Week 2 September 6, 2013 and September 9, 2013

 

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

Do not forget the Homework Affidavit Sheet

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

Follow the same format as given at http://www.eng.usf.edu/~kaw/class/EML3035/homework/sample_homework.htm - Look under Sample HW for assignments for HW#2 and#3

 


Week 3 September 13, 2013 and September 16, 2013

 

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 23 (Sec 001), Fri Sept 20 (Sec 002):


Week 4 September 20, 2012 and September 23, 2013

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 27, 2013 and September 30, 2013

COMPETENCY TEST#1

See syllabus for what is allowed

Test 1 topics: 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)


Week 6 October 4, 2013 and October 7, 2013

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 11 for Friday section; due Oct 14 for Monday section)


 

Week 7 October 11, 2013 and October 14, 2013

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

Test 2 syllabus: Chapters 18-25. 

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


Week 8 October 18, 2013 and October 21, 2013

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 25 for Sec 002; due October 28 for Sec 001)

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

 


Week 9 October 25, 2013 and October 28, 2013

Competency Test 2


Week 10 November 1, 2013 and November 4, 2013

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)

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, 27, 29. 

Assigned homework for grade: Secant method (due Nov 8 for Section 002 and Nov 18 for Section 001)

 


Week 11 November 8, 2013 and November 18, 2013

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)

Practice Online Quizzes

Chapter 27 - How Can I Sort a Vector?

Assignment

Reading and Exercise Assignment: Chapters 27-28

Test 3 syllabus: Chapters 26, 27, 29. 

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


Week 13 November 15, 2013 and November 25, 2013

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, 27, 29. 

Assigned Homework for Grade: NONE


Week 14 November 22, 2013

Review.  No Quiz.  No HW Due.  Attendance is not compulsory.  Section 001 students are welcome if space is available.  You can even double up as there are additional chairs available.

 

Additional Exercises


Week 15 Dec 2, 2013 and December 6, 2013

COMPETENCY TEST #3

 

Additional Exercises can serve as practice for test3


Week 16 FINAL EXAM WEEK

See syllabus for format, day, time and location.  Final exams are different than class meeting days and times.