Presentation is loading. Please wait.

Presentation is loading. Please wait.

CMPS 1371 Introduction to Computing for Engineers PRINCIPLES OF PROBLEM SOLVING.

Similar presentations


Presentation on theme: "CMPS 1371 Introduction to Computing for Engineers PRINCIPLES OF PROBLEM SOLVING."— Presentation transcript:

1 CMPS 1371 Introduction to Computing for Engineers PRINCIPLES OF PROBLEM SOLVING

2 Problem Solving Define the Problem Identify given information. Identify other available information. Design and implement your solution to the problem. Verify your solution. Reflect on your solution.

3 Example Suppose you work for a company that produces packaging. You are told that a new material is available to protect the package if dropped, provided the package hits the ground at less than 25 ft/sec. The average package weight is 20 pounds with rectangular dimensions of 12 by 12 by 8 inches. You must determine whether the packaging material provides enough protection when carried by a delivery person.

4 Problem Solving Define the Problem What problem are you trying to solve? "What would success look like?" What should the program output? Computed values? A plot or series of plots? The implication is that the package is to be protected from an accidental drop while being carried (not falling off the delivery truck)

5 Problem Solving Identify given information. What constants or data are supplied? What theory, principles, models and equations have you been given? The known information is the package’s weight, dimensions, and the maximum allowed impact speed.

6 Problem Solving Identify other available information. What theory, principles, models and equations can you find in other sources (text books, lecture notes, etc.)? Although not explicitly stated, you need to know the maximum height from which the package can be dropped without damage. You need to find a relationship between the speed of impact and the height of the dropped package

7 Problem Solving Basic assumptions The package is dropped from rest with no vertical or horizontal velocity The package does not tumble The effect of air drag is negligible Assume maximum height of 6 feet (ignore those 8ft delivery men) The acceleration, g, due to gravity is constant since only a 6 ft drop

8 Problem Solving Design and implement your solution to the problem. How can you break the larger problem into smaller problems? Can you sketch the problem? Look at the problem from the top down or bottom up? What programming techniques might you use to convert input to output? What variables do you need? Vectors? Arrays? What principles and equations apply to convert input to output?

9 Problem Solving Since the problem involves mass in motion, we can apply Newton’s Laws: Height vs time to impact h = ½ g t 2 Impact speed vs time to impact v = g t Conservation of mechanical energy m g h = ½ m v 2 m h ground v g

10 Problem Solving We could solve for any three of the equations, but notice the 3 rd equation does not involve the impact time: m g h = ½ m v 2 h = ½ v 2 / g Notice the mass cancelled out; hence, weight of the package does not affect the relation between the impact speed and the height dropped

11 Problem Solving Solution: h = ½ v 2 / g v = 25 ft/sec,g = 32.2 ft/sec 2 h = ½ (25) 2 / 32.2 = 9.7 ft >>v = 25; >>g = 32.2; >>h = v.^2./(2.*g) h = 9.7050

12 Problem Solving Verify your solution. How do you know your solution is correct? If the computed height was negative, we would know we did something wrong. If the height was very large, we might be suspicious Computed height of 9.7 ft seems reasonable To be conservative, we would report that the protective packaging works for heights less than 9 ft when dropped.

13 Problem Solving Reflect on your solution. What worked? What didn't?

14 Fundamental Operations List of possible operations we may expect to perform on collections Build / Insert- Create a collection of elements Traverse- Create a new collection by operating on an existing collection Map- Transform a collection with same length Filter- Remove items with specified criteria Fold- Collection is summarized Search- Locate specified element Sort- Re-ordering of elements


Download ppt "CMPS 1371 Introduction to Computing for Engineers PRINCIPLES OF PROBLEM SOLVING."

Similar presentations


Ads by Google