Presentation is loading. Please wait.

Presentation is loading. Please wait.

EGR 106 Intro to Engineering II Engineering problem solving using MATLAB Text: Amos Gilat, MATLAB An Introduction with Applications, Wiley 2004 ISBN 0-471-43997-5.

Similar presentations


Presentation on theme: "EGR 106 Intro to Engineering II Engineering problem solving using MATLAB Text: Amos Gilat, MATLAB An Introduction with Applications, Wiley 2004 ISBN 0-471-43997-5."— Presentation transcript:

1 EGR 106 Intro to Engineering II Engineering problem solving using MATLAB Text: Amos Gilat, MATLAB An Introduction with Applications, Wiley 2004 ISBN 0-471-43997-5

2 Instructor EGR 106 Section 7 Richard Brown, Department of Chemical Engineering, 110 Crawford Hall Office hours Tue-Thur 11 -12pm rbrown@egr.uri.edu 874-2707 (Office)

3 Grading Attendance15% IMPORTANT SIGN IN ALL CLASSES!!!! Homework15% 3 Quizzes40% Team project30%

4 Homework 15% of your grade No partial credit Done during lab. If you can not solve a problem, get help. 10 point scale for each assignment Late home work penalty is 2 points Not accepted after one week.

5 Engineering Computer Lab - ECL To use the ECL you will need the username and password provided to you by the College of Engineering when you started. If you cannot remember your username and password for access to ECL computers, stop by the HELP desk TODAY after class and request one be issued to you. You will need it for next Tuesdays class.

6 Computation What is computation? Examples:3 + 2 tan 40 o Computation = “transformation from one or more inputs to an output”

7 Computer Computation Very fast at arithmetic operations Large numbers of repetitive operations quickly Algorithms = computer programs –Need to understand what computations are “simple” for the computer –Need to write a clear set of directions to be followed –Build more complicated computations from intermediate ones

8 Algorithms Definition: “a set of directions for carrying out a computation in terms of other, simpler computations” “Simpler computations” = ones that we already know how to do

9 M ATLAB – What is it ? Name is from matrix laboratory - uses matrices or rows and columns of numbers. Powerful tool for –Computation and visualization of engineering and science mathematics –Communication of ideas –Programming: Built-in editor, debugger, and help Many predefined functions (grouped in toolboxes) Interpreted or compiled programs

10

11 The Command Window Command prompt >> Basic math operations are available: addition + subtraction – division / multiplication * exponentiation ^ “enter” key “executes” or “runs” or “invokes” the operation Operator precedence: PEMDAS 5 – 4 + 3 ^ 4 / ( 3 – 1 ) = ?

12 Arithmetic Operations Addition + 2+2 Subtraction-3-2 Multiplication*3*6 Right Division/7/3 Left Division\7\3 = 3/7 Exponentiation^2^3 = 8

13 Precedence Precedence is the order operations are preformed, remember PEMDAS (3^2) anything in parentheses is done first 5^2 exponentiation is next 2*2 or 10/5 multiplication or division next 1+1 or 5-3 addition or subtraction next Operations are done from left to right

14 Precedence Example 2^(6/2) = 2^3 = 8 2^6/2 = 64/2 = 32 Remember computer does what it is told rather than what you hope it should do.

15 Some Syntax Assignment operator = > x= 1; > x = 2*x+1; The value of x is 3 Remember when programming that assignment operators can be changed as a result of program actions, so be careful assigning constants.

16 Predefined Variables ans pi  eps2^(-52) about 2.22e-16 inf  isqrt(-1) jSame as i NaNNot a number 0/0

17 Some Functions Elementary Math, sqrt(x), exp(x), etc. Trig, sin(x), cos(x), x is in radians Rounding functions, round(x), etc

18 DIFFUSION What is diffusion? Transport of one atom, ion or molecule through a medium. Applications of Diffusion. Fuel Cells Drug Delivery Strengthening Metals. Structural Failure. Computer Manufacture. Polymer and paint breakdown. Separations

19 FUEL CELL Proton Exchange Membrane (PEM Cell) Proton Diffusion 2H + O  H 0 + 2-2- 2 Diffusion controls start up time and current produced

20 Demonstrations Matlab has a number of demonstration programs. Often helpful to run then and also examine the programs – shown in command window. May provide some programming tips!!!


Download ppt "EGR 106 Intro to Engineering II Engineering problem solving using MATLAB Text: Amos Gilat, MATLAB An Introduction with Applications, Wiley 2004 ISBN 0-471-43997-5."

Similar presentations


Ads by Google