Write a function called coffee that takes no input variables

Assignment Help Computer Engineering
Reference no: EM132154794

Question :

Suppose that you are given an 8 ounce cup of coffee at 90°C and a 1 ounce container of cream at 20°C. You have learned from bitter experience that the hottest coffee you can drink comfortably is 60°C.

Assuming that you take cream in your coffee, and that you would like to start drinking as soon as possible, how long you should wait before adding the cream so that the coffee is 60°C?

To answer this question, you have to model the cooling process of a hot liquid in air and the mixing of liquids at different temperatures.

Hot coffee transfers heat to the environment by conduction, radiation, and evaporative cooling. Quantifying these effects individually would be challenging and unnecessary to answer the question as posed.

As a simplification, we can use Newton's Law of Cooling :

dy/dt = -r(y - T)

where y is the temperature of the coffee as a function of time and dy/dt is its time derivative; T is the temperature of the environment, which is a constant in this case (20°C), and r is a parameter (also constant) that characterizes the rate of heat transfer. Let's assume that r = 0.001 1/s.

In general, the final temperature of a mixture depends on the specific heat of the two liquids. But if we make the simplifying assumption that coffee and cream have the same density and specific heat, then the mixed temperature, ymix, is just a volume-weighed average

ymix = (v1*y1 + v2*y2)/(v1 + v2),

where v1 and v2 are the volumes of the liquids, and y1 and y2 are their temperatures.

To create a matlab program to solve this problem, use the following steps:

1) Create an M-file named coffee.m and write a function called coffee that takes no input variables and returns no output value.

2) Add a function called rate_func that takes inputs t and y and computes g(t,y) based on the above cooling rate formula, where y is the temperature of the coffee at a particular point in time. Notice that in this case g does not actually depend ont; nevertheless, your function has to take t as the first input argument in order to work with ode45.

Test your function by adding a line like rate func(0,90) to coffee, the call coffee from the Command Window.

3) Once you get rate _func(0,90) working, modify coffee to use ode45 to compute the temperature of the coffee (ignoring the cream) for 60 minutes. confirm that the coffee cools quickly at first, then more slowly, and reaches room temperature (approximately) after about an hour.

4) Write a function called mix_func that computes the final temperature of a mixture of two liquids. It should take the volumes and temperatures of the liquids as inputs and return the temperature of the mixture. Add code to coffee to testmix_func.

Reference no: EM132154794

Questions Cloud

Write a program that will open a blastn : Write a program that will open a BLASTN (nucleotide to nucleotide search) output file, parse out specific information.
How many passes would be required to complete the sort : If you were to use a bubble sort to re-sort these elements into descending order, how many passes would be required to complete the sort?
Design a program should contain a class : If the user indicates that they are not a member, they should be prompted to enter their information for registration.
How digital platforms used to increase market penetration : MIK 304 & MEB 301 E-MARKETING STRATEGIES ASSIGNMENT - Give details on how digital platforms can be used to increase market penetration
Write a function called coffee that takes no input variables : Create an M-file named coffee.m and write a function called coffee that takes no input variables and returns no output value.
How cool ninjas and how they would like to become a ninja : Ninja Tactics Now that your friend is one the path to becoming a ninja, it's time for them to learn about some of the sneaky tactics that ninjas employ.
Write a method to remove all of the elements in list : Write a method to remove all of the elements in list of Integers that are less than some target value.
Write a program that generates a sequence of numbers : Uppercase Conversion Write a program that converts a string containing up to 256 lowercase characters to uppercase.
Would the greedy algorithm remain optimal for giving change : TV anchor Greta Van Susteren suggested that we should leave Jackson on the $20 bill and instead create a new $25 bill featuring Tubman.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Choose the employee''s last name

Group employees by salary within their job code: choose the employee's last name and group them by salary within their job_title_code.

  What are the nine border styles make in css

define how to combine multiple border attributes into one style declaration, using the example of an 8-point red dashed border.

  Make functionwill add one to each element in array of size

Write down the following C++ routines using pointers only. Do not use any [] 's in your code.

  Display the result in a table view

Create a single page application that allows the user to input a city name and use services to call the above URL to retrieve a five day forecast.

  Select a card randomly from the stack

There is a stack of10cards, each given a different number from1to 10. Suppose we select a card randomly from the stack, replace it, and then randomly select another card. What is the probability that the first card is an even number and the second..

  Difference between clustered and nonclustered indexes

define the meaning of each of the transaction levels supported by SQL Server.

  What is the identification process of emerging technology

What is the Identification process of Emerging Technology and How is it applicable to Aqua Pharm? Explain the Innovation Specification and the Path of Emerging.

  Creating a secure messaging app from scratch

Creating a secure messaging app from scratch using all the principles learned from the mistakes of current products by emphasizing security.

  Define issues involve in protecting organization information

Discuss the issues involved in protecting all of the organization's information. How might an organization notify its users that all communications are being.

  Investigate the use of web services for the construction

discuss the statement "In the near future, Web application development will be dominated by Web Services, and we can envisage a time when most web application development will involve just the calling of existing Web Services".

  Describe the solution that you built

Describe the solution that you built and how it was used in your analysis (i.e. did you create a "what-if" scenario, use Solver or Scenario Manager, etc.).

  Find a boolean expression for the boolean function

A threshold gate represents a Boolean function. Find a Boolean expression for the Boolean function represented by this threshold gate.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd