Question

I need to create a loop that will run until an appropriate tank radius has been found that will hold the liquid under these conditions. The program needs to display the radius as an answer in the command window. Thank you

X tank3.m tank.m X tank2.m 1 - clear all,clc 3 4 r = 1; h = 10; F = 15; t = 120; % radius (m) % height (m) % flowrate (m3/min

clear all,clc

r = 1; % radius (m)

h = 10; % height (m)

F = 15; % flowrate (m^3/min)

t = 120; % time (min)

V_tank = pi * r^2 * h;

V_liq = F * t;

if V_liq > V_tank

fprintf('The tank will overflow, you need a container that is %f cubic meters larger.\n',V_liq - V_tank)

else

fprintf('The tank did not overflowed and still has %f cubic meters of available space.\n',V_tank - V_liq)

end

0 0
Add a comment Improve this question Transcribed image text
Answer #1


1 2 3 clc clear all r = 1; % radius (m) h 10; % height (m) F = 15; % flowrate (m3/min) t = 120; % time (min) 4 5 6 7- 8 9 10

Add a comment
Know the answer?
Add Answer to:
I need to create a loop that will run until an appropriate tank radius has been...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • How can I get my while loop to run until my condition in my if statement...

    How can I get my while loop to run until my condition in my if statement is met? (In MATLAB) clc%clears screen clear all%clears history close all%closes all files format long %Euler's Method %Initial conditions and setup %Projectile motion x=3;%randi(3); y=3;%randi(3); figure('color','white'); plot(x,y,'bo'); hold on wind = (-10 + 20*rand(1)); fprintf('The wind speed is %2.2i\n',wind); v0= input('Initial velocity(m/s): '); a= input('Angle of projection(in degrees): '); a=a*pi/180; h=.01; cd=.1; %cdy=.1; %cdx=(rand*2-1)/2; %cdy=(rand*2-1)/2; m=1.5; g=9.8; %acceleration due to gravity in m/s^2 %td=2*v0*sin(a)/g;...

  • Create a code that performs the following actions: l. Define the flow rate and height of tank 2./ Have the user input a value for radius 3./ Ask the user for a value of many minutes the tan...

    Create a code that performs the following actions: l. Define the flow rate and height of tank 2./ Have the user input a value for radius 3./ Ask the user for a value of many minutes the tank should fill for 4. Clear the command window (clc) after all of the input commands are given 5. Call in a "tank solver" function that performs the following Takes F, h, r, and t final as inputs, and there are no variable...

  • MATLAB! part (b) find h A spherical tank of radius R meters is to be used...

    MATLAB! part (b) find h A spherical tank of radius R meters is to be used to hold fluid. You are given a stick to dip into tank, and you want to calibrate the scale on it such that it reads the volume of fluid in the tank. (a) Find the equation whose solution determines the height of the fluid for a given volume V. Provide details of your work. (b) For R = 3 and a sample volume V...

  • 8) A charge Q is at the very center of a circular wire loop of radius...

    8) A charge Q is at the very center of a circular wire loop of radius R carrying a current I. The charge is moving upwards with a speed v. ע What is the magnetic force on the charge Q (Magnitude and Direction)? 9) An insulated container contains V liters of hot water at temperature T. If M kg of ice at 0 °C is added to the water, what is the temperature of the system when it reaches equilibrium?...

  • i have 15 :) R 13) Two flat circular plates of radius R are a distance...

    i have 15 :) R 13) Two flat circular plates of radius R are a distance d apart. The bottom plate has a uniform charge +Q and the top plate has a uniform charge - Q. What is the electric field on the top surface of the bottom plate? 20 14) For the plates described in question 13, what is the total electric potential at the bottom surface of the top plate? B 15) A rectangular conducting loop of length...

  • i only need 7 and 9 6. Find the muzzle speed of the ball a. 5.52...

    i only need 7 and 9 6. Find the muzzle speed of the ball a. 5.52 m/s b. 4.17 m/s c. 6.34 m/s d. 4.88 m/s 7. From the following graph you can find theof an object in motion, which has a e. 7.23 m/s f. None of These magnitude of Velocity vs Time 16 14 12 10 0 Time(s) a. Displacement, 15 m e. Displacement, 2.5 m f. Final Velocity, 2.5 m/s g. Initial Acceleration, 2.5 m/s h. None...

  • I need the answer for QUESTION 4 not 3. 4. Consider your answer to the previous...

    I need the answer for QUESTION 4 not 3. 4. Consider your answer to the previous problem (part a). Assume m1 = 4.00 kg, m2 = 2.00 kg and the pulley has a radius of R = 6.00 cm and a mass M = 3.00 kg. The magnitude of the frictional torque exerted on the pulley is 0.500 N.m. (a) Starting from rest, how long does it take for the 4.00 kg block to reach the floor, which is 1.0...

  • I 2) A uniform solid ball has a mass of 20 g and a radius of...

    I 2) A uniform solid ball has a mass of 20 g and a radius of 5 cm. It rests on a horizontal surface. A sharp force is applied to the ball in the horizontal direction 9 cm above the surface. The force rises linearly from 0 to a peak value of 40,000 N in 10-* s and then decreases linearly to o in another 10- s. (The moment of inertia for a solid ball ismR?) a) What is the...

  • Introduction to Engineering I Spring 2019 MATLAB Homework Assignment 1 a) Create a matrix called ...

    help wanted? Introduction to Engineering I Spring 2019 MATLAB Homework Assignment 1 a) Create a matrix called d from the third column of matrix a. (Hint, typing d 22: 5: 821 b) Combine matrix b and matrix d to create matrix e, a two-dimensional matrix with three rows c) Combine matrix b and matrix d to create matrix f, a one-dimensional matrix with six rows and d) Create matrix g from matrix a and the first three element of matrix...

  • i need help converting this code to java please #include<stdio.h> typedef struct{ int pid,at,bt,ct,tat,wt,f; }process; int...

    i need help converting this code to java please #include<stdio.h> typedef struct{ int pid,at,bt,ct,tat,wt,f; }process; int main() { int n,i,j,st=0,c,tot=0,pno=0,swi=0; float atat=0,awt=0; printf("enter no of processes : "); scanf("%d",&n); process a[n],temp; for (i=0;i<n;i++){ a[i].pid=i+1; a[i].f=0; printf("enter at : "); scanf("%d",&a[i].at); printf("enter the bt : "); scanf("%d",&a[i].bt); printf("--------------------------- "); } while(1){ int min=999,c=n; if (tot==n) break; for (i=0;i<n;i++){ if ((a[i].at<=st)&&(a[i].f==0)&&(a[i].at<min)){ min=a[i].at; c=i; } } if(pno!=a[c].pid) swi++; if (c==n) st++; else{ a[c].ct=st+a[c].bt; st=st+a[c].bt; a[c].tat=a[c].ct-a[c].at; atat=atat+a[c].tat; a[c].wt=a[c].tat-a[c].bt; awt=awt+a[c].wt; a[c].f=1; tot++; } } printf("...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT