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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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