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

I need help with this matlab project. I need Function FIND_TANK (ASAP) and then

ID: 3349057 • Letter: I

Question

I need help with this matlab project. I need Function FIND_TANK (ASAP) and then function FIND_FAMILY(can wait). Thanks Rainwater Project Introduction The population of India is in the midst of a water shortage. The number of people with access to adequate water is decreasing as pollution makes some water sources unsafe for consumption, and the increasing population adds strain on the already limited water supplies. As a result, many people are turning to rooftop water collection systems to gather and store rainwater. They use a tank that catches rainwater from the roof and stores it for household use throughout the year. (Image from: http://www.circleofblue.org/waternews/2010/world/india- cities-focus-on-rainwater- harvesting-to-provide-clean-drinking-water/) Your task in this project is to create a MATLAB program to design a rainwater collection system for a region in India. India is subject to a severe monsoon season, where the majprity of the rainfall may fall in the 3-4 months of summer The user has two primary questions they need your program to answer for them: 1. "Since I know my family and roof size, what is the smallest tank volume I need so I can collect enough water to support my family for 36 months?" 2. "I have a tank of a specific size. How many people can my tank support for a full 36 months? Page 2 of 9 What does your program need to do? Your program will start from one function titled RUN_RAINWATER, which will call one of two other functionc nithor FDI TANK FIND FAMILY, depending o n which question the user wants to answer

Explanation / Answer

CODE:

function [N]= Findnumber(V,A)

prompt='What is the volume of the tank '

result=input(prompt);

V=result;

prompt='What is the area of the roof in m^2 '

result1=input(prompt)

A=result1;

sum=0;

water_needed=zeros(1,36);

month=[31 28 31 30 31 30 31 31 30 31 30 31];

matObj = matfile('variables.mat');

s=load('variables.mat');

%rainfall=struct2d(rainfall)

[maximum,I]=max([s.rainfall]);

%calculating for a year hence rainfall is periodic about a year

[mnthlyrf I]=sort(s.rainfall,'descend')

um=month(I); %um=updated month

for i=1:12

for j=1:2

um(i+12*j)=um(i);

mnthlyrf(i+12*j)=mnthlyrf(i);

end

end

for i=1:36

ratio(i)=mnthlyrf(i)/um(i);

[a I2]=min(ratio)

N=a*A/V/150*1000;

if N>1

N=floor(N)

disp('no. of persons supported')

disp(N)

else

water_demand(i)=s.wateruse/1000*um(i);

water_available(i)=mnthlyrf(i)*A/1000;

water_saved(i)=-water_demand(i)+water_available(i)+sum;

if water_saved(i) <0

water_needed(i)=-water_saved(i);

water_saved(i)=0;

else water_needed(i)=0;

end

sum=water_saved(i);

end

end

if N<1

V=max(water_needed);

disp('maximum voulme of tank needed in m^3');

disp(V);

x=1:36

plot(x,water_saved,'r',x,water_needed)

xlabel('month')

ylabel('volume')

end

end