August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

21
August 22, 2005 August 22, 2005 Lecture 1 - By P. Lin Lecture 1 - By P. Lin 1 CPET 190 CPET 190 Lecture 1 Lecture 1 Problem Solving with Problem Solving with MATLAB MATLAB http://www.etcs.ipfw.edu/~lin http://www.etcs.ipfw.edu/~lin

Transcript of August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

Page 1: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 11

CPET 190CPET 190

Lecture 1Lecture 1

Problem Solving with Problem Solving with MATLABMATLAB

http://www.etcs.ipfw.edu/~linhttp://www.etcs.ipfw.edu/~lin

Page 2: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 22

Lecture 1: IntroductionLecture 1: Introduction Introduction – Objectives of the Course Introduction – Objectives of the Course

• Course Syllabus and Class ObjectivesCourse Syllabus and Class Objectives Problem SolvingProblem Solving

• What is a Problem & Problem SolvingWhat is a Problem & Problem Solving• Why Teach Problem Solving Why Teach Problem Solving • Types of ProblemsTypes of Problems• Collaborative, Team-Based Problem SolvingCollaborative, Team-Based Problem Solving

Problem Solving with a ComputerProblem Solving with a Computer• Define the problemDefine the problem• Formulate a mathematical modelFormulate a mathematical model• Develop an algorithmDevelop an algorithm• Write the codes for the problemWrite the codes for the problem• Test program and verify the solutionTest program and verify the solution• Document the program and solutionDocument the program and solution

Page 3: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 33

Lecture 1: IntroductionLecture 1: Introduction (continue)(continue)

Introduction to MATLABIntroduction to MATLAB• What is MATLABWhat is MATLAB• The Advantages of MATLABThe Advantages of MATLAB• Disadvantages of MATLABDisadvantages of MATLAB• The MATLAB EnvironmentThe MATLAB Environment• A Sample MATLAB SessionA Sample MATLAB Session• Example 1: Calculate I = watt/voltExample 1: Calculate I = watt/volt• Example 2: Calculate the area of a circle with a Example 2: Calculate the area of a circle with a

radius of 0.001 inch (radius of 0.001 inch (ππ r2). r2).• Example 3: Sum of 12 numbers with continue Example 3: Sum of 12 numbers with continue

statement on successive lines by typing an statement on successive lines by typing an ellipsis (…) at the end of the first lineellipsis (…) at the end of the first line

Page 4: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 44

Syllabus Syllabus

WebCT: WebCT: http://webct.ipfw.edu/http://webct.ipfw.edu/ Web Site: Web Site:

http://www.etcs.ipfw.edu/~linhttp://www.etcs.ipfw.edu/~lin Email: [email protected]: [email protected] Test DateTest Date GradingGrading

Page 5: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 55

Course OutcomesCourse Outcomes

1.1. Knowledge and skills of using MATLAB as a practical, Knowledge and skills of using MATLAB as a practical, technical problem solving tools (Criterion 2, Item a)technical problem solving tools (Criterion 2, Item a)

2.2. An ability to apply problem solving sills in mathematics An ability to apply problem solving sills in mathematics and engineering technology problems (Criterion 2, Item b)and engineering technology problems (Criterion 2, Item b)

3.3. An ability to discuss ways and means of analyzing An ability to discuss ways and means of analyzing technical data (Criterion 2, Item c)technical data (Criterion 2, Item c)

4.4. An ability to practice technical problem solving process An ability to practice technical problem solving process including problem formulation, understand the problem, including problem formulation, understand the problem, problem analysis, collect data, model development, problem analysis, collect data, model development, algorithm development, solution implementation, solution algorithm development, solution implementation, solution verification, and report/presentation (Criterion 2, Items c, verification, and report/presentation (Criterion 2, Items c, d, f, g)d, f, g)

5.5. Understanding of professional and ethical responsibility Understanding of professional and ethical responsibility (Criterion 2, Item i, j)(Criterion 2, Item i, j)

6.6. Understanding of the contemporary engineering Understanding of the contemporary engineering technology application issues (Criterion 2, Item k)technology application issues (Criterion 2, Item k)

Page 6: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 66

Text Book & ReferencesText Book & References Text bookText book::

• MATLLAB Programming for Engineers, newest Edition, by Stephen MATLLAB Programming for Engineers, newest Edition, by Stephen J. Chapman, 3J. Chapman, 3rdrd., from Brooks/Cole Thomson Learning, ., from Brooks/Cole Thomson Learning, http://http://info.brrokscole.com/chapmaninfo.brrokscole.com/chapman

Computer, Software, Internet ConnectionComputer, Software, Internet Connection::• MATLAB Student Version with SIMULINK, available for purchase MATLAB Student Version with SIMULINK, available for purchase

from The MathWorks, Inc., http://mathworks.comfrom The MathWorks, Inc., http://mathworks.com• Off campus students are required to have their own PCs, and Off campus students are required to have their own PCs, and

install Student version of MATLAB and SIMULINK.install Student version of MATLAB and SIMULINK.• Internet connection from home, IPFW, or work is required. Internet connection from home, IPFW, or work is required.

ReferencesReferences• Math Problem Solving, John Hopkins University, Math Problem Solving, John Hopkins University,

http://cty.jhu.edu/math/solving/http://cty.jhu.edu/math/solving/• Mathworks MATLAB Examples, Mathworks MATLAB Examples,

http://www.mathworks.com/access/helpdesk/help/techdoc/matlabhttp://www.mathworks.com/access/helpdesk/help/techdoc/matlab.shtml.shtml

• MATLAB Basics - MATLAB Basics - http://www.maths.uq.edu.au/~mrb/tutors/matlabbasics.htmlhttp://www.maths.uq.edu.au/~mrb/tutors/matlabbasics.html

• MATLAB Basic Tutorial, MATLAB Basic Tutorial, http://www.engin.umich.edu/group/ctm/basic/basic.htmlhttp://www.engin.umich.edu/group/ctm/basic/basic.html

Page 7: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 77

Overview of the CourseOverview of the Course

Topics of DiscussionTopics of Discussion Problem solving definition, process, techniques, Problem solving definition, process, techniques,

strategies, tools, etcstrategies, tools, etc MATLAB basics and advanced data types, MATLAB basics and advanced data types,

commands, script, functions, and program controlscommands, script, functions, and program controls Math Equations and their graphsMath Equations and their graphs Elementary MATLAB Math functions and their Elementary MATLAB Math functions and their

applicationsapplications Programming with MATLAB, File I/OsProgramming with MATLAB, File I/Os MATLAB Problem Solving Applications in MATLAB Problem Solving Applications in

Electronics and Electrical, Physics, Engineering Electronics and Electrical, Physics, Engineering Technology, Data Analysis, etcTechnology, Data Analysis, etc

Problem Solving Projects: team-based, collaborative Problem Solving Projects: team-based, collaborative problem solvingproblem solving

Page 8: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 88

Problem SolvingProblem Solving Definition of Problem SolvingDefinition of Problem Solving

• What is a ProblemWhat is a Problem1,21,2 – A situation, quantitative or – A situation, quantitative or otherwise, that confronts an individual or group of otherwise, that confronts an individual or group of individuals for a specific purpose that requires individuals for a specific purpose that requires resolution, and for which the individual see no apparent resolution, and for which the individual see no apparent or obvious means or path to obtaining the solution.or obvious means or path to obtaining the solution.

• What is Problem SolvingWhat is Problem Solving1,21,2 – A process in which one – A process in which one individual uses previously acquired knowledge, skills, individual uses previously acquired knowledge, skills, and understanding to satisfy the demands of an and understanding to satisfy the demands of an unfamiliar situation.unfamiliar situation.

• Why Teach Problem SolvingWhy Teach Problem Solving – stimulate students to – stimulate students to practice critical thinking and prepares students to use practice critical thinking and prepares students to use math, physics, science, and discipline specific math, physics, science, and discipline specific knowledge to solve real-world problems.knowledge to solve real-world problems.

[1] Problem Solving, A Handbook for Teacher, by Stephen Krulik and Jesse [1] Problem Solving, A Handbook for Teacher, by Stephen Krulik and Jesse A. Rudnick, published by Allyn and Bacon, Inc., Massachusetts, 1980.A. Rudnick, published by Allyn and Bacon, Inc., Massachusetts, 1980.

[2] Problem Solving – Terminologies, [2] Problem Solving – Terminologies, http://www.mediafrontier.com/Article/PS/PS.htmhttp://www.mediafrontier.com/Article/PS/PS.htm

Page 9: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 99

Problem Solving Problem Solving (continue)(continue)

Types of ProblemsTypes of Problems33

• Well-Defined ProblemsWell-Defined Problems Solved using standard methods, methods of similar Solved using standard methods, methods of similar

problems, or methods of analog problemsproblems, or methods of analog problems Examples: puzzles, simple games, low-level math, Examples: puzzles, simple games, low-level math,

science, and engineeringscience, and engineering

• ILL-Defined ProblemsILL-Defined Problems Unexplored problem domainsUnexplored problem domains Not clear what the problem is and what the solution isNot clear what the problem is and what the solution is Approximate solutionApproximate solution

• Wicked-Defined ProblemsWicked-Defined Problems Worse than ill defined problemWorse than ill defined problem Contains contradictory requirementsContains contradictory requirements Inventive/creative solutionsInventive/creative solutions

[3] Problem Solving, http://cs.wwc.edu/~aabyan/Design/probSolv.html[3] Problem Solving, http://cs.wwc.edu/~aabyan/Design/probSolv.html

Page 10: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 1010

Collaborative, Team-Based Collaborative, Team-Based Problem SolvingProblem Solving

44Today's industrial environments, problem solving Today's industrial environments, problem solving generally utilizes teams of people, from different generally utilizes teams of people, from different countries, with different backgrounds and countries, with different backgrounds and expertise to bring to bear on problems that often expertise to bring to bear on problems that often cross over formation, processing, manufacturing, cross over formation, processing, manufacturing, distribution and marketing.distribution and marketing.

44Not all technically correct answers are feasible in Not all technically correct answers are feasible in commercial practice.commercial practice.

44For example, a correct solution cannot be For example, a correct solution cannot be implemented because it is contrary to the implemented because it is contrary to the marketing strategy for the product or that the marketing strategy for the product or that the solution may require greater capitol expenditure solution may require greater capitol expenditure than is economically feasiblethan is economically feasible

[4] Technical Problems and Problem Solving, http://class.fst.ohio-state.edu/fst696/696%20Technical%20Problems%20and%20Problem%20solving.htm

Page 11: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 1111

Problem Solving with a ComputerProblem Solving with a Computer55

Define the problemDefine the problem Formulate a mathematical modelFormulate a mathematical model Develop an algorithmDevelop an algorithm Write the code for the problemWrite the code for the problem Test program and verify the solutionTest program and verify the solution Document the program and solutionDocument the program and solution

[5] Problem Solving with a Computer, http://www.aspire.cs.uah.edu/textbook/introcomp6004.html

Page 12: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 1212

Problem Solving in this CourseProblem Solving in this Course

NeedsNeeds• Basic skills of mathematics, electrical and Basic skills of mathematics, electrical and

electronicselectronics• Critical thinkingCritical thinking• MATLAB: Engineering and science MATLAB: Engineering and science

computing toolcomputing tool

Page 13: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 1313

Introduction to MATLABIntroduction to MATLAB

What is MATLAB?What is MATLAB? Short for MATrix LABoratoryShort for MATrix LABoratory Capable of solving any technical problemsCapable of solving any technical problems A Special-purpose, interpreter-based, computer A Special-purpose, interpreter-based, computer

program for technical computing and simulation, program for technical computing and simulation, engineering and scientific computing, numerical engineering and scientific computing, numerical computation and visualization without intensive computation and visualization without intensive programming knowledge.programming knowledge.

MATLAB computing environmentMATLAB computing environment 66The company Mathworks www.mathworks.com.The company Mathworks www.mathworks.com.

[6] The MathWorks, http://www.mathworks.com/

Page 14: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 1414

Introduction to MATLABIntroduction to MATLAB (continue)(continue)

The Advantage of MATLABThe Advantage of MATLAB Ease of UseEase of Use Platform IndependencePlatform Independence Predefined FunctionsPredefined Functions Device-Independent PlottingDevice-Independent Plotting Graphical User InterfaceGraphical User Interface MATLAB CompilerMATLAB Compiler Disadvantages of MATLABDisadvantages of MATLAB Interpreted language – slowInterpreted language – slow CostCost

Page 15: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 1515

Introduction to MATLABIntroduction to MATLAB (continue)(continue)

The MATLAB Environment includesThe MATLAB Environment includes Graphical user interfaceGraphical user interface MATLAB desktop and Command WindowMATLAB desktop and Command Window A command historyA command history An editor and debugger, and An editor and debugger, and A Browser for viewing help, the workspace, files, A Browser for viewing help, the workspace, files,

and the search path. and the search path.

Page 16: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 1616

Introduction to MATLABIntroduction to MATLAB (continue)(continue)

MATLAB Desktop – the main interface for working MATLAB Desktop – the main interface for working with MATLABwith MATLAB

Page 17: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 1717

MATLAB Electrical Calculator:MATLAB Electrical Calculator: an Interactive Sessionan Interactive Session

Start MATLABStart MATLAB Example1: Enter the Example1: Enter the

following lines on the following lines on the MATLAB Command MATLAB Command WindowsWindows

>> watt = 100;>> watt = 100;

>> volt = 110;>> volt = 110;

>> i = watt/volt>> i = watt/volt

i =i =

0.90910.9091 Double Click the Command Double Click the Command

in the Command History in the Command History WindowWindow

Workspace

Command Window

Command History

Page 18: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 1818

MATLAB Electrical Calculator:MATLAB Electrical Calculator: an Interactive Sessionan Interactive Session (continue)(continue)

Example 2: Calculate the area of a Example 2: Calculate the area of a circle with a radius of 0.001 inch (circle with a radius of 0.001 inch (ππ r r22).).

>> pi>> pians =ans = 3.14163.1416>> area = pi*0.001^2>> area = pi*0.001^2area =area = 3.1416e-0063.1416e-006

>> >>

Page 19: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 1919

MATLAB: an Interactive SessionMATLAB: an Interactive Session

Example 3: Sum of 12 numbers with Example 3: Sum of 12 numbers with continue statement on successive lines by continue statement on successive lines by typing an ellipsis (…) at the end of the first typing an ellipsis (…) at the end of the first lineline

>> x = 1 + 2+3+4+5+6+7+8+9+10+11+12>> x = 1 + 2+3+4+5+6+7+8+9+10+11+12x =x = 7878

>> x = 1 + 2 + 3 + 4 + ...>> x = 1 + 2 + 3 + 4 + ...5 + 6 + 7 + 8 + 9 + 10 + 11 + 125 + 6 + 7 + 8 + 9 + 10 + 11 + 12x =x = 7878

Page 20: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 2020

SummarySummary

Problem SolvingProblem Solving Problem Solving with a ComputerProblem Solving with a Computer Introduction to MATLABIntroduction to MATLAB A Sample MATLAB SessionA Sample MATLAB Session

• Example 1: Calculate I = watt/voltExample 1: Calculate I = watt/volt• Example 2: Calculate the area of a circle Example 2: Calculate the area of a circle

with a radius of 0.001 inch (with a radius of 0.001 inch (ππ r2). r2).• Example 3: Sum of 12 numbers with Example 3: Sum of 12 numbers with

continue statement on successive lines by continue statement on successive lines by typing an ellipsis (…) at the end of the first typing an ellipsis (…) at the end of the first lineline

Next: Math Problem Solving with MATLABNext: Math Problem Solving with MATLAB

Page 21: August 22, 2005 Lecture 1 - By P. Lin 1 CPET 190 Lecture 1 Problem Solving with MATLAB lin.

August 22, 2005August 22, 2005 Lecture 1 - By P. LinLecture 1 - By P. Lin 2121

Question?Question?

AnswersAnswers

Email: [email protected]: [email protected]