Lab Test #1 v4

Lab Test #1 v4 - Assume that L = 10m and r = 5m Note Your...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
ECOR 2606 Lab Test #1 v4 (This problem adapted from problem 6.15 in the text) A horizontal cylinder contains some liquid. The volume of the liquid can be calculated using: L h rh h r r h r r V 2 1 2 2 ) ( cos where r = radius of cylinder (m) L = length of cylinder (m) h = depth of liquid (m) V = volume of liquid (m 3 ) Part I (3 marks): Write a function m-file (volume.m) that, given r , L , and h, computes and returns V . The depth of the liquid must be between 0 and 2 r . Have your function generate an error if this is not the case. Part II (7 marks): The steps required to solve this part should be placed in a script m-file (script.m).
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Assume that L = 10m and r = 5m. ** Note ** Your are expected to make use of the function you produced in part I instead of re-implementing the equation within your script file. If you find it necessary to re-implement the equation you may do so but students who do this will not earn full marks. i) Produce two plots (figures 1 and 2) of V vs h for h from 0m to 10m. Produce one plot using function fplot and the other using function plot ). ii) If the liquid has a volume of 300 m 3 how deep is it? Precisely determine the answer (graphical solutions are NOT acceptable) and output it using function fprintf ....
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online