Calculate the cost of shipping a package

Assignment Help Other Engineering
Reference no: EM131225421

- All work is to be submitted as a SINGLE pdf document report. Your document should contain all the MATLAB script (including comments), the solutions generate by MATLAB, and graphs that you were asked to produce. You MUST use print screen method to show the MATLAB solution.

- Your code must be clear and simplify

- Use the template provided

- Each M-file must start include your name, student ID, and Question No.

- For the analytical, you may write your solution in A4 paper and scan it. Then, insert as picture into word document. OR you may type your solution in the word document.

- Name your file: yourname - Assign 2

- All your work must be presented in neat and tidy manner.

- Marks will be given according to the quality of documentation.

- You MUST submit your assignment electronically through moodle under Assignment 2 section.

- Late submission will be penalized (10% per day).

- Answer all the questions

- Good luck

Section A

Question 1

Write a MATLAB script that calculates the cost of shipping a package according to the following price schedule.

Type of service

Weight

0 - 0.5 lb

0.5 - 5 lb

More than 5 lb

Ground

(5 - 7 Days)

 

$0.70 + $0.06/oz

$1.18 + $0.42 for every additional

0.5 lb (or fraction)

$4.96 + $0.72 for every additional 0.5 lb (or fraction)

Express

(3 - 4 Days)

 

$2.40 + $0.25/oz

$4.40 + $1.20 for every additional

0.5 lb (or fraction)

$15.20 + $1.80 for every additional 0.5 lb (or fraction)

Overnight (One Day)

 

$12.20 + $0.80/oz

$18.60 + $4.80 for every additional

0.5 lb (or fraction)

$61.80 + $6.40 for every additional 0.5 lb (or fraction)

The program asks the user to enter the type of service (Ground, Express, or Overnight) and the weight of the package (two number. the first number for pounds and the second number for ounces). The program then displays the cost for the shipment. Run the program for continuous for three times to calculate following cases:

(a) Ground 3 lb 8 oz

(b) Express 0 lb 6 oz

(c) Overnight 6 lb 11 oz

Given that: 1 lb = 16 oz

Question 2

The handicap differential (HCP) for a round of golf is calculated from the formula:

HCP = ((Score - Course Rating)/course Slope ) x113

The course rating and the slope are measures of how difficult a particular course is. A golfers handicap is calculated from a certain number N of their best (lowest) handicap scores according to the Table 1.

For example, if 13 rounds have been played, only the best five handicaps are used. A handicap cannot be computed for the fewer than five rounds. If more than 20 rounds have been played, only the 20 most recent results are used.

Once the lowest N handicap differentials have been identified, they are averaged and then rounded down to the nearest tenth. The result is player's handicap.

(a) Write a MATLAB program in a script file that calculates a person's handicap. The program asks the user to enter the golfers record in a three columns matrix where the first column is the course rating, the column is the course slope, and the third is the player's score. Each row corresponds to one round. The program displays the person's handicap, the number of rounds have been played and the three column matrix.

Write a report to explain the method you are using.

(b) Execute the program for the players with the following records

(i)

Rating

Slope

Score

72.2

119

71

71.6

122

73

74.0

139

78

68.2

125

69

70.2

130

74

69.6

109

69

66.6

111

74

(ii)

Rating

Slope

Score

71.6

122

85

72.8

118

87

69.7

103

83

70.3

115

81

70.9

116

79

72.3

117

91

71.6

122

89

70.3

115

83

72.8

118

92

70.9

109

80

73.1

132

94

68.2

115

78

74.2

135

103

71.9

121

84

72.2

119

71

71.6

122

73

74.0

139

78

68.2

125

69

70.2

130

74

69.6

109

69

66.6

111

74

71.4

107

72

Question 3

A railway wagon, moving with velocity v, strikes a viscously damped buffer. The equation of motion is given by:

m - dv/dt = -cv

Where v(t) is the velocity of the wagon at time t. Assume that the values of the mass m, damping c, and initial velocity v(0) as m = 5000 kg, c = 15000 Ns/m, and v(0) = 3 m/s

(a) Write a MATLAB code to calculate the velocity of the wagon at t = 2 second by using 4th order Runge-Kutta method, Euler Explicit and Euler Implicit. All plots must be plotted in the same figure. Start with the step size of 1. Your code must show the velocity with respective time for all three methods in the command window.

(b) Repeat your calculation in (a) with another two step sizes, i.e., 0.5 and 0.1. Discuss your solutions.

Section B

Question 1

Each of the two tanks shown in Figure 1 contain 100 gallons of water. The water in tank 1 contains 1000 grams of dissolved salt, while the water in tank 2 contains 100 grams of dissolved salt. At time t = 0, pipe 1 starts pumping pure water at the rate of 10 gallons/minute, while pipes 2, 3, and 4 start pumping mixed water at rates 15, 5, and 10 gallons/minute, respectively, in the directions indicated in Figure 1. The concentration of the tanks 1 and 2 are represent by the following differential equations:

dx/dt = 5/100y - 15/100x

dy/dt = 15/100x - 15/100y

where x(0) = 1000, y(0) = 100, x(t) is the amount of salt in tank 1 at time t, and y(t) is the amount of salt in tank 2 at time t

1275_Figure 1.jpg

Figure 1 - Two connected tanks with dissolved salt

(a) Apply 4th order Runge-Kutta (RK) method to find the concentration of the salt in the tanks at t = 3 mins with the step size of 1 (solve manually).

(b) Write a MATLAB code to find the concentration of the salt in the tanks at t = 50 mins with the step size of 1. List out all the RK solutions and plot the graph.

(c) Using the code in part (b), find the time (in 2 decimal places) when the concentration of both tanks are same by showing it in the graph.

(d) Using the same code in part (b), find the time (in 2 decimal places) when the concentration of both tanks is below 2. Display clearly your solution in the graph.

Reference no: EM131225421

Questions Cloud

Where is the point of equilibrium and what does it determine : How society manages its scarce resources and benefits from economic interdependence
Demonstrate five qualities that characterize a pioneer : Break down the sorts of individuals that work at Google, as for the business society of the association. Demonstrate five qualities that characterize a pioneer at Google, and decide the run of the mill foundation of a Google representative.
How would you use selected software to track client services : Identify the benefits of using this software to centralize electronic client records and human services resources. How would you use the selected software to track client services? Describe the advantages or disadvantages (if any) of using the softwa..
What is the stream present value : Consider the following stream of cash flows: $500 paid today, $950 paid two years from today, and $775 paid three years from today. At an APR of 6.0% compounded every two months, what is the stream's present value?
Calculate the cost of shipping a package : ASSIGNMENT - ENG 2314 / ENG60104 - Write a MATLAB script that calculates the cost of shipping a package and how difficult a particular course is. A golfers handicap is calculated from a certain number N of their best handicap scores.
Determine the small signal parameters for q1 and q2 : From the quiescent values, determine the small-signal parameters for Q1 and Q2. - Using nodal analysis, determine the small-signal closed-loop current gain Ai f = io/is.
Discuss a current policy debate that you have started : Discuss a current policy debate that you have started to tune into more since this course started. Explain why you seem to be following it more closely and what you seem to be focused more on having taken this class.
What coping skills may help the client remain sober : What coping skills may help the client remain sober? What new activities could the client participate in to help replace old behaviors such as going out with his friends, for a drink, etc. after work?
Exploration of future inventions inspired by the product : Review the processes of invention and innovation. Then, select a new product that you have been introduced to in the past 12 months. Research this new product using outside sources. You must also choose a company that produce and/or sell this prod..

Reviews

Write a Review

Other Engineering Questions & Answers

  Analyse a proposed redesign of dehavilland vampire tail

Your task will be to analyse a proposed redesign of the de Havilland Vampire tail booms (not to be confused with a boom in your hand calculations) in an all metal configuration

  What are the corresponding prototype velocities

If velocities at the crest and toe of the model spillway are determined to be 1 ft/s and 8 ft/s, respectively, what are the corresponding prototype velocities? Use the Froude law.

  Describe how you would make this judgment

Does the reported summary give enough information for you to judge whether the individualized dosing is, on the whole, accurate in its prediction of peak concentration? If so, describe how you would make this judgment. If not, describe what additi..

  Determine horizontal force on the end plate of the channel

Determine the horizontal force on the end plate of the channel. Ignore friction, but do not ignore the upstream approach velocity.

  What is the elevation of the curve at station

The station of the PVI is 233 + 40 with elevation 1203 ft. What is the elevation of the curve at station 234 + 00?

  Problem regarding the material handling

Shown in the figure below is a layout of an existing warehouse. One-way aisles are 8ft wide, while two-wayaisles are 16 ft wide (Direction of one-way aisles are depicted with arrows).

  What is the distance between m and p in km

Four branches of a company are located at M,N,O, and P. M is north of N at a distance of 4 km; P is south of O at a distance of 2 km; N is southeast of O by 1 km. What is the distance between M and P in km?

  Writing down a truth table for the state transition function

We can construct state machines like the ones in Worksheet 6 by writing down a truth table for the state transition function. The inputs to the state transition function are the state variables Si

  Analyze what would happen if an element was weak or nonexist

Include specific examples of how the Elements of Power interact together to promote national security. Analyze what would happen if an element was weak or nonexistent. Assess how the elements of national power conflict with each other.

  About satellite communication

Justify the circumstances in a business situation in which you would use GEOS, LEOS, and MEOS.

  Draw the per-unit sequence networks

Three identical transformers, as described, are connected with their primaries in Y (solidly grounded neutral) and with their secondaries and tertiaries in Δ. Draw the per-unit sequence networks of this transformer bank.

  Best side lobe attenuation expected under constraints

The requirements for the frequency resolution of the system specify that the largest allowable main lobe for the Kaiser window is p/100. What is the best side lobe attenuation expected under these constraints?

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd