Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS123 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Spring 2010.

Similar presentations


Presentation on theme: "CS123 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Spring 2010."— Presentation transcript:

1 CS123 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Spring 2010

2 Administrative Notes Please save the following date: –Computational Science and Engineering day – Tuesday, May 11 –Headline talk – “Why we study math in Engineering” – Tom Lee (Ph.D., PE. Maplesoft) –9:30-10:30 AM –Mitchell Auditorium –Extra bonus points given to attendees (lecture will be repeated at location TBA –More details in Thursday’s cs123 email

3 Lab 3 Overview Based on materials from Chapters 17 and 18 –Chapter 17 – Calculus and Optimization Develop an objective function for the minimum surface area of a can and find optimal dimensions (radius and height) using Maple’s Optimization feature –Chapter 18 – more Maple support for mathematical modeling Solving integration problems – finding the surface area of an irregularly shaped object Piecewise expressions – irregularly shaped curve consisting of a series of “piecewise” expressions Curve fitting using Splines – generating spline curves of various degrees to connect a series of data points

4 Lab 3 Overview Lab 3 outline –Problem 1 – Find the minimum dimensions of a can that holds a specified volume of liquid using Maple’s Optimization function Create an expression for the can’s surface area (objective function) to hold a constant volume of liquid Use the Maple Optimization function to find the minimum dimensions (radius and height) for the surface area –Problem 2 – finding the surface area of an irregularly shaped machine part Define top of object in terms of a series of piecewise expressions Bottom = a single expression Plot top, bottom expressions  shape of object Integrate (top – bottom)  area between curves

5 Lab 3 Overview Lab 3 outline –Problem 3 – Spline curve fitting to analyze the power of a baseball bat swing Given a table of times (seconds) versus power (hp), create and plot spline curves of degrees 1 through 4 Answer 4 questions using the results of the spline plots –Notes: –B. total energy transferred is the integral of the power curve –C. point of maximum power increase – take derivative of power curve and then find maximum (optimization)

6 Lab 3 Maple Concepts: Discussion and Demo Problem 1 – Maple’s Optimization feature –Creating the Objective function (surface area of a can) Surface area = lateral area + top and bottom SA = 2*pi*r*h + 2*pi*rsquared –Since the surface area needs to be a function of a single variable (eg. radius=r), we need to find an function relating h (height) to r and substitute. Since the volume is constant at 1000: 1000 = pi*rsquared*h  h = 1000 / (pi*rsquared) Substitute this equation for h into the SA equation above to obtain the objective function SA(r).

7 Lab 3 Maple Concepts: Discussion and Demo Problem 1 – Maple’s Optimization feature - continued –Now use this objective expression SA(r) to find the minimum surface area over a range of radii that holds a volume = 1000 –minRslt:=Optimization[ Minimize](objexpression,r=1..10) You will obtain 2 results minRslt[1]  minimum surface area minRslt[2]  radius that produces this minimum SA –Substitute minRslt[2] into the equation for h to obtain the associated height

8 Lab 3 Maple Concepts: Discussion and Demo Problem 2 – Area between 2 curves –Piecewise expressions Use clickable interface as opposed to textual I/F To add more than 2 piecewise expressions –Ctrl-Shift-R (PC) (Command=Shift-R for Mac) –Be sure to highlight each area and type over it –(not as “free-form” as you would like) – see demo –“otherwise” condition – can use to denote all other values not defined in piecewise expressions –Integration Indefinite integral  int(f(x),x)  generates function in terms of x Definite integral  int(f(x),x=a..b)  numeric result

9 Lab 3 Maple Concepts: Discussion and Demo Problem 3 – analysis of batter’s swing –Plot_structure:=CurveFitting[Spline] –(x values, y values, name for independent variable, degree=degree of Spline fit) –Ex. CurveFitting[Spline](T,p,t,degree=2) Will produce a Spline curve fit using quadratic piecewise expressions –Some Spline details Curve passes through all points (note that linear least squares curve fit produces a “best straight line estimate” for all points, and may possibly not pass through any point) A piecewise expression will be generated to connect each pair of adjacent points

10 Lab 3 – Maple Demo 1. Maple optimization logistics 2. Piecewise expression and integration 3. More on integration and differentiation 4. Curve fitting with Splines

11 Quiz Week (7) Activities Quiz 1 will be released on Friday (5/7) at 6 PM –Deadline: Wednesday (5/12) at 4:30 PM –Makeup quiz – from Thursday (5/13) at 9 AM through Sunday (5/16) at 11:30 PM 30% penalty Pre-lab 3 quizlet –From Thursday (5/13 – noon) through Monday (5/17 – 8 AM) Be sure to visit the CLC for quiz or general Maple assistance Tuesday, May 11 – Special Lecture – more details shortly


Download ppt "CS123 Engineering Computation Lab Lab 3 Bruce Char Department of Computer Science Drexel University Spring 2010."

Similar presentations


Ads by Google