Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Assume that water is pumped into an initially empty tank. The rate of flow of wa

ID: 3571187 • Letter: A

Question

Assume that water is pumped into an initially empty tank. The rate of flow of water into the tank at time t in seconds is (40-2t) liters per second. The amount of water Q that flows into the tank during the first x seconds can be shown to be equal to the integral of the rate of flow, evaluated from 0 to x seconds.

Write down a script that computes and displays the answers for the following questions:

(a) Determine the symbolic expression that represents the amount of water in the tank after x seconds.

(b) Determine the amount of water in the tank after 10 seconds.

(c) If the capacity of the tank is 400 liters, how long does it take to fill?

Can you please write the script in matlab!! I also would like if you could write the script so I could just rewrite it in my own matlab. Comments would be awesome as well! thank you

Explanation / Answer

% for comments
% 1sec.................40-2t litre

%xsec................. [40-2t]

%integrate 40-2t with limit o to x


a) 40*x-x^2;

%put x=10

b) amt_of_water=((40*10)-(10^2));
fprintf('amt of water%d',amt_of_water);

c)%400=40*x-x^2; find val of x x^2-40x+400

% so x=-b+-sqrt(d)/2a
% d=sqrt(b^2-4ac)

d=sqrt(-40^2-4*1*400);
fprintf("d%d",d);
% two val for x

x=(-*-40+sqrt(d))/2;
fprintf("val for x%d",x);

x=(-*-40-sqrt(d))/2;
fprintf("val for x%d",x);