introduction to engineering computing geen 1300 elizabeth white [email protected] office...

39
Introduction to Engineering Computing GEEN 1300 Elizabeth White [email protected] Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and by appointment; please send email.

Upload: jean-miles

Post on 29-Dec-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Introduction to Engineering ComputingGEEN 1300

Elizabeth [email protected]

Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm,and by appointment; please send email.

Page 2: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Introduction to Engineering ComputingGEEN 1300

• why• solving problems that are hard or even impossible to do by

hand• graphing data• writing computer programs that perform large,

complicated tasks• ……..

Page 3: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Introduction to Engineering ComputingGEEN 1300

• what

~12 lectures~13 lectures

Page 4: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Class Meetings MATH 100 MW 8:00-8:50

Texts:• R. Larsen, Engineering with Excel, Third Edition, Pearson

Prentice Hall, 2009 • H. Moore, Matlab for Engineers, Second Edition, Pearson

Prentice Hall, 2009 • Readings for each week are posted on the CULearn calendar

Other Materials on class web page:http://csel.cs.colorado.edu/~ekwhite/

GEEN1300_Summer2010.html

Page 5: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

20% Labs7.5% Prelabs (online)

7.5% Homework10% Class participation15% Project20% Midterm (in class)

20% Final (Friday, 2 July, 8-10:30am)

Grading

Page 6: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Labs

• Are the real meat of this course• Where you learn by doing, not just hearing or

reading• Start THIS week (beginning Thursday at 8am)• Happen in ECCH 107 • Are due at the end of the lab period – if you arrive

late, you may not finish…

• Bring a USB drive and the textbook

Page 7: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Lab Grade Policy

• Make-up labs after the fact only for medical or family emergencies.

• In some cases, make-up labs may be arranged with the instructor, but you must do so at least one weeks before the beginning of the recitation period

• Labs CANNOT be done at home and then turned in. Labs also CANNOT be emailed in from home. (But you can certainly work them in advance, then come in.)

Page 8: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Online prelabs

• Posted on web page• Based on the reading, labs, class info• Make sure you’re caught up on the reading before you

start them• To be done by yourself (but you may use the textbook,

the web, your course notes, etc.)• Due by 8am on Thursdays of lab weeks

Page 9: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Project

• Provide a more-substantial experience with a bigger problem

• …and an opportunity to deepen your programming skills

• Selected from a list of candidates (some from each engineering field)

• Due during the last week of classes

Page 10: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Homework

• Where you learn offline, at your own pace

• Are posted on webpage, along with textbook readings

• Are due at the beginning of lecture, typically on mondays, in manila folders outside this room

• Late HW is not accepted

• Solutions posted on web page after it’s turned in

Page 11: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Midterm

• In class TBD (I’ll know by Thursday)

• Coverage: Excel & VBA

• Tests whether you know what these tools do, how they work, and how to use them to solve engineering problems

• Cheat sheet allowed

Page 12: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Final Exam

• 8:00-10:30am on 2 July (Friday)• Look at your exam schedule NOW:registrar.colorado.edu/Calendar/calendars_schedules.html

• Covers whole course • Targets my learning goals:

Page 13: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Learning goals:

• Know what’s in your computational toolbox …and how/when to use it

• Develop the resourcefulness to learn about other tools

• Know the basics of computer programming

Page 14: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Academic Ethics

• All incidents of academic dishonesty will result in academic sanctions

• In addition, the Honor Code Council will be notified and a non-academic sanction can be issued by them

• For example, if two identical labs are turned in, that is considered cheating, and for both people

• That has implications for leaving your files on lab computers!

• But collaboration is not always cheating• If you have any questions about cheating, ASK!

Page 15: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Overview of Excel coverage in GEEN 1300

learning skills for efficient use of the software

understanding spreadsheet layout and operations

how to set up the solution of typical engineering problems

learning VBA: the missing link for most users

developing user interfaces and other enhancements

Page 16: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Familiarity with Excel…

(a) don’t know what it is

(b) know vaguely what it is

(c) have seen an Excel spreadsheet at least once

(d) have actually used Excel to create a spreadsheet

(e) have used Excel extensively (i.e., beyond simple spreadsheets)

Page 17: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Syntax for Excel formulas

formulas must start with =, + or - ( leftover from 1-2-3)

expressions are evaluated left-to-right

precedence for arithmetic operators is:negation unary –exponentiation ^multiplication & division * and /addition & subtraction + and -

Page 18: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Examples…

Negation – unary minus

algebraic format Excel syntax

23 -3^2

Result

9 or –9 ???

2yx =x^y^2 =x^(y^2)? =(x^y)^2?

Repeated exponentiation

algebraic format Excel syntax

[test it if you’re not sure!]

[What do you really want to have happen?]

Page 19: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Syntax for Excel formulas

formulas must start with =, + or - ( leftover from 1-2-3)

expressions are evaluated left-to-right

precedence for arithmetic operators is:negation unary –exponentiation ^multiplication & division * and /addition & subtraction + and -

Page 20: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

More examples

algebraic format Excel syntax

2D

4L

=pi()*D^2/(4*L)

or =pi()*D^2/4/L

L

H L

T T

a T T

=(T-TL)/a*(TH-TL)

or =(T-TL)/(a*(TH-TL))

or =(T-TL)/a/(TH-TL)

Page 21: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Which will give you an answer of -9?

a) =-(3^2)

b) -(3^2)

c) =-3^2

d) (a) and (b)

e) (a) and (c)negation unary –exponentiation ^multiplication & division * and /addition & subtraction + and -

Page 22: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Syntax for Excel formulas

formulas must start with =, + or - ( leftover from 1-2-3)

expressions are evaluated left-to-right

precedence for arithmetic operators is:negation unary –exponentiation ^multiplication & division * and /addition & subtraction + and -

Page 23: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

How do you write this formula in Excel?

a) =F*L^3/(3*E*I)

b) = F*L^3/3/E/I

c) = F*L^3/3*E*I

d) (a) or (b)

e) None of these

3F L

3 E I

3b dI

12

The formula for the deflection of a cantilever beam is:

Page 24: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

How do you write this formula in Excel?

3F L

3 E I

3b dI

12

The formula for the deflection of a cantilever beam is:

Avoid this decoding issue by using parens!!

a) =F*L^3/(3*E*I)

b) = F*L^3/3/E/I

c) = F*L^3/3*E*I

d) (a) or (b)

e) None of these

Page 25: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Examples

algebraic format Excel syntax

2h 3R h

3

=PI()*h^2(3*Radius-h)/3

What’s wrong with this?

forgot the * operator

sin 45 =SIN(45)

What’s wrong with this?

=SIN(45/180*PI())

arguments to trig functionsmust be in radians

or =SIN(radian(45))

Page 26: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Examples

Logarithms and exponents Remember!

ln y x xy e exp x

10

Blog P A

T C

BA

T CP 10

a

ln xlog x

ln a

LN(y) EXP(X)

LOG10(P) 10^(A-B/(T+C))

=LN(x)/LN(a)

=LOG(x,a)

Page 27: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Syntax for Excel formulas

formulas must start with =, + or - ( leftover from 1-2-3)

expressions are evaluated left-to-right

parentheses are used to establish order for calculations

precedence for arithmetic operators is:negation unary –exponentiation ^multiplication & division * and /addition & subtraction + and -

functions are evaluated first and the result is insertedat the position of the function in the expression

Page 28: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Another example

algebraic format Excel syntax

2

y 2 x 2

x xy y

=(y+2)*(x-2)/(x^2+x*y+SQRT(y))

Order of evaluation:

1) put y into SQRT function, return answer to that position2) compute y+2 result3) compute x-2 result4) multiply y+2 result times x-2 result to get numerator result5) compute x^2 result6) compute x*y result7) add up x^2, x*y and SQRT(y) to get denominator result8) divide numerator result by denominator result

Page 29: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

How to enter cell addresses in a formula?

How do you enter those cell references? How do you enter a range of cells?

By typing or by clicking (and dragging, if it’s a range like b1:b4)

p.s. see the “Insert Function” button on the Formulas tab for a list of Excel’s functions – or use the help docs.

Example: =b1+b2+b3+b4 or =sum(b1,b2,b3,b4) or =sum(b1:b4)

Page 30: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Cell names

• Default name: column letter followed by row number

• You can give cells other names via the “Name Box”

• And then use those names (instead of “B1” et al.) in your formulas

• Some names are reserved – watch out!• You can name a bunch of cells at once using

“Create from Selection” on the “Formulas” tab

Page 31: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

“Filling” Cells

• Via the fill handle

• Works for formulas too!!

Page 32: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

32

Engineering calculations in Excel

Deflection of cantilever beam

d

bL

F

3F L

3 E I

3b dI

12

E modulus of elasticity I moment of inertia

Page 33: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

33

Deflection of cantilever beam

Basic data: F = 100 N L = 3 ft

E = 3 x 107 psi

b = 1 in d = 2 in

Find in mm

Page 34: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

34

Deflection of cantilever beamFind in mm

Don’t forget your name!

Page 35: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

35

Deflection of cantilever beamFind in mm

Page 36: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

36

Deflection of cantilever beam

Case studies:

• How does change as L varies?• How does change as d varies?• How does change as b and d vary?

Lots of ways to do the one-variable case studies…

Page 37: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

37

Using formula copy:

Single formula with only oneparameter changing

Range of parameter valuesin adjacent column

Page 38: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

38

Another example:

Set up example forcase study of f(x) vs x

x

f x1 ln x

Case study bycopying formula

range B2:B11named x

Page 39: Introduction to Engineering Computing GEEN 1300 Elizabeth White elizabeth.white@colorado.edu Office Hours: Tues 11am-12:30pm, Thurs 11am-12:30 pm, and

Enrollment

• Only 35 (40?) people can enroll in GEEN 1300:• We cannot add people over those limits, nor can we add new

sections. Computers are the limiting factor.• If you’re in, don’t move sections; if you do, the registration

computer will instantly give away your spot, leaving you in limbo.

• If you’re not in, but you’re #1 on the waitlist, you may get in, but you should make backup plans. Come to lab in the meantime.

• If you’re further down the waitlist, you may wait & see if you get in, but you should really make plans to take this course later (e.g., in the fall) and/or explore other options (e.g., CSCI1300)

• June 2 is the last day to drop without charge; June 4 is the last easy day to drop; June 14 is the last day without petitioning the Dean, per http://www.colorado.edu/summersession/calendar/index.html