Engineering Problem Solving Kuncicky – MatLab Programming G. Polya – How to Solve it.

Slides:



Advertisements
Similar presentations
Section 3-5: Projectile Motion
Advertisements

Coordinatate systems are used to assign numeric values to locations with respect to a particular frame of reference commonly referred to as the origin.
M 1 and M 2 – Masses of the two objects [kg] G – Universal gravitational constant G = 6.67x N m 2 /kg 2 or G = 3.439x10 -8 ft 4 /(lb s 4 ) r – distance.
Chapter 6B – Projectile Motion
Modelling - Module 1 Lecture 1 Modelling - Module 1 Lecture 1 David Godfrey.
Describing Motion with Equations There are a variety of quantities associated with the motion of objects – displacement (and distance), velocity (and speed),
Click here to enter. Click a menu option to view more details Starters Main Courses Desserts Click on the coffee cup to return when Navigating For Vocabulary.
Projectile Motion.
Chapter 1 Computing Tools Data Representation, Accuracy and Precision Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
Parametric Equations Here are some examples of trigonometric functions used in parametric equations.
© Janice Regan, CMPT 102, Sept CMPT 102 Introduction to Scientific Computer Programming The software development method algorithms.
CSE123 Introduction to Computing Lecture 1 Introduction Engineering Problem Solving.
APPLICATIONS OF DIFFERENTIATION
Kinematics of Particles Lecture II. Subjects Covered in Kinematics of Particles Rectilinear motion Curvilinear motion Rectangular coords n-t coords Polar.
Physics 121 Topics: Course announcements Quiz
Unit 8 POE Ballistic Device
Motion in One Dimension
SACE Stage 1 Conceptual Physics
Copyright © Cengage Learning. All rights reserved.
Introduction and Vectors
Kinematics in Two Dimensions Chapter 3. Expectations After Chapter 3, students will:  generalize the concepts of displacement, velocity, and acceleration.
Adding Vectors, Rules When two vectors are added, the sum is independent of the order of the addition. This is the Commutative Law of Addition.
SACE Stage 2 Physics Motion in 2 Dimensions.
Measurement.
Chapter 1 Computing Tools Analytic and Algorithmic Solutions Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Projectile Motion Projectile motion: a combination of horizontal motion with constant horizontal velocity and vertical motion with a constant downward.
Ch 2 1 Chapter 2 Kinematics in One Dimension Giancoli, PHYSICS,6/E © Electronically reproduced by permission of Pearson Education, Inc., Upper Saddle.
An Introduction to Programming and Algorithms. Course Objectives A basic understanding of engineering problem solving process. A basic understanding of.
Motion in Two Dimension
Slide 5- 1 Copyright © 2006 Pearson Education, Inc. Publishing as Pearson Addison-Wesley.
Physics. Good News/Bad News: These are the same formulas we used for linear motion. Do you know them? If the answer is “NO”, then get familiar with them.
AP Physics.  Think of a curve being traced out over time, sometimes doubling back on itself or crossing itself. Such a curve cannot be described by a.
CSE123 Introduction to Computing Lecture 1 – Introduction to Computers 1.
Copyright Sautter Motion in Two Dimension - Projectiles Projectile motion involves object that move up or down and right or left simultaneously.
Chapter 1 Computing Tools Analytic and Algorithmic Solutions Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CMPS 1371 Introduction to Computing for Engineers PRINCIPLES OF PROBLEM SOLVING.
Kinematics of Particles Lecture II. Subjects Covered in Kinematics of Particles Rectilinear motion Curvilinear motion Rectangular coords n-t coords Polar.
Copyright Sautter General Problem Solving Steps (1) Read the problem more than once (three of four times is preferable) (2) Decide what is to be.
Vector components and motion. There are many different variables that are important in physics. These variables are either vectors or scalars. What makes.
What is the magnitude and direction (if any) of the acceleration of the ball at the instant it reaches the highest point in its trajectory? What is its.
Kinematics in Two Dimensions. Section 1: Adding Vectors Graphically.
College Algebra Acosta/Karwoski. CHAPTER 1 linear equations/functions.
Ch 2 1 Chapter 2 Kinematics in One Dimension Giancoli, PHYSICS,6/E © Electronically reproduced by permission of Pearson Education, Inc., Upper Saddle.
Kinematics in One Dimension
AP Physics 1: Unit 0 Topic: Language of Physics Learning Goals: Compare and contrast object and system Define the make up of an object of a system of objects.
Projectile Motion.
Motion in Two Dimensions
Applications of Differentiation Section 4.9 Antiderivatives
Physics “Motion in One Dimension”. Displacement and Velocity u motion - a constant change in position u distance - the result of motion in any direction.
Calculating ‘g’ practical
Chapter Projectile Motion 6.1.
Structured Computer Programming EE 201 Introduction to MATLAB 7 for Engineers بسم الله الرحمن الرحيم King Abdulaziz University College of Engineering Dept.
PHY 151: Lecture 4A 4.1 Position, Velocity, and Acceleration Vectors 4.2 Two-Dimensional Motion with Constant Acceleration 4.3 Projectile Motion.
Introduction.
Chapter Projectile Motion 6.1.
Describing Motion with Equations
Bell Ringer pg.26 Why does a bullet that is dropped and a bullet is shot at the same time horizontally from the same height land at the same time?
Average Rate of Change of a Function
Kinematics Introduction to Motion
Chapter Projectile Motion 6.1.
CE 102 Statics Chapter 1 Introduction.
Introduction.
Introduction.
Introduction.
Chapter 1 Units and Problem Solving
10.7 Parametric Equations parametric equations: a pair of equations, one for x and one for y, relating both to a third variable t.
Introduction.
Presentation transcript:

Engineering Problem Solving Kuncicky – MatLab Programming G. Polya – How to Solve it.

Problem-Solving Process The problem-solving process for a computational problem can be outlined as follows: 1. Define the problem. 2. Create a mathematical model. 3. Develop a computational method for solving the problem. 4. Implement the computational method. 5. Test and assess the solution.

Problem Definition: The first steps in problem solving include: 1. Recognize and define the problem precisely by exploring it thoroughly (may be the most difficult step). 2. Determine what question is to be answered and what output or results are to be produced 3. Determine what theoretical and experimental knowledge can be applied. 4. Determine what input information or data is available

After defining the problem: 1. Collect all data and information about the problem. 2. Verify the accuracy of this data and information. 3. Determine what information you must find: intermediate results or data may need to be found before the required answer or results can be found.

Mathematical Model: To create a mathematical model of the problem: 1. Determine what fundamental principles are applicable. 2. Draw sketches or block diagrams to better understand the problem. 3. Define necessary variables and assign notation. 4. Reduce the problem as originally stated into one expressed in purely mathematical terms. 5. Apply mathematical expertise to extract the essentials from the underlying physical description of the problem. 6. Simplify the problem only enough to allow the required information and results to be obtained. 7. Identify and justify the assumptions and constraints inherent in this model.

Computational Method: A computational method for solving the problem is to be developed, based on the mathematical model. 1.Derive a set of equations that allow the calculation of the desired parameters and variables. 2. Develop an algorithm, or step-by-step method of evaluating the equations involved in the solution. 3. Describe the algorithm in mathematical terms and then implement as a computer program (tailored to a specific language). 4. Carefully review the proposed solution, with thought given to alternative approaches.

Implementation of Computational Method: Computer Implementation considerations: 1. Assess the computational power needed, as an acceptable implementation may be hand calculation with a pocket calculator. 2. If a computer program is required, choose the proper programming languages (C/C++/Fortran/MatLab) and operating system (Windows/Unix-Linux). 3. Select the proper computer (PC/ Workstation (SUN/Silicon Graphics) / parallel supercomputers). 4. The ability to choose the proper combination of programming language and computer, and use them to create and execute a correct and efficient implementation of the method, requires both knowledge and experience.

Choice of Hardware and Software: Translate the mathematical algorithm into a computational algorithm and then implemented as a computer program. The steps in the algorithm should: 1. be outlined and then 2. decomposed into smaller steps that can be 3. translated into programming commands. MatLab commands match very closely to the steps that are used to solve engineering problems. Furthermore, MatLab includes an extensive toolbox of numerical analysis algorithms, so the programming effort often involves: 1. implementing the mathematical model, 2. characterizing the input data, and 3. applying the available numerical algorithms.

Test and Assess the Solution: Verify the correctness of the solution: 1. A simple version of the problem should be checked. 2. The program should be executed on known or computed test data for which the answer is either known or can be obtained by independent means, such as hand or calculator computation. 3. Intermediate values should be compared with expected results and estimated variations. If values deviate from expected results, the source of the error should be determined and the program modified as needed. 4. A ” reality check ” should be performed on the solution to determine if it makes sense. 5. Assumptions made in creating the mathematical model of the problem should be checked against the solution.

Problem Solving Example A small object is launched into flight from the ground at a speed of 50 miles/hour at 30 degrees above the horizontal over level ground. Determine the time of flight and the distance traveled when the ball returns to the ground.

1. Problem Definition: As stated above, this problem is well defined. The following items could be considered in further defining the problem. 1. Additional information needed: (a) Properties of the object and the flight medium could affect the flight trajectory. (b) Acceleration of gravity also affects the flight. (c) The accuracy of the initial speed and angle of the object is needed to determine the necessary accuracy of the quantities to be computed. (d) Unit conversions needed: 1 mile = 5280 feet, 1 hour = 60 minutes = 3600 seconds, 360 degrees = 2π radians

2. Output or results to be produced: It is clear from the problem statement that the results to be produced are the time of flight and the distance traveled. The units for these quantities haven ’ t been specified, but from our knowledge of throwing a baseball, computing time in seconds and distance in feet would be reasonable. 3. Theoretical and experimental knowledge to be applied: The theory to be applied is that of ballistic motion in two dimensions. 4. Input information or data: This includes the object initial velocity of 50 miles per hour at an angle 30 degree above horizontal.

2.Mathematical Model: To pose this problem in terms of a mathematical model, we first need to define the notation: 1. Time: t (s), with t = 0 when the object is launched. 2. Initial velocity magnitude: v = 50 miles/hour. 3. Initial angle: = 30 o. 4. Horizontal position of ball: x(t) (ft). 5. Vertical position of ball: y(t) (ft). 6. Acceleration of gravity: g = 32.2ft/s 2, directed in negative y direction.

The key step in developing a mathematical model is to divide the trajectory into its horizontal and vertical components. The initial velocity can be divided in this way, as shown in Figure 1. Figure 1: Initial velocity (v) divided into horizontal (vh) and vertical (vv) components. From basic trigonometry, we know that v h = v cosθ, v v = v sinθ

Given the horizontal and vertical components of the initial velocity, the horizontal and vertical positions can be determined as functions of time. Since there is no external force acting to retard the horizontal motion, the object will move at a constant speed of vh in the horizontal direction x(t) = vt cosθ In the vertical direction, the object motion is retarded by gravity and its position is y(t) = vt sinθ −(1/2) gt 2

3. Computational Method: Using the model developed above, expressions for the desired results can be obtained. The object will hit the ground when its vertical position is zero which can be solved to yield two values of time: The second of the two solutions indicates that the object will return to the ground at the time The horizontal position (distance of travel) at this time is x(tg) = vtg cosθ

4.Computational Implementation: The equations defined in the computational method can be readily implemented using Mat-lab. The commands used in the following solution will be discussed in detail later in the course, but observe that the Matlab steps match closely to the solution steps from the computational method. % Flight trajectory computation % Initial values g = 32.2; % gravity, ft/s ˆ 2 v = 50 * 5280/3600; % launch velocity, ft/s theta = 30 * pi/180; % launch angle, radians % Compute and display results disp( ’ time of flight (s): ’ ) % label for time of flight tg = 2 * v * sin(theta)/g % time to return to ground, s disp( ’ distance traveled (ft): ’ ) % label for distance xg = v * cos(theta) * tg % distance traveled % Compute and plot flight trajectory t = linspace(0,tg,256); x = v * cos(theta) * t; y = v * sin(theta) * t - g/2 * t. ˆ 2; plot(x,y), axis equal, axis([ ]), grid,... xlabel( ’ Distance (ft) ’ ), ylabel( ’ Height (ft) ’ ), title( ’ Flight Trajectory ’ )

Remarks: 1. Words following percent signs (%) are comments to help in reading the MatLab statements. 2. A word on the left of an equals sign is known as a variable name and it will be assigned to the value or values on the right of the equals sign. Commands having this form are known as assignment statements. 3. If a MatLab command assigns or computes a value, it will display the value on the screen if the statement does not end with a semicolon (;). Thus, the values of v, g, and theta will not be displayed. The values of tg and xg will be computed and displayed, because the statements that computes these values does not end with a semicolon. 4. The three dots (...) at the end of a line mean that the statement continues on the next line.

5. More than one statement can be entered on the same line if the statements are separated by commas. 6. The statement t = linspace(0,tg,256); creates a vector of length The expression t.^2 squares each element in t, making another vector. 8. In addition to the required results, the flight trajectory has also been computed and plotted. This will be used below in assessing the solution. 9. The plot statement generates the plot of height against distance, complete with a title and labels on the x and y axes.

Testing and Assessing the Solution: This problem is sufficiently simple that the results can be computed by hand with the use of a calculator. There is no need to generate test data to check the results. One could even question the need to use the power of MatLab to solve this problem, since it is readily solved using a calculator. Of course, our objective here is to demonstrate the application of MatLab to a problem with which you are familiar. Executing the statements above provides the following displayed results: time of flight (s): tg = distance traveled (ft): xg = Computing these quantities with a calculator can be shown to produce the same results.

Flight trajectory plot MatLab generated plot of flight trajectory

This demonstrates another strength of MatLab, as it has taken care of the details of the plot generation, including axis scaling, label placement, etc. This result can be used to assess the solution. Our physical intuition tell us that this result appears to be correct, as we know that we could throw a baseball moderately hard and have it travel a distance of nearly 150 feet and that maximum height of about 20 feet also seems reasonable. The shape of the trajectory also fits our observations.