Академический Документы
Профессиональный Документы
Культура Документы
Problem Statement:
Determine the cost of gold plating the dome atop of the building that hosts the House of
Representatives when the dome is a prolate spheroid and has polar radius of 52 feet, an
equatorial radius of 42 feet, and gold is quoted at $500 per square foot.
Input/Output:
Input
o Equatorial radius (eq_rad) (42 Feet)
o Polar radius (pol_rad) (52 feet)
o Cost of gold (goldcost) ($500/sq.ft)
Output
o Cost of plating dome (total_cost)
o Total surface area of the dome (sa)
o Number of sheets required (num_sheets)
o The percent error if the dome had been a hemisphere, using the polar
radius as the radius of the hemisphere (error)
Hand Example:
How do you find the surface area of a prolate spheroid?
Algorithm Development
o User input of radii and gold cost
o Calculate surface area of prolate in square feet
o Multiply surface area by cost of gold
o Print result
Matlab Script
clc
clear
%use this program to find out the cost of plating the dome of the house of
%Rep. in gold.
%ask the user to input the equatorial and polar radii, along with the cost
%of gold
eq_rad=input('What is the equatorial radius in feet? ');
pol_rad=input('What is the Polar Radius in feet? ');
gold=input('What is the cost per sheet of gold? ');
%the numberof sheets must be rounded up to the nearest whole number because
%fractional sheets are probably not an option
num_sheets=ceil(sa);
%now we will calculate the percent error of square feet if the dome had been a
hemisphere,
%using the polar radius
hemi_1=(4*pi*pol_rad^2)/2;