[email protected] ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE...

28
[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical & Mechanical Engineer [email protected] Engr/Math/Physics 25 Applied Math Problem Solving

Transcript of [email protected] ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE...

Page 1: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt1

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Bruce Mayer, PELicensed Electrical & Mechanical Engineer

[email protected]

Engr/Math/Physics 25

Applied MathProblem Solving

Page 2: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt2

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

First A Note on Cheap Software

All ENGR25 Students have No-Charge Access to MATLAB software in the Rm3906 CompSci Lab

For Students who want Home-Access, the MathWorks Company Makes Available an Inexpensive MATLAB Version for Student use

Student Version Cost = $99.98 (+ Shipping)

Page 3: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt3

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Info

Fro

m M

athW

orks

Page 4: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt4

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Page 5: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt5

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Strategy for Learning ENGR25

ENGR25 is, primarily, an Engineering PROBLEM SOLVING Class• With a Very Large SOFTWARE (MATLAB

& Excel) Component

The BEST Way to Learn ANY Piece of Software (and most Hardware):

Page 6: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt6

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Refined Learning Strategy

1. HACK, HACK, and HACK some more

2. Read The TEXTbook §-by-§

3. When you come to a NEW software Command/Tool, TRY it IMMEDIATELY

4. Consult MATLAB Help• It’s Quite Useful Actually

5. Consult with your Colleagues

Page 7: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt7

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

ENGR25 Important??!!

This Class is NOT an Academic Exercise

The PROBLEM SOLVING SKILLS and MATLAB APPLICATION PROFICIENCY are PROFESSIONALLY IMPORTANT• That is, an Engineering STUDENT who

LEARNS these Skills we be able to USE them ON THE JOB as a PRACTICING ENGINEER

Page 8: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt8

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Pro

blem

So

lving

Page 9: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt9

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Academic Honesty - Coding Students may collaborate on understanding

lectures, labs, text, problem-statements. Students may discuss the DESIGN of a

program. All Students must then write his/her OWN MATLAB® code

Students may get help from Fellow students while writing your programs only by:• Asking them to POINT OUT an error,

but NOT to FIX it • Asking Them to EXPLAIN MATLAB syntax Using

a DIFFERENT example than the program under consideration

Page 10: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt10

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Copy HW Code Crash&Burn Exams

0%

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%

110%

3390

2736

4795

3599

8247

3374

5407

8872

8297

0810

3187

2257

2188

0466

6829

8906

9273

0309

7511

7224

8116

8235

0606

1334

5393

Student W-No.

HW

or

MT

E S

co

re

HW MTE

Grades_E25_Fa0909_091021.xls

HW Cheaters

Page 11: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt11

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Copy Code??!!

Trying to Learn COMPUTER PROBLEM SOLVING by Copying SOMEONE ELSE’S CODE is like trying to get into athletic-condition by Watching SOMEONE ELSE WORK OUT…..

There is NO Substitute for Personally STRUGGLING with the Course Material

☺☺☺

Page 12: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt12

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

ENGR25 Bottom Line

ENGR25 is NOT (only) a MATLAB/Excel class; it's a THINKING Class...

Student should be Prepared to do LOTS of (often Frustrating) THINKING

Page 13: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt13

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

AppMath Problem Solving Steps

1. Understand the PURPOSE of the problem.

2. Collect the KNOWN information. • Realize that some of the information

might later be found UNNECESSARY.

3. Determine what information YOU must find.

4. SIMPLIFY the problem only enough to obtain the required information. State any ASSUMPTIONS you make.

Page 14: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt14

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Assumption Digression

BMayer 2001 JVST Paper• See

ENGR45 for More Details

Page 15: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt15

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Assumption Digression

PARTIAL Assumption List• 100% Vapor Saturation at Bubble Edge• Gases in bubble behave as perfect gases• Bubbles are Spherical

– Radial Symmetry

• Diffusion Coefficient is Constant

Page 16: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt16

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Problem Solving Steps cont

5. DRAW A SKETCH and label any necessary variables.

6. Determine which FUNDAMENTAL PRINCIPLES apply to the problem.

7. Think GENERALLY about your PROPOSED SOLUTION approach and CONSIDER OTHER APPROACHES before proceeding with the details.

Page 17: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt17

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Problem Solving Steps cont

8. LABEL each STEP in the solution process.

9. If you solve the problem with a software program, HAND CHECK the results using a simple version of the problem.

• Checking the DIMENSIONS and UNITS and printing the results of intermediate steps in the calculation sequence can uncover mistakes.

Page 18: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt18

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Problem Solving Steps cont

10.Perform a “reality check” on your answer. Does it make sense? Estimate the range of the expected result and compare it with your answer. Do not state the answer with greater precision than is justified by any of the following:

a) The precision of the given information.b) The simplifying assumptions.c) The requirements of the problem.

Page 19: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt19

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Interpret the Mathematics

If the mathematics produces multiple answers, do not discard any of them without considering what they mean.

The mathematics might be trying to tell you something, and you might miss an opportunity to discover more about the problem.

Page 20: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt20

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Computer Solution Steps

1. State the problem CONCISELY.

2. Specify the data to be used by the program. This is the “INPUT.”

3. Specify the information to be generated by the program. This is the “OUTPUT.”

4. Work through the solution steps by HAND or with a CALCULATOR; use a SIMPLER set of data if necessary.

Page 21: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt21

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

Computer Solution Steps cont

5. Write and run the program.6. Check the output of the program by

comparing with your hand solution.7. Run the program with your input data

and perform a REALITY CHECK on the output.

8. If you will use the program as a general tool in the future, test it by running it for a RANGE of reasonable data values; perform a reality check on the wide-ranging results.

Page 22: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt22

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

MATLAB History

MATLAB = MATrix LABoratory Developed by Prof. Cleve Moler of New

Mexico State University Originally a user interface for numerical

Linear Algebra (LinPack) or EigenValue Problems (EisPack)

In early 1983, John Little was exposed to MATLAB During a visit made to Prof. Moler Made to Stanford University

Page 23: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt23

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

MATLAB History

In 1983 Little teamed up with Moler and Steve Bangert to develop a second generation, professional version of MATLAB written in C and integrated with graphics.

The MathWorks, Inc. was founded in 1984 to market and continue development of MATLAB• It has become a de-facto standard for PC-

Based Hi-Perf “Math Processors”

Page 24: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt24

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

MATLAB Construction Core functionality: compiled C-routines Most functionality is given as Stored “m”

files, grouped into “ToolBoxes” m-files contain source code, can be

copied and altered m-files are platform independent

(Windows/Intel, Unix/Linux, MAC) Simulation of dynamic systems is

performed in the SIMULINK SubEnvironment ToolBox

Page 26: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt26

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

First ENGR25 Tutorial

MATLAB Video Tutorials• http://www.mathworks.com/academia/stude

nt_center/tutorials/launchpad.html– http://www.mathworks.com/videos/matlab/

getting-started-with-matlab.html (6 min)– http://www.mathworks.com/videos/matlab/writin

g-a-matlab-program.html (6 min)

– http://www.mathworks.com/videos/matlab/using-basic-plotting-functions.html (6 min)

– http://www.mathworks.com/videos/matlab/creating-a-basic-plot-interactively.html (6 min)

Page 27: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt27

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

First ENGR25 Tutorial– Additional Videos Useful in the future

http://www.mathworks.com/videos/matlab/importing-data-from-files.html (HW5, 7min)

http://www.mathworks.com/products/simulink/demos.html?BB=1 (Chp9, http://www.mathworks.com/videos/simulink/getting-started-with-s

imulink.html (4 min)

http://www.mathworks.com/videos/simulink/visualizing-simulation-results.html (4 min)

HW Presentation Save MATLAB work to MSWord file• Trapezoid area, 3x3 Eqn System, cosh

calculation, plot y = ln(t+.02)·sin(1.3t)

Page 28: BMayer@ChabotCollege.edu ENGR-25_MATLAB_AppMath_ProbSolve.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed.

[email protected] • ENGR-25_MATLAB_AppMath_ProbSolve.ppt28

Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods

3x3 from ENGR43

For The DC Linear Circuits We Will need to Solve Systems Of Algebraic Equations

20642

0164

84912

321

321

321

VVV

VVV

VVV2.2 kΩ 1.2 kΩ1.5 kΩ

2.7 kΩ

1.8 kΩ

R1

R2 R3Rx

RL13V

7 mA

I1

I2 I3

IL