Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
Question 2 [ 6 5 marks ] The pressure vessel of the Figune Q 2 - a wil be used to store some pressurized fluid
Question marks The pressure vessel of the Figune Qa wil be used to store some pressurized fluid and should be manufactured using the minimum arnount of material possible, while holding a fotal volume The amount of material used is proportional to the surface area of the vessel, while the inner radius of the vessel should be equin to one third of the outer radius Figure Qa Pressure vessel dimensionsy b marks The function should receive the following input arguments: and return the total surface area. Use the tests below to verify the correctness of the derived expression. In # YOUR COOE HERE raise NotImplementedError In : #Rwn this cell to test your answers for question b from unittests mport vesselareatest vesselareatest vesselarea In : c marks Write a program that evaluates the surface area of the vessel for different values of the radius and angle storing the values that result in the minimum for all angles between and at intervals. The following variable names should be used to store the above quantities. Name Description rvalues List containing all values tested for tho radius: theravalues List containing all values tosted ror une angle in degreas. areapin Minimum surface of the vessel. Forin Radius of the vesseil resuitung to the minimum surtace area. thetarin Angle resulting to the minimum surface area. ratse NotImpdementedError import in Limpy as np impont meth If inalues. not in istobas : raise Valweenror'rvalues s not defined' assert type rvalues is ilet, "rvalues should be a Iisk? if "chetavalue:: not in Lobal : raise ValueErrorthetavaluef is not defined" If areanin. not in BrobaI : raise ValueEror' areahin is not defined'
Question marks
The pressure vessel of the Figune Qa wil be used to store some pressurized fluid and should be manufactured using the minimum arnount of material possible, while holding a fotal volume The amount of material used is proportional to the surface area of the vessel, while the inner radius of the vessel should be equin to one third of the outer radius
Figure Qa Pressure vessel dimensionsy
b marks The function should receive the following input arguments:
and return the total surface area. Use the tests below to verify the correctness of the derived expression.
In # YOUR COOE HERE
raise NotImplementedError
In : #Rwn this cell to test your answers for question b
from unittests mport vesselareatest
vesselareatest vesselarea
In :
c marks
Write a program that evaluates the surface area of the vessel for different values of the radius and angle storing the values that result in the minimum for all angles between and at intervals. The following variable names should be used to store the above quantities.
Name Description
rvalues List containing all values tested for tho radius:
theravalues List containing all values tosted ror une angle in degreas.
areapin Minimum surface of the vessel.
Forin Radius of the vesseil resuitung to the minimum surtace area.
thetarin Angle resulting to the minimum surface area.
ratse NotImpdementedError
import in Limpy as np
impont meth
If inalues. not in istobas :
raise Valweenror'rvalues s not defined'
assert type rvalues is ilet, "rvalues should be a Iisk?
if "chetavalue:: not in Lobal :
raise ValueErrorthetavaluef is not defined"
If areanin. not in BrobaI :
raise ValueEror' areahin is not defined'
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started