CMPS 1371 Introduction to Computing for Engineers - PowerPoint PPT Presentation

1 / 14
About This Presentation
Title:

CMPS 1371 Introduction to Computing for Engineers

Description:

The average package weight is 20 pounds with rectangular dimensions of 12 by 12 by 8 inches. ... What programming techniques might you use to convert input to output? ... – PowerPoint PPT presentation

Number of Views:51
Avg rating:3.0/5.0
Slides: 15
Provided by: timha87
Category:

less

Transcript and Presenter's Notes

Title: CMPS 1371 Introduction to Computing for Engineers


1
CMPS 1371Introduction 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 packages 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 Newtons Laws
  • Height vs time to impact
  • h ½ g t2
  • Impact speed vs time to impact
  • v g t
  • Conservation of mechanical energy
  • m g h ½ m v2

m
g
v
h
ground
10
Problem Solving
  • We could solve for any three of the equations,
    but notice the 3rd equation does not involve the
    impact time
  • m g h ½ m v2
  • h ½ v2 / 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 ½ v2 / g
  • v 25 ft/sec, g 32.2 ft/sec2
  • h ½ (25)2 / 32.2 9.7 ft
  • gtgtv 25
  • gtgtg 32.2
  • gtgth 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
Write a Comment
User Comments (0)
About PowerShow.com