Ask your own question, for FREE!
Computer Science 27 Online
OpenStudy (anonymous):

water volume in the reservoir as a function of time V(t)=10^9 + 10^8*(1-e^(-t/100)) - r*t where V is the water volume in liters, t is time in days and r is the town's consumption rate in liters per day. Write 2 user defined functions. The first function should define the function V(t) for use with the fzero function. The second duction should use fzero to compute how long it will take for the water volume to decrease to x percent of its initial value of 10^9 L. The inputs to the second function should be x and r. Test your functions for the case where x = 50 percent and r = 10^7 L/day.

OpenStudy (anonymous):

Its a mathlab question, I'm having some trouble it

OpenStudy (anonymous):

function f= fun(t) global r f=(10^9)+(10^8)*(1-exp(-t/100))-(r*t);

OpenStudy (anonymous):

then

OpenStudy (anonymous):

global r r=10^7; x=50/100; c2=(-x*(10^9)); c1=10^9; c0=[c2,c1]; t=fzero('fun',c0)

OpenStudy (anonymous):

but then i get

OpenStudy (anonymous):

??? Error using ==> fzero at 260 Function values at interval endpoints must be finite and real. Error in ==> test at 18 t=fzero('fun',c0)

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!