Question

Problems 1. The following equation describes the process of warming a hot tub by adding hot water: IN-ISTART) where is the temperature of the water in the hot tub is the temperature of the water flowing into the hot tub, (130°F) is the initial temperature of the water in the hot tub (65°F) is the hot-water flow rate (5 gpm) is the volume of the hot tub (500 gallons), and is the elapsed time since the hot water started flowing TIN TSTART Create an x-y plot that shows how thehot tub water temperature (T) increases over time (t). Your temperatures should be plotted from 65°F up to 110°F. You may have to extend your time vector until it causes the temperature to exceed 110°F. Identify each major temperature data point (increments of 5°F) on your plot. Add a textual annotation to your plot that lists the approximate time at which the tubs water temperature first reaches 110°F. If the hot-water flow rate was increased to 10 gpm, how long would it take for the water temperature in the tub to reach 110℉? Again, you may have to extend your time vector until it causes the temperature to exceed 110°F Have MATLAB draw a second plot, representing this second set of data on the same graph as the first plot. Add a second textual annotation for the second plot. Include a legend that identifies each plot. a. b.

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

Please find required MATLAB code along with necessary details in comments below:

clear all; clc; close all;

t=[0:1:180]'; T_IN=130; T_start=65; Q=5; V=500;

% calcualte T for time t
for k=1:length(t)
T(k,:)=T_IN - (T_IN -T_start)*exp((-Q/V)*t(k,:));
end

idx=find(T>=110);
fprintf('It takes %d mins to reach temprature of 110 F.\n',t(idx(1)))
str=sprintf('Time taken to reach 110F');
h1=plot(t,T,'r-');
xlabel('Time (t)'); ylabel('Water Temprature (T)');
ylim([65 110]);

% normalize axis for annotation
xPlot=t(idx(1)); yPlot=T(idx(1));
axPos = get(gca,'Position'); %# gca gets the handle to the current axes
xMinMax = xlim;
yMinMax = ylim;
xAnnotation = axPos(1) + ((xPlot - xMinMax(1))/(xMinMax(2)-xMinMax(1))) * axPos(3);
yAnnotation = axPos(2) + ((yPlot - yMinMax(1))/(yMinMax(2)-yMinMax(1))) * axPos(4);

% mention annotation in graph
ta = annotation('textarrow', [xAnnotation xAnnotation-0.01], [yAnnotation yAnnotation-0.01]);
ta.String = str;


%% Part b
disp('With flow rate=10gpm');
Q=10;
% calcualte T for time t
for k=1:length(t)
T2(k,:)=T_IN - (T_IN -T_start)*exp((-Q/V)*t(k,:));
end

idx=find(T2>=110);
fprintf('It takes %d mins to reach temprature of 110 F.\n',t(idx(1)))
hold on
h2=plot(t,T2,'b-');
legend([h1,h2],{'Q=5','Q=10'}) % legend of the plot

% normalize axis for annotation
xPlot=t(idx(1)); yPlot=T2(idx(1));
axPos = get(gca,'Position'); %# gca gets the handle to the current axes
xMinMax = xlim;
yMinMax = ylim;
xAnnotation = axPos(1) + ((xPlot - xMinMax(1))/(xMinMax(2)-xMinMax(1))) * axPos(3);
yAnnotation = axPos(2) + ((yPlot - yMinMax(1))/(yMinMax(2)-yMinMax(1))) * axPos(4);

% mention annotation in graph
ta = annotation('textarrow', [xAnnotation xAnnotation-0.01], [yAnnotation yAnnotation-0.01]);
ta.String = str;

============================= SCREENSHOT OF CODE

main_Script.mX clear all clc: close all; t calcualte T for time t | for k=1 : length (t) T (k, : )=TIN- (T-IN -T-start) *exp ( (-Q/V) *t ( k, : ) ) ; end 10 idx=find (T>=110) ; fprintf(It takes %d mins to reach temprature of 110 F.\n,t(idx)) str=sprintf (Time taken to reach 110F); h1-plot (t,T, r- xlabel (Time (t) ylabel (Water Temprature (T) ylim ([65 110]): 12 13 15 16 17 normalize axis for annotatio XPlot=t (idx(1) ) ; yPlot*T (idx(1) ) ; axPos = get (gca, Position); gca gets the handle to the current axes xHinMax = x1im; yMinMax ylim; xAnnotation = axPos (1) + ( (XPlot - xMìnMax (1)) / (xMìnMax (2)-xMìnMax (1)) ) * axPos (3) ; y Annotation = axPos (2) + ( (yPlot - yMìnMax (1) ) / (yMìnMax (2)-yMìnMax (1) ) ) * axPos (4) ; 19 20 21 23 24 25 26 27- mention annotation in graph ta = annotation (text arrow , [xAnnotation ta. String 3tr; xAnnotation-0.01], [yAnnotation y Annotation-0.011);

========================================= SAMPLE OUTPUT

Add a comment
Know the answer?
Add Answer to:
Problems 1. The following equation describes the process of warming a hot tub by adding hot...
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
  • rewrite text in past tense Procedure-Simple Distillation 1. Take 60 ml of a 50:50 mixture of...

    rewrite text in past tense Procedure-Simple Distillation 1. Take 60 ml of a 50:50 mixture of cyclohexane and toluene and place in a round bottom flask. Make sure you add a few boiling chips. 2. Assemble the distillation apparatus (See Figure 2.) and start the water flowing through the condenser. Place a graduated cylinder under the bent adapter so that you can measure the volume of distillate you collect. 3. Begin heating the sample with a heating mantle until it...

  • Principles of Inorganic Chemistry! Week 5 Effect of Temperature on Solubility of a Salt In this experiment, you w...

    Principles of Inorganic Chemistry! Week 5 Effect of Temperature on Solubility of a Salt In this experiment, you will study the effect of changing temperature on the amount of solute that will dissolve in a given amount of water. Water solubility is an important physical property in chemistry, and is often expressed as the mass of solute that dissolves in 100 g of water at a certain temperature. In this experiment, you will completely dissolve different quantities of potassium nitrate,...

  • 1) Write a Reaction equation using 4- aminobenzenesulfulfonic acid (aniline derivative) and 8-ani...

    1) Write a Reaction equation using 4- aminobenzenesulfulfonic acid (aniline derivative) and 8-anilino-1-naphthalenesulfonic acid (coupling agent). Write the mechanism. SYNTHESIS OF AZO DYES INTRODUCTION Humans' love of color dates back almost to prehistoric times, yet it is not actually until the modern era that the full range of the rainbow has been accessible to the majority of people irn their clothes and other textiles. Ancient or medieval times have often been described as being quite splendid with their "tyrian purple"...

  • Process A. Preparation of 4-t-butylcyclohexene Assembling the equipment Fill the almost complete sand bath, place it...

    Process A. Preparation of 4-t-butylcyclohexene Assembling the equipment Fill the almost complete sand bath, place it on the base of the shelf, fix the thermometer with a clip and start heating until the temperature of the sand is - 110C. B. Mixing the reagents Using the plastic funnel, introduce 0.60-0.70 g of 4-t-butylcyclohexanol into a large, clean, dry test tube. Then add 10 drops of concentrated phosphoric acid, 3 drops of concentrated sulfuric acid and a pebble to moderate boiling....

  • What is the theoretical yield (in grams) and percent yield of your triphenylmethanol product in this...

    What is the theoretical yield (in grams) and percent yield of your triphenylmethanol product in this experiment? (Weight of triphenylmethanol: 0.060g) BACKGROUND AND THEORY The Grignard reaction was one of the first organometallic reactions discovered and is still one of the most useful synthetically. By reacting an organohalide (usually a bromide) with magnesium in ethereal solvent, carbon becomes a nucleophile. Grignard reagents are the starting points for the syntheses of many alkanes, primary, secondary, and tertiary alcohols, alkenes, and carboxylic...

  • CHEM 242L Exp. 4 Report/ Synthesis of Oil of Wintergreen Name Score: 20 1) Assess the effectivene...

    please answer all these questions, thank you. CHEM 242L Exp. 4 Report/ Synthesis of Oil of Wintergreen Name Score: 20 1) Assess the effectiveness of the experiment and your technique by A) reporting the yield of each step in grams and percent as well as the overall percent yield (What is "overall percent yield?). SHOW ALL CALCULATIONS! B) Give a complete analysis of the identity and purity of your final product and any isolated intermediates 2 What was the purpose...

  • 10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated...

    10. Write a one-page summary of the attached paper? INTRODUCTION Many problems can develop in activated sludge operation that adversely affect effluent quality with origins in the engineering, hydraulic and microbiological components of the process. The real "heart" of the activated sludge system is the development and maintenance of a mixed microbial culture (activated sludge) that treats wastewater and which can be managed. One definition of a wastewater treatment plant operator is a "bug farmer", one who controls the aeration...

  • I need help to write a nice introduction for experiment 6 please ( no hands write ) typing Thank you HEAT TREATMENT OF STEELS EXPERIMENT 6 EXPERIMENT 6 HEAT TREATMENT OF STEELS THEORY The Ef...

    I need help to write a nice introduction for experiment 6 please ( no hands write ) typing Thank you HEAT TREATMENT OF STEELS EXPERIMENT 6 EXPERIMENT 6 HEAT TREATMENT OF STEELS THEORY The Effect of Cooling Rate One of the most convenient methods for controlling the properties of a given steel, i.e., a steel whose composition is already fixed, consists of austenizing the steel and ten cooling to room temperature at some predetermined rate. A variation of cooling rates...

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