MECE 102: Engineering Mechanics Lab A First Year Course in Newtonian Mechanics, Experimentation, and Computer Tools Created by the Faculty of the Mechanical.

Slides:



Advertisements
Similar presentations
Numerical Solution of Linear Equations
Advertisements

Chapter 1: Number Patterns 1.3: Arithmetic Sequences
SECTION 2-3. Objectives 1. Distinguish between accuracy and precision 2. Determine the number of significant figures in measurements 3. Perform mathematical.
INTRODUCTION TO PROGRAMMING
Chapter 1 Computing Tools Data Representation, Accuracy and Precision Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
Error Measurement and Iterative Methods
CVEN Computer Applications in Engineering and Construction Dr. Jun Zhang.
Part 3 Truncation Errors.
Dr. Jie Zou PHY Chapter 9 Ordinary Differential Equations: Initial-Value Problems Lecture (II) 1 1 Besides the main textbook, also see Ref.: “Applied.
ENGG 1801 Engineering Computing MATLAB Lecture 7: Tutorial Weeks Solution of nonlinear algebraic equations (II)
Lecture 12 Another loop for repetition The while loop construct © 2007 Daniel Valentine. All rights reserved. Published by Elsevier.
 2003 Prentice Hall, Inc. All rights reserved. 1 Chapter 3 - Functions Outline 3.12Recursion 3.13Example Using Recursion: The Fibonacci Series 3.14Recursion.
Open Methods Chapter 6 The Islamic University of Gaza
Describing Syntax and Semantics
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM.
For a geometric sequence, , for every positive integer k.
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
Introduction and Analysis of Error Pertemuan 1
Sequences Informally, a sequence is a set of elements written in a row. – This concept is represented in CS using one- dimensional arrays The goal of mathematics.
Taylor Series & Error. Series and Iterative methods Any series ∑ x n can be turned into an iterative method by considering the sequence of partial sums.
Lecture 2 Number Representation and accuracy
CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4: KFUPM CISE301_Topic1.
CISE301_Topic11 CISE-301: Numerical Methods Topic 1: Introduction to Numerical Methods and Taylor Series Lectures 1-4:
LECTURE 19 THURSDAY, 14 April STA 291 Spring
An Introduction to Programming and Algorithms. Course Objectives A basic understanding of engineering problem solving process. A basic understanding of.
ME 142 Engineering Computation I Computer Precision & Round-Off Error.
MECE 102 Engineering Mechanics Lab A First Year Course in Newtonian Mechanics, Experimentation, and Computer Tools Created by the Faculty of the Mechanical.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
Objectives Distinguish between accuracy and precision. Determine the number of significant figures in measurements. Perform mathematical operations involving.
Algorithms and Algorithm Analysis The “fun” stuff.
CS 140 Computer Programming (I) Second semester (3 credits) Imam Mohammad bin Saud Islamic University College of Computer Science and Information.
MECN 3500 Inter - Bayamon Lecture 3 Numerical Methods for Engineering MECN 3500 Professor: Dr. Omar E. Meza Castillo
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
CSE 3802 / ECE 3431 Numerical Methods in Scientific Computation
MECE 102 Engineering Mechanics Lab A First Year Course in Newtonian Mechanics, Experimentation, and Computer Tools Created by the Faculty of the Mechanical.
Chapter 2: General Problem Solving Concepts
Colorado Center for Astrodynamics Research The University of Colorado 1 STATISTICAL ORBIT DETERMINATION ASEN 5070 LECTURE 11 9/16,18/09.
Numerical Methods for Engineering MECN 3500
CC112 Structured Programming Lecture 1 1 Arab Academy for Science and Technology and Maritime Transport College of Engineering and Technology Computer.
Slide 1 of 48 Measurements and Their Uncertainty
Preview Lesson Starter Objectives Accuracy and Precision Significant Figures Scientific Notation Using Sample Problems Direct Proportions Inverse Proportions.
Textbook C for Scientists and Engineers © Prentice Hall 1997 Available at NUS CO-OP at S$35.10.
Topic: Control Statements. Recap of Sequence Control Structure Write a program that accepts the basic salary and allowance amount for an employee and.
MECE 102 Engineering Mechanics Lab A First Year Course in Newtonian Mechanics, Experimentation, and Computer Tools Created by the Faculty of the Mechanical.
Spring 2006CISC101 - Prof. McLeod1 Announcements Assn 4 is posted. Note that due date is the 12 th (Monday) at 7pm. (Last assignment!) Final Exam on June.
MECE 102: Engineering Mechanics Lab A First Year Course in Newtonian Mechanics, Experimentation, and Computer Tools Created by the Faculty of the Mechanical.
MECE 102 Engineering Mechanics Lab A First Year Course in Newtonian Mechanics, Experimentation, and Computer Tools Created by the Faculty of the Mechanical.
MECE 102 Engineering Mechanics Lab A First Year Course in Newtonian Mechanics, Experimentation, and Computer Tools Created by the Faculty of the Mechanical.
Created by the Faculty of the Mechanical Engineering Department in the Kate Gleason College of Engineering at RIT MECE 102: Engineering Mechanics Lab A.
MECE 102: Engineering Mechanics Lab A First Year Course in Newtonian Mechanics, Experimentation, and Computer Tools Created by the Faculty of the Mechanical.
Dr. Wang Xingbo QQ: Homepage: wxbstudio.home4u.china.com Fall , 2005 Mathematical & Mechanical Method in Mechanical.
Program Program is a collection of instructions that will perform some task.
Numerical Methods and Optimization C o u r s e 1 By Bharat R Chaudhari.
2008/09/22: Lecture 6 CMSC 104, Section 0101 John Y. Park
CS1001 Programming Fundamentals 3(3-0) Lecture 2
CHAPTER 5A Loop Structure
Chapter 2 ERROR ANALYSIS
MECE 102: Engineering Mechanics Lab A First Year Course in Newtonian Mechanics, Experimentation, and Computer Tools Created by the Faculty of the Mechanical.
MECE 109: Computer Tools A First Year Course in Newtonian Mechanics, Experimentation, and Computer Tools Created by the Faculty of the Mechanical Engineering.
Data Structures (CS212D) Overview & Review.
Outline Altering flow of control Boolean expressions
ENGG 1801 Engineering Computing
Data Structures (CS212D) Overview & Review.
Programming Fundamentals (750113) Ch1. Problem Solving
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Programming Fundamentals (750113) Ch1. Problem Solving
CHAPTER Five: Collection & Analysis of Rate Data
Basic Concepts of Algorithm
Newton-Raphson Method
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Presentation transcript:

MECE 102: Engineering Mechanics Lab A First Year Course in Newtonian Mechanics, Experimentation, and Computer Tools Created by the Faculty of the Mechanical Engineering Department in the Kate Gleason College of Engineering at RIT

Week 13 Lecture Programming Skills This week we will: Investigate programming Loops utilizing For Loops  Iterated Loop While Loop  Conditional Loop Use Matlab and LabView to program an algorithm to calculate sin 

iCLICKER: Which of the following concepts is NOT relevant to utilize for this week’s Programming activities? Select your Answer: A.Recursion B.Algorithm C.Newton’s 2 nd Law D.Flow Chart E.None of the above

iCLICKER: Which of the following concepts is NOT relevant to utilize for this week’s Programming activities? Select your Answer: A.Recursion B.Algorithm C.Newton’s 2 nd Law D.Flow Chart E.None of the above

ASSUME: Problem A: Calculus description of sine function Recall from Calculus: Our goal is to write code that approximates the sine function:

FORMULATE: Problem A: State the Known and Desired Information Approximate sin  by using a known finite number of terms, N.

CHART: Problem A: Flow Chart of Finite Sum Algorithm

This block defines variables and initializes values.

CHART: Problem A: Flow Chart of Finite Sum Algorithm This block defines variables and initializes values. Finite number of Loops set “a priori”

CHART: Problem A: Flow Chart of Finite Sum Algorithm This block defines the FOR iterated loop and sine equation

CHART: Problem A: Flow Chart of Finite Sum Algorithm CONDITIONAL evaluation of Loop

EXECUTE: Problem A: Calculating the Finite Sum employing Recursion The calculation of the sine equation can be expanded as: Where each term can be written as T i

EXECUTE: Problem A: Calculating the Finite Sum employing Recursion Starting at i = 0, the first 6 terms can be written as: Use of Recursive relationship to calculate terms

EXECUTE: Problem A: Calculating the Finite Sum employing Recursion Using the concept of a Recursive relationship, we can efficiently write each new term, T i, as a function of the preceding term, T i-1 :

EXECUTE: Problem A: Matlab FOR loop example code The following code are examples of utilizing a FOR loop: for i from start to stop do body of program end_for for i from start to stop step stepwidth do body of program end_for

FORMULATE: Problem B: State the Known and Desired Information Approximate sin  by using a convergence criteria of relative error.

iCLICKER: The value of acceptable error, , is NOT dependent on the limit of the computer system analyzing the program. Select your Answer: A.True B.False

iCLICKER: The value of acceptable error, , is NOT dependent on the limit of the computer system analyzing the program. Select your Answer: A.True B.False The value of the acceptable error, , should be chosen to be small enough for engineering accuracy, however large enough to avoid issues with the computer accuracy limit.

ASSUME: Problem B: Identify the Convergence Criteria Relationship The WHILE loop will terminate once the relative error is less than some acceptable error limit, . This is known as the convergence criteria of relative error.

Conversion accuracy issue ….. Convert [ ] base 2 to a base 10 number ….

Conversion accuracy issue ….. Convert [39] base 10 to a base 2 number ….

Conversion accuracy issue ….. Convert [39.9] base 10 to a base 2 number ….

iCLICKER: Approximately how many significant digits of accuracy are associated with a 64 bit computer? Select your Answer: A.~ 2 significant digits B.~ 7 significant digits C.~14 significant digits D.~ 21 significant digits

iCLICKER: Approximately how many significant digits of accuracy are associated with a 64 bit computer? Select your Answer: A.~ 2 significant digits B.~ 7 significant digits C.~14 significant digits D.~ 21 significant digits

CHART: Problem B: Flow Chart of Conditional Sum Algorithm

This block defines variables and initializes values.

CHART: Problem B: Flow Chart of Conditional Sum Algorithm This block defines variables and initializes values. Acceptable error defined “a priori”

CHART: Problem B: Flow Chart of Conditional Sum Algorithm This block defines the WHILE loop and sine equation

CHART: Problem B: Flow Chart of Conditional Sum Algorithm CONDITIONAL evaluation of Loop

EXECUTE: Problem B: Relative Error For an alternating series summation, we can estimate the error, e, between successive terms as the magnitude of the last term in the sequence.

EXECUTE: Problem B: Matlab WHILE loop example code The following code are examples of utilizing a WHILE loop: while condition do body of program end_while This loop evaluates its body while a specified condition is TRUE.

LabVIEW Video

Homework Uniform Circular Motion Lab Report due tonight! Prior to LAB tomorrow Read section 13.2 of the textbook Watch LAB Videos Complete the on-line LAB quiz in myCourses Attempt to solve Homework problem 13.1 in your logbook before RECITATION. This is a Programming extension of the work in Chapter 13 Include in your Logbook your algorithmic Flow Chart, Computer program code, and an example of your Output.