The problem must be done using matlab please help me with the code

thank you

The problem must be done using matlab please help me with the code

thank you

minVelocity=10;
maxCost=600;

The quantity must be produced using matlab

please aid me with the code

thank you

You are subtle a gravity-driven infiltrate tank practicable amid monetary require limitations. As shown in the controlm and pipe method to transmit infiltrate at the pristine speed underneath, the tank procure be built on hill at some culmination (2). The speed of infiltrate egressing the pipe must be at lowest 10 m/s. You bear $600 to bestow on the pipe, and the pipe requires $25 per meter control t meter. Write a MATLAB m-file to conclude the subjoined goals: he pristine I0 meters(and $15 per meter control cach concomitant 1. Calculate the speed of infiltrate egressing the pipe controlleleven equal-spaced values of z ranging rom 0 to 30 m. Originate a batch of infiltrate egress speed control z values manging frotn o k0m abel he as o 30 m. Label the axes, 3. Determine the hcight2 control which the egress speed is as-well dull and evince this culmination on the 4. Control each of the eleven equal spaced values of z, calculate the require of the pipe, and originate a 5. Determine the culmination z control which the pipe is as-well rich and evince this culmination on the batch including the redress units batch with a perpendicular thread made of 20 x’s. batch of pipe require vs, z. Label the axes, including redress units. with a perpendicular thread made of 20 o’S Turn in a printout of your completed m-file and the span batchs. z=0.9x Pipe Length . Egress Speed = V2gz

minVelocity=10;

maxCost=600;

price1=25;

price2=15;

g=9.81;

z=linspace(0,30,11);

exitVelocity=sqrt(2*g*z);

plot(z,exitVelocity);

xlabel(‘culmination of infiltrate tank(m)’);

ylabel(‘egress speed(m/s)’);

hold on

minVelZ=(minVelocity^2)/(2*g);

zLine=minVelZ*ones(1,20);

vLine=linspace(min(exitVelocity),max(exitVelocity),20);

plot(zLine,vLine,’x’);

pipeCost=zeros(1,11);

control i=1:11

x=z(i)/.9;

pipeLength=sqrt(x^2+(z(i))^2);

if pipeLength<=10

pipeCost(i)=price1*pipeLength;

else

pipeCost(i)=price1*10+(pipeLength-10)*price2;

end

end

figure(2)

plot(z,pipeCost)

xlabel(‘culmination of infiltrate tank(m)’);

ylabel(‘require of pipe($)’)

hold on;

maxLength=(maxCost-price1*10)/price2+10;

maxHeight=.9*maxLength/(sqrt(1+.9^2));

zLine2=maxHeight*ones(1,20);

cLine=linspace(min(pipeCost),max(pipeCost),20);

plot(zLine2,cLine,’o’)