Question
Using MATLAB and given the known values and the equation below 1. Create an array of time values ranging from t = 0 sec to
Using MATLAB and given the known values and the equation below
1. Create an array of time values ranging from t = 0 sec to t = 18,000 sec in steps of 1 sec. Using a vectorized operation, calculate an array of coffee temperatures that correspond to the given times. You may not use loops to accomplish this.
2. Calculate an array of temperature values one at a time using a loop. You may not use vectorized techniques to accomplish this.
3. Using either your results from Part 2(1) or Part 2(2), plot the temperature history vs. time. (If you completed Part 2 correctly, the results should be identical anyway.) Be sure to include a title, x -label, and y -label on your plot. Make your line a cyan dotted line, with square data markers.
4. Experiment with the time step size, allowing the time step to become larger and smaller. Calculate the wall time (i.e. the "real time") for runs of both the vectorized and loop-based approaches as you vary the time step size. Is one approach faster than the other? Does it depend on how big the data set is? Leave code for at least three numerical experiments in the project file you submit for a grade. Print your responses to these questions to a data file located on the desktop of the machine you are using; be sure to close that file when you are done.
In this case
Ta = 68 F
To = 180 F
K = 0.0719
Cup of coffee is made at 12:00 pm noon.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started