Sand Pit Utilization

Similar documents
AIMMS Function Reference - Date Time Related Identifiers

CIMA Asia. Interactive Timetable Live Online

INFORMATION TECHNOLOGY SPREADSHEETS. Part 1

Temperature Patterns: Functions and Line Graphs

DATE OF BIRTH SORTING (DBSORT)

Section 1.2: What is a Function? y = 4x

software.sci.utah.edu (Select Visitors)

How It All Stacks Up - or - Bar Charts with Plotly. ISC1057 Janet Peterson and John Burkardt Computational Thinking Fall Semester 2016

NMOSE GPCD CALCULATOR

INTERTANKO Vetting seminar 24 th October 2017

Undergraduate Admission File

CIMA Asia. Interactive Timetable Live Online

HPE Security Data Security. HPE SecureData. Product Lifecycle Status. End of Support Dates. Date: April 20, 2017 Version:

Grade 4 Mathematics Pacing Guide

Instructor training course schedule v3 Confirmed courses due completion by 31 st July 2019

INSPIRE. User Screen Guide: MST, Administrative

Designing Adhoc Reports

Excel Functions & Tables

This report is based on sampled data. Jun 1 Jul 6 Aug 10 Sep 14 Oct 19 Nov 23 Dec 28 Feb 1 Mar 8 Apr 12 May 17 Ju

Fluidity Trader Historical Data for Ensign Software Playback

I.A.C. - Italian Activity Contest.

ICT PROFESSIONAL MICROSOFT OFFICE SCHEDULE MIDRAND

All King County Summary Report

Contents:

CS Programming I: Arrays

SCI - software.sci.utah.edu (Select Visitors)

ADVANCED SPREADSHEET APPLICATIONS (07)

Designing Adhoc Reports

Conditional Formatting

Data Types. 9. Types. a collection of values and the definition of one or more operations that can be performed on those values

Seattle (NWMLS Areas: 140, 380, 385, 390, 700, 701, 705, 710) Summary

ACTIVE MICROSOFT CERTIFICATIONS:

Seattle (NWMLS Areas: 140, 380, 385, 390, 700, 701, 705, 710) Summary

Birthdates by Species 12,064. Beef Bison Dairy Sheep. Birthdates by Year

Seattle (NWMLS Areas: 140, 380, 385, 390, 700, 701, 705, 710) Summary

C Structures, Unions, Bit Manipulations, and Enumerations

Freedom of Information Act 2000 reference number RFI

Adding Three Fractions. Choosing the Best Graph

3. EXCEL FORMULAS & TABLES

CMIS 102 Hands-On Lab

OBJECT ORIENTED PROGRAMMING USING C++

Characterization and Modeling of Deleted Questions on Stack Overflow

For personal use only. Update Event & nearmap Solar

July RFC Editor Report. 69th IETF Meeting Chicago, Illinois. IETF 69 RFC Editor 1

App Economy Market analysis for Economic Development

Proven video conference management software for Cisco Meeting Server

Microsoft Technical Training Public Class Schedules Year 2019

Penetrating the Matrix Justin Z. Smith, William Gui Zupko II, U.S. Census Bureau, Suitland, MD

Aon Hewitt. Facts & Figures. March 2016 Update. Risk. Reinsurance. Human Resources. Empower Results

Unit 2-2: Writing and Graphing Quadratics NOTE PACKET. 12. I can use the discriminant to determine the number and type of solutions/zeros.

Statistical Tables and Graphs

Infectious Diseases Media Kit. The Journal of. Advertising & Sales Contacts. Useful Information. jid.oxfordjournals.org

Multi-part functionality in PINES

Monthly SEO Report. Example Client 16 November 2012 Scott Lawson. Date. Prepared by

Monthly Statistical Digest

CHAPTER 4 STOCK PRICE PREDICTION USING MODIFIED K-NEAREST NEIGHBOR (MKNN) ALGORITHM

CSE 341 Section Handout #6 Cheat Sheet

7 Sept 29-Oct 3. 8 Oct 6-10

CIMA Certificate BA Interactive Timetable

Scope and Sequence Mathematics Grade 2. 1st Quarter (43 Days)

CBERS-2. Attitude Control and its Effects on Image Geometric Correction. Follow up to TCM-06 INPE CBERS TEAM

Asks for clarification of whether a GOP must communicate to a TOP that a generator is in manual mode (no AVR) during start up or shut down.

UNIVERSITY OF CAMBRIDGE INTERNATIONAL EXAMINATIONS International General Certificate of Secondary Education

IAB Internet Advertising Revenue Report

Clinical Infectious Diseases

Financial Results for the Three Months Ended June 30, August 3, 2006

Stream Depletion Factor Model SDF View

Library. Summary Report

Array Creation ENGR 1181 MATLAB 2

RLMYPRINT.COM 30-DAY FREE NO-OBLIGATION TRIAL OF RANDOM LENGTHS MY PRINT.

Lecture 10: Boolean Expressions

Optimizing Field Operations. Jeff Shaner

Getting Information from a Table

Nigerian Telecommunications Sector

Information Extraction of Important International Conference Dates using Rules and Regular Expressions

San Joaquin County Emergency Medical Services Agency

Budget Transfers. To initiate a budget transfer, go to FGAJVCM (Journal Voucher Mass Entry). FGAJVCM

A Summary of the Types of Graphs Compiled by Mr. A. Caruso

Introduction. Structures, Unions, Bit Manipulations, and Enumerations. Structure. Structure Definitions

QLIKVIEW RECIPES. Byte size QlikView tips and tricks to solve real world business discovery and dashboarding problems.

Peak Season Metrics Summary

Troop calendar

Quarterly Sales (in millions) FY 16 FY 15 FY 14 Q1 $706.8 $731.1 $678.5 Q Q Q

SAS System Powers Web Measurement Solution at U S WEST

Peak Season Metrics Summary

DAS LRS Monthly Service Report

Notes Lesson 3 4. Positive. Coordinate. lines in the plane can be written in standard form. Horizontal

CS113: Lecture 3. Topics: Variables. Data types. Arithmetic and Bitwise Operators. Order of Evaluation

Statistical Charts and Graphs. June 1, 2012

Programming for Engineers Structures, Unions

FREQUENTLY ASKED QUESTIONS

South Platte Summary January Compiled by Lee Cunning, P.E.

The State of the Raven. Jon Warbrick University of Cambridge Computing Service

Tracking the Internet s BGP Table

Essentials. Week by. Week. All About Data. Algebra Alley

SAS Scalable Performance Data Server 4.3

ENGR Fall Exam 1 PRACTICE EXAM

TOWN MANAGER S WEEKLY REPORT

Interim Report Technical Support for Integrated Library Systems Comparison of Open Source and Proprietary Software

Nigerian Telecommunications (Services) Sector Report Q2 2016

Transcription:

Sand Pit Utilization A construction company obtains sand, fine gravel, and coarse gravel from three different sand pits. The pits have different average compositions for the three types of raw materials as shown in Table 1. Historical data for operation of the three sand pits have been processed to obtain the monthly total cubic yards of material extracted from each pit averaged over the last ten years. These data are summarized in Table 2. As an engineer working for the construction company, you are asked to process the data in Tables 1 and 2 to obtain some further quantitative and qualitative information concerning the usage of the three sand pits. Table 1 Composition of sand, fine gravel, and coarse gravel in three different sand pits. Sand () Fine Gravel () Coarse Gravel () Pit #1 55 30 15 Pit #2 20 50 30 Pit #3 25 20 55 Table 2 Monthly volume of material mined from each pit (thousands of cubic yards). Jan Feb Mar Apr May June July Aug Sept Oct Nov Dec Pit #1 10 12 15 25 28 36 39 42 43 36 26 14 Pit #2 16 19 23 31 35 45 49 55 55 46 28 18 Pit #3 8 10 12 22 27 40 45 52 48 45 25 10 We will use Matlab to help in this task. This simple demo illustrates how to obtain different kinds of information from data stored within a couple of arrays. In this case, the data from the two tables are entered into Matlab arrays and several manipulations are performed to obtain the desired information. The first step is to create the desired arrays from the tabular data, being careful to define precisely the data contained in the arrays. In this case, we will use two matrices, C and V, as follows: C(i,j) = fractional composition of component j in pit i. V(i,k) = cubic yards of material mined from pit i in month k. where the discrete i, j, and k indices refer to pit i, sand component j, and month k, respectively. These data arrays can be created in Matlab with the follows statements:

Applied Problem Solving with Matlab -- Sand Pit Utilization 2 >> C = [55 30 15; 20 50 30; 25 20 55]/100 composition information C = 0.5500 0.3000 0.1500 0.2000 0.5000 0.3000 0.2500 0.2000 0.5500 >> V = [10 12 15 25 28 36 39 42 43 36 26 14; volume information 16 19 23 31 35 45 49 55 55 46 28 18; 8 10 12 22 27 40 45 52 48 45 25 10]*1000 V = Columns 1 through 10 10000 12000 15000 25000 28000 36000 39000 42000 43000 36000 16000 19000 23000 31000 35000 45000 49000 55000 55000 46000 8000 10000 12000 22000 27000 40000 45000 52000 48000 45000 Columns 11 through 12 26000 14000 28000 18000 25000 10000 With these data available, we can now perform the following tasks: 1. Determine the yearly amount of material extracted from Pit #3. To do this we simply need to sum the values in the 3 rd row of the V matrix, or >> sum(v(3,:)) ans = 344000 2. Find the maximum and minimum amounts of fine gravel produced from all three pits and the month of the year where these occur. Since we are interested in fine gravel, we will be working with column 2 of the C matrix. However, if we transpose this, it becomes a 1x3 vector. Now, a 1x3 matrix giving the fraction of fine gravel by pit times a 3x12 matrix containing the total volume extracted by pit and month will yield a 1x12 array containing the total fine gravel produced by month, or >> A = C(:,2)'*V A = Columns 1 through 10 12600 15100 18400 27400 31300 41300 45200 50500 50000 42800 Columns 11 through 12 26800 15200 And now, Matlab s min and max commands can be used to find the desired information, >> [Amax,Imax] = max(a) Amax = 50500 Imax = 8 >> [Amin,Imin] = min(a) Amin = 12600 Imin = 1 Thus, the maximum monthly amount of fine gravel is about 50500 cubic yards and this occurs in the 8 th month (August). Similarly, the minimum occurs in January with only about 12600 cubic yards of fine gravel produced. Of course, these data can be verified from the original tables 3. Find the total amount of sand used in June, July and August. For this problem, we use the same logic as above, but use column 1 of the C matrix, since we are interested in the amount of sand. In addition, since we are only interested in the summer months,

Applied Problem Solving with Matlab -- Sand Pit Utilization 3 we only need to use a portion of the V matrix (months 6, 7, and 8). Now, doing the appropriate matrix multiplication directly within the sum command gives the desired result, or >> sum(c(:,1)'*v(:,6:8)) ans = 128400 In addition to the above quantitative results, you were also asked to produce some qualitative plots that illustrate utilization of the three sand pits. Creating plots is definitely easier to do within a Matlab script file, so we will abandon the use of the interactive command window and simply write a script file to do the remainder of the tasks. In fact, all the above commands were also put within the sand_pits.m file, as shown in Table 3, so that we have a complete record of the analysis. Running the program produces the following quantitative results (which match our interactive analysis from above): >> sand_pits Total amount of material from pit #3 (cubic yards): 344000 Max amount of fine gravel produced was 50500 cubic yards in Aug Min amount of fine gravel produced was 12600 cubic yards in Jan Amount of sand used in summer (cubic yards): 128400 Table 3 Program listing for sand_pits.m. SAND_PITS.M Obtain various data for a construction company using array and matrix operations This demo illustrates how to obtain several types of information from data stored within a couple of arrays. In this case, the data from two tables are entered into Matlab arrays and several manipulations are performed to obtain the desired information. Table 1: Composition of sand, fine gravel, and coarse gravel in three different sand pits C(i,j) = composition of component j in pit i Table 2: Monthly volume of material mined from each pit V(i,k) = cubic yards of material mined from pit i in month k Note: There are three components: 1 -> sand, 2 -> fine gravel, and 3 -> coarse gravel File produced by Prof. J. R. White, UMass-Lowell (April 2003) clear all, close all, nfig = 0; enter data from Tables 1 and 2 C = [55 30 15; 20 50 30; 25 20 55]/100; V = [10 12 15 25 28 36 39 42 43 36 26 14; 16 19 23 31 35 45 49 55 55 46 28 18; 8 10 12 22 27 40 45 52 48 45 25 10]*1000; composition information volume information 1. total yearly amount of material from pit number 3 fprintf(1,' Total amount of material from pit #3 (cubic yards): 8.0f \n',... sum(v(3,:))) 2. max and min amount of fine gravel produced and corresponding months A = C(:,2)'*V; gives vector by month of total fine gravel [Amax,Imax] = max(a); [Amin,Imin] = min(a); months1 = ['Jan'; 'Feb'; 'Mar'; 'Apr'; 'May'; 'Jun'; 'Jul'; 'Aug'; 'Sep'; 'Oct'; 'Nov'; 'Dec']; fprintf(1,' Max amount of fine gravel produced was 8.0f cubic yards in s \n',... Amax,months1(Imax,:)) fprintf(1,' Min amount of fine gravel produced was 8.0f cubic yards in s \n',... Amin,months1(Imin,:))

Applied Problem Solving with Matlab -- Sand Pit Utilization 4 3. total amount of sand used during June, July, and August fprintf(1,' Amount of sand used in summer (cubic yards): 8.0f \n',... sum(c(:,1)'*v(:,6:8))) 4. plot of total volume for each pit by month bar(v'),grid title('sand\_pits: Total Volume by Month for Each Pit') xlabel('month of Year'), ylabel('volume (cubic yards)') legend('pit #1','Pit #2','Pit #3') 5. plot of total sand, fine gravel, and coarse gravel by month bar(v'*c),grid title('sand\_pits: Total Volume by Month for Each Type of Sand') xlabel('month of Year'), ylabel('volume (cubic yards)') legend('sand','fine Gravel','Coarse Gravel') 6. create pie chart showing the fractional total volume by pit totvol = sum(sum(v)); pie(sum(v'),{'pit #1' 'Pit #2' 'Pit #3'}) title(['sand\_pits: Fractional Usage of Each Sand Pit (total ',... num2str(totvol,'10.2e'),' cubic yards)']) 7. create pie chart showing the fractional total volume by month months2 = {'Jan' 'Feb' 'Mar' 'Apr' 'May' 'June'... 'July' 'Aug' 'Sept' 'Oct' 'Nov' 'Dec'}; pie(sum(v),months2) title(['sand\_pits: Fractional Usage by Month (total ',... num2str(totvol,'10.2e'),' cubic yards)']) end of program As seen in Table 3, four different plots, using Matlab s bar and pie commands, are generated to show some general information about the utilization of the three sand pits. All four plots are included below in Fig. 1 and, collectively, they give a good picture of the sand pit usage by this particular construction company. Some interesting features in sand_pits.m that should be noted are identified as follows: 1. Notice that the transpose operator (the single quote) is used quite extensively in this file. This is often the easiest way to manipulate the arrays to give the desired result. However, to use it properly, you really need to understand the data contained in the arrays!!! 2. Note the different treatments for the months1 and months2 character arrays. The variable months1 is a regular 12x3 array with each character occupying one element of the matrix. For this case, the abbreviation for each month must have the same number of characters so that each row has the same number of elements. Also note that when we used this variable to edit the month of interest, all the columns for a given row were used to get the month s name -- such as months1(imax,:). Now, the use of the months2 cell array is completely different. A cell array is formed with the curly brackets ({ } instead of [ ]), and each string within single quotes makes up a single element. The array is a 1x12 row vector, where each element is a string that can have differing sizes. The pie command requires a cell array for its labels, so the format of months2 was required here. The two forms, months1 and months2, were used here to illustrate the differences, but the cell format for working with characters variables is often the best choice, since the string lengths do not have to be the same. The whos command after running sand_pits.m shows that months1 and months2 have a completely different structure, so clearly they must be used appropriately:

Applied Problem Solving with Matlab -- Sand Pit Utilization 5 >> whos Name Size Bytes Class A 1x12 96 double array Amax 1x1 8 double array Amin 1x1 8 double array C 3x3 72 double array Imax 1x1 8 double array Imin 1x1 8 double array V 3x12 288 double array months1 12x3 72 char array months2 1x12 798 cell array nfig 1x1 8 double array totvol 1x1 8 double array Well, this completes our current relatively simple example. The goal here was to illustrate how to use array indexing and various matrix operations (matrix multiplication and the transpose operation) to assist in the analysis of data stored in a couple of 2-D arrays. As part of the example, we also used Matlab s sum, max, and min commands as well as the bar and pie plotting functions. And we even got a brief introduction to the difference between character and cell arrays! Hopefully this example will add to your developing familiarity with Matlab, and help you use it in a variety of creative ways in solving even more complex problems Fig.1 Summary information concerning sand pit utilization.