Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I'm a beginner in matlab, and I am attempting to solve an equation for a water tank (seen below). I have written my own code

I'm a beginner in matlab, and I am attempting to solve an equation for a water tank (seen below).

image text in transcribedI have written my own code and part of it is working well but I am having trouble with my last 'else' statement, when d

image text in transcribedIt's line 9 that is incorrect. I am supposed to be writing a formula for the volume of water in the tank when the water is in the cone, and the radius of the cone can be taken to be the depth of the water. I am having a lot of trouble fixing the formula, and any suggestion to help me fix it would be greatly appreciated.

Courses LMS Integration Documentation Engr 240 W20 > Assignment 2 > (10 points) Problem 2.2 - Water tank O solutions submitted (max: Unlimited) A water tank is designed with a conical section and a cylindrical section and all dimensions related to the radius, R, as shown in the figure below: R- Write a function that accepts the depth, d, of the water and the characteristic dimension, R, and calculates the total volume of water stored in the tank. Your function should calculate the volume correctly regardless of the depth and return a value of 999 for the case when d > 3R (i.e. the tank is overflowing). Supplemental Deliverables (2 points): For supplemental deliverables, you do not need to run your code in Matlab Grader. You have to turn in a hard copy of what is asked. Use the function to calculate the volume as a function of d for R = 1.5 and d ranging from 0 to 4.5 in increments of 0.3. Print your results for volume vs. depth (values and plot). Function Reset MATLAB Documentation W NP function volume = tank(d, R) if d>3*R volume=999; elseif dR volume=pi*(R^2)*(d-R)+(pi/3)*(R^3); else d

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spomenik Monument Database

Authors: Donald Niebyl, FUEL, Damon Murray, Stephen Sorrell

1st Edition

0995745536, 978-0995745537

More Books

Students also viewed these Databases questions

Question

What is job rotation ?

Answered: 1 week ago