Function in a second array

Assignment Help Mathematics
Reference no: EM13927488

Question 1: A containing tank is to be constructed that will hold oil when filled. The shape of the tank is to be a cylinder (including a base) surmounted by a cone (i.e., with a conical top). The cone's height is always equal to its radius which is also the radius of the cylinder. The cost to construct the cylinder portion of the tank is $300 per square meter while the cost for the cone portion is $400 per square meter. Write a function that takes two inputs (TotalVolume and r) and calculates and displays the total cost of constructing the tank. For this problem, when TotalVolume = 500 and r=5.0, the result should be: $112,280. Use the variables listed below. "pi" is a predefined number. Name your function Tank1.m

TotalVolume = Vcone + Vcylinder
Vcone = 1/3(pi*r*r*r)
Vcylinder = pi*r*r*h, where h is height of the cylinder
SAcone = pi*r*r*sqrt(2)
SAcylinder = 2*pi*r*h
SAcylinderbase = pi*r*r

Question 2: Add the following feature to your solution - instead of entering the radius, solve for the optimum radius and plot the cost as a function of the radius, stepping the radius from 1.0 - 7.0 in steps of 0.1. For this problem, TotalVolume = 500. Note that TotalVolume should still be an input to your function, and that you should use 500 as your input value when you call it in the command window. Output the optimal radius and the lowest cost it produces. Hint: you may want to store the radii values in an array and the output from your function in a second array. Name your function Tank2.m.

Question 3: Add the following feature to your solution - change the cost structure to allow discounts as follows - for the cylindrical portion of the tank, the cost is $300 per square meter up to and including 200 square meters. Any part of the cylindrical surface area in excess of 200 square meters gets discounted 10%. Similarly, the cost of the conical portion of the tank is $400 per square meter up to and including 100 square meters. Any part of the conical surface area in excess of 100 square meters gets discounted 20%. Note that the discount is only applied to the excess surface area. As in the previous step, solve for and plot the cost as a function of the radius for a volume of 500, stepping the radius from 1.0 - 7.0 in steps of 0.1. Note that TotalVolume should still be an input to your function, and that you should use 500 as your input value when you call it in the command window.   Output the optimal radius and the lowest cost it produces. Name your function Tank3.m.

Question 4: Now, create a new function by placing Tank3.m in a loop with user inputs for minimum volume, maximum volume, and volume increment, i.e., 500, 1000, 100, and output the optimal radius and cost at that radius. Make a single plot showing the curves for all the volumes - each curve representing a single distinct volume. Name your function Tank4.m.

Reference no: EM13927488

Questions Cloud

Quantitative variable the telephone number of individual : An example of a quantitative variable is the telephone number of an individual. If we examine some of the population measurements, we are conducting a Sample of the population.
Write a matlab script using the randn command : Write a Matlab script using the "randn" command to generate a vector of 10,000 random numbers that are normally distributed around zero, with a variance of 1. Use the "hist" command to plot a histogram of these data, specifying 50 bins.
Chasing chipmunks in the front yard : The author's cat enjoys chasing chipmunks in the front yard. In this game, the cat sits at one edge of a yard that is w = 29 m across (see figure), watching as chipmunks move toward the center.
Asteroid from earth center : An asteroid passes Earth over its equator. Pictures are taken of it from Earth's north and south poles simultaneously. In these pictures, the position of the asteroid differs by 10°. How far away was the asteroid from Earth's center when the pictu..
Function in a second array : Output the optimal radius and the lowest cost it produces. Hint: you may want to store the radii values in an array and the output from your function in a second array. Name your function Tank2.m.
Compute the overall effect using matlab : Compute the overall effect using Matlab for placebo, intravenous, and intrathecal morphine treatments using (i) trapezoidal quadrature method and (ii) Simpson's method. The integral should be separated into two different integrals, since from t=0-..
Employee performs under the employment agreement : An employer has a duty to indemnify, or compensate an employee for any losses suffered as a result of authorized legal acts that the employee performs under the employment agreement.
Identify unilever strengths, weaknesses, opportunities : Assess Unilever's mission statement. How effectively do you think Unilever's mission statement establishes the company's direction and important values? What changes, if any, would you recommend, and why?
Program to advance minorities within the corporation : The increase in teamwork today is a function of all of the following EXCEPT:

Reviews

Write a Review

Mathematics Questions & Answers

  Find what is the probability of getting at least one

What is the probability of getting at least 1 diamond in a 5-card hand dealt from a standard 52-card deck? 2. In a family with 3 children, excluding multiple births, what is the probability of having 2 boys and 1 girl, in any order? Assume that a b..

  Explain arithmetic or geometric sequence

to convey the addition of S(sub1) and S(sub2) in this way. Is T(sub1) an arithmetic or geometric sequence

  What is the most conservative estimate of the sample size

Assuming that the results of a preliminary survey are not available. What is the most conservative estimate of the sample size that would limit the margin of error to within 0.05 of the population proportion for a 95% confidence interval?

  Compute the demand function

A manufacture has been selling 1500 television sets a week at 450 each. A market survey indicates that for each 29 rebate offered to a buyer, the number of sets sold will increase by 290 per week.

  State a tissue culture grows until maximum rate of growth

A tissue culture grows until it has an area of 9 cm^2. A(t) is the area of the tissue at time t. One model for the growth rate is A'(t)=k*sqrt(A(t))*(9-A(t)) for some constant k. The number of cells on the edge is proportional to sqrt(A(t)) and mo..

  Find its instantaneous velocity function

if a stone is thrown down at 120 feet per second from a height of 1000ft, its height after t seconds is given by s=1000-120t-16t^2. Find its instantaneous velocity function.

  What are the sensitivity limits for the constraints

Linear programming - What are the sensitivity limits for the constraints

  What is the maximum area of each pasture

A rancher has 3,600 linear feet of fencing and wants to enclose a rectangular field and then divide it into two equal pastures with an internal fence parallel to one of the rectangular sides. What is the maximum area of each pasture?

  Determine the total amount the bells will pay for house

Determine the total amount the Bells will pay for their house and how much of the cost will be interest

  Determining reciprocal function

The Rule of 70 is a mathematical approximation that calculates how long it takes for a value to double. Examples are as varied as finding how long it takes the Gross Domestic Product to double

  Classify the discontinuities

Problem 2: Locate and classify the discontinuities of f when

  Percentage in amount of standard deviations

For the normal distribtion, the mean plus and minus 1.96 standard deviation will include what percent of the observations? What is the formula to calculate the percentage?

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