Download presentation
Presentation is loading. Please wait.
Published byBlake Henderson Modified over 9 years ago
1
Problem Solving: Practice & Approaches 1.Practice solving a variety of problems 2.Strategies for solving problems 3.More Practice 1
2
General Idea of This Lesson Programming is like learning a language – You need to learn the vocabulary (keywords), grammar (syntax), and how to use punctuation (symbols) Problem solving is like learning to cook – A novice chef has a recipe – An master chef can create their own recipe Both tasks require practice! 2
3
Review: Scientific Problem-Solving Method 1.Problem Statement a.Diagram b.Assumptions 2.Solution Steps (manual solution) a.Theory / limitations b.Itemize specific steps (in order) as you solve the problem c.Identify results & verify accuracy 3.Computerize the solution a.Express the algorithm as steps general to any instance of the problem b.Translate the algorithm to lines of code c.Test and verify results 3
4
Example #1: Balancing a fulcrum A 30-kg child and a 20-kg child sit on a 5.00-m long teeter-totter. Where should the fulcrum be placed so the two children balance? (Note: an object is in static equilibrium when all moments balance.) Using the supplied worksheet, solve the problem work on the first couple of steps: On your own With your neighbors What did you get? 4
5
Example #1: Balancing a fulcrum 5 1.Problem Statement: a)Givens: m 1 = 30 kg m 2 = 20 kg L = 5m a)Find: Location of the fulcrum 2.Diagram
6
Example #1: Balancing a fulcrum 6 3. Assumptions Mass of teeter-totter is negligible Earth’s gravitational constant 4. Theory Force = Mass * Acceleration (F = m*a) Moment = Force * Distance (M = F*d) Σ M F = 0, The sum of moments about the fulcrum equals zero at static equilibrium 1 2 3
7
Example #1: Balancing a fulcrum 7 5.Itemize Steps 1.Forces: F 1 = m 1 * gF 2 = m 2 * g 2.Moments:M 1 = F 1 * L 1 M 2 = -F 2 * L 2 3.Equilibrium:Σ M F = 0 = M 1 + M 2 0 = F 1 * L 1 -F 2 * L 2 0 = m 1 * g * L 1 -m 2 * g* L 2 thus: m 1 *L 1 = m 2 *L 2 4.Get rid of L 2 using: L 2 = L – L 1 m 1 *L 1 = m 2 (L-L 1 )thus:L 1 = m 2 * L / (m 1 + m 2 ) 5.Σ L 1 = 20*5/(20+30)=100/50=2.00 m
8
Example #1: Balancing a fulcrum 8 6.Identify results and verify L 1 = 2.00 m Does this make sense? – Units? – Overall Dimension? – Easy to imagine! What happens if the 20 kg child is now 25 kg? – Can you rerun the analyses with other givens using Step 5? This is the key to Computer Programming!!
9
Problem Solving Strategies The trouble with Step 5: “Itemize Steps” There can be many approaches to solving the same problem Creativity is an important component on how we view and approach problems: 9
10
Creativity Connect the following 9 dots with four continuous lines without lifting your pencil Sometimes you will need to think outside the box 10
11
Problem Solving Strategies (Polya, 1945) Utilize analogies – Flow through a piping system can be modeled with electronics Resistors – Fluid Friction Capacitors – Holdup tanks Batteries – Pumps Work Auxiliary Problems – Simpler problems that are easier to solve but may make invalid assumptions or that may only solve part of the problem (e.g., this works for x < 0) – Remove some constraints, but also removes some generalizability Generalize the problem Ex: L 1 = m 2 * L / (m 1 + m 2 ) 11
12
Problem Solving Strategies (Polya, 1945) Decompose & Recombine problems – Break the problem into individual components Calculate Cost of Area 12 Prove the following equation 2 x 2 x 2 x 2 = 16
13
Problem Solving Strategies (Polya, 1945) Work backwards from the solution Ex: Measure exactly 7 oz. of liquid from an infinitely large container using only a 5 oz. container and an 8 oz. container Solution: 1.Fill 5 oz container and empty into 8oz 2.Fill 5 oz container again, then pour to top-off 8oz container (2 oz remaining in 5 oz) 3.Empty 8 oz and fill with the remaining 2oz from 5oz container 4.Fill 5 oz container and add it to the 8oz container 13 8 5 7?
14
Example #2: Fuel tank design A fuel tank is to be constructed that will hold 5 x 10 5 L. The shape is cylindrical with a hemisphere top and a cylindrical midsection. Costs to construct the cylindrical portion will be $300/m 2 of surface area and $400/m 2 of surface area of the hemispheres. What is the tank dimension that will result in the lowest dollar cost? 14
15
1.Problem Statement: Givens: Cost Hemisphere = $400/m 2 Cost Cylinder = $300/m 2 Volume Tank = 500,000 L Find: Size for minimum cost 2.Diagram Example #2: Fuel tank design 15 R H
16
Example #2 Fuel tank design 3.Assumptions No dead space Construction cost independent of size Other costs do not change with tank dimensions Thickness of walls is negligible Bottom flat portion of tank is free 4.Theory 1Volume Cylinder: 2Volume Hemisphere 3Surface Area Cylinder: 4Surface Area Hemisphere:
17
Example #2: Fuel tank design 17 5.Solution Steps 1. Substitute equations 2. Solve for H with respect to R Substitute equations Solve for Cost with respect to radius
18
Example #2: Fuel tank design 18 Cost $155,027$111,310$95,106$91,416$95,239$104,432$117,925 Radius2345678 5. Solution Steps Calculate minimum cost with respect to radius MATLAB can be used to calculate the minimum cost Plot the data – plot( R, Cost ) Identify minimum for an array of costs – min(Cost) Numerical Methods (iterative solutions)
19
Example #2: Fuel tank design 19 6.Identify results and Verify Take the derivative of the cost function Does this make sense? – Units? – Overall Dimension? – Can you rerun the analyses with other givens using Step 5? 5m 3m 5V Tank = 500,000L
20
Wrapping Up Utilize the 7 step process before you begin programming Be clear about your approach Think creatively Use a couple of strategies when understanding a problem Practice! Use MATLAB to make your life easier 20
21
Try it Yourself Steps 1-7a What if the fuel tank had two hemispheres? A) A fuel tank is to be constructed that will hold 5 x 10 5 L. The shape is cylindrical with a hemisphere on each end and a cylindrical midsection. Costs to construct the cylindrical portion will be $250/m 2 of surface area and $300/m 2 of surface area of the hemispheres. What is the tank dimension that will result in the lowest dollar cost (to the nearest 0.1 meters)? B) What if the cylinder costs $350/m 2 and the hemisphere is $400/m 2 21 R H
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.