Engr/Math/Physics 25 Applied Math Problem Solving Bruce Mayer, PE Licensed Electrical & Mechanical Engineer BMayer@ChabotCollege.edu Engineering/Math/Physics 25: Computational Methods 1 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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) Engineering/Math/Physics 25: Computational Methods 2 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt Info From MathWorks Engineering/Math/Physics 25: Computational Methods 3 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt Engineering/Math/Physics 25: Computational Methods 4 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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): Engineering/Math/Physics 25: Computational Methods 5 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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 Engineering/Math/Physics 25: Computational Methods 6 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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 Engineering/Math/Physics 25: Computational Methods 7 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt Problem Solving Engineering/Math/Physics 25: Computational Methods 8 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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 Engineering/Math/Physics 25: Computational Methods 9 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt Copy HW Code Crash&Burn Exams 110% HW 100% MTE 90% HW Cheaters 80% 70% HW or MTE Score 60% 50% 40% 30% 20% 10% 0% 5393 1334 0606 8235 8116 7224 7511 0309 9273 8906 W-No. 6829 0466 10 2188 2257 3187 0810 8297 8872 5407 3374 8247 3599 4795 2736 3390 Engineering/Math/Physics 25: Computational Methods Student Grades_E25_Fa0909_091021.xls Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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 ☺☺☺ Engineering/Math/Physics 25: Computational Methods 11 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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 Engineering/Math/Physics 25: Computational Methods 12 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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. Engineering/Math/Physics 25: Computational Methods 13 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt Assumption Digression BMayer 2001 JVST Paper • See ENGR45 for More Details Engineering/Math/Physics 25: Computational Methods 14 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt Assumption Digression PARTIAL Assumption List • 100% Vapor Saturation at Bubble Edge • Gases in bubble behave as perfect gases • Bubbles are Spherical – Radial Symmetry Engineering/Math/Physics 25: Computational Methods 15 • Diffusion Coefficient is Constant Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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. Engineering/Math/Physics 25: Computational Methods 16 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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. Engineering/Math/Physics 25: Computational Methods 17 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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. Engineering/Math/Physics 25: Computational Methods 18 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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. Engineering/Math/Physics 25: Computational Methods 19 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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. Engineering/Math/Physics 25: Computational Methods 20 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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. Engineering/Math/Physics 25: Computational Methods 21 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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 Engineering/Math/Physics 25: Computational Methods 22 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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 PCBased Hi-Perf “Math Processors” Engineering/Math/Physics 25: Computational Methods 23 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 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 Engineering/Math/Physics 25: Computational Methods 24 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt Next Time → use MATLAB Covered in ENGR25 Engineering/Math/Physics 25: Computational Methods 25 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt First ENGR25 Tutorial MATLAB Video Tutorials • http://www.mathworks.com/academia/stud ent_center/tutorials/launchpad.html – http://www.mathworks.com/videos/matlab/gettin g-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/creati ng-a-basic-plot-interactively.html (6 min) Engineering/Math/Physics 25: Computational Methods 26 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt First ENGR25 Tutorial – Additional Videos Useful in the future http://www.mathworks.com/videos/matlab/importingdata-from-files.html (HW5, 7min) http://www.mathworks.com/products/simulink/demos. html?BB=1 (Chp9, http://www.mathworks.com/videos/simulink/getting-started-withsimulink.html (4 min) http://www.mathworks.com/videos/simulink/visualizingsimulation-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) Engineering/Math/Physics 25: Computational Methods 27 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt 3x3 from ENGR43 For The DC Linear Circuits We Will need to Solve Systems Of Algebraic Equations R2 2.2 kΩ I2 R3 1.2 kΩ 1.5 kΩ I3 Rx R1 2.7 kΩ 7 mA RL 13V I1 IL 1.8 kΩ Engineering/Math/Physics 25: Computational Methods 28 12V1 9V2 4V3 8 4V1 16V2 V3 0 2V1 4V2 6V3 20 Bruce Mayer, PE BMayer@ChabotCollege.edu • ENGR-25_MATLAB_AppMath_ProbSolve.ppt