Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The objective of this MATLAB exercise is to model a system and mathematically solve that model to predict the systems behavior. You will also play

The objective of this MATLAB exercise is to model a system and mathematically solve that model to predict the systems behavior. You will also play around with the parameters of the model to see how it can affect the results and accuracy of the simulation. In this case we will model and simulate a transient energy balance problem. This problem specifically is chosen where an algebraic solution is not attainable calculus or numerical simulation must be used. In this case we are solving a problem where the change in a variable is dependent on the value of that variable. Examples of this are compounding interest, or geometric growth of populations, and equilibrium processes. Analytical solutions to such problems are often attainable using calculus, but using a computer to attain a numerical solution is also possible and often can handle a large variety of complexities of problems than analytical solutions. In this activity the problem to be addressed is related to energy conservation and particularly predicting how long it takes something to cool. Consider a hot cup of coffee (or other hot beverage) cooling down in the room. From your prior experience, common sense and without formal training you probably know the temperature initially decreases quickly and then slowly approaches the ambient temperature. The temperature does not decrease at a constant rate and does not get lower than the ambient temperature. Formally we might say the amount (or rate of heat transfer), Q is not a constant, but rather depends on the temperature of the system. Or more specifically it depends on the temperature difference between the system and its surroundings. Stay in school and you might learn to write this as Q=hA(T-Ts) where T is the system temperature, Ts is the temperature of the surroundings, A is the surface area of the system, and h is the heat transfer coefficient. To be even simpler we can lump terms together and say: Q=U(T-Ts), where U is an overall heat transfers coefficient. This is pretty close to what is called Newtons Law of Cooling (circa 1701, that Newton guy got around). For a coffee cup h is about 20 W/m2 K, and U for a simple approximation would depend on the exposed area (cup sides and liquid top). In a more detailed analysis h would depend on the material of the cup, ambient air currents, and a lot of other things. In this problem we will just say U = 2 W/K. Lets use Newtons law of cooling in an energy accounting of the coffee cup.

From the Beginning universal accounting equation:

Elater Enow = Ein Eout +Egenerated Econsumer Simplify and expand by taking into account

1) Energy is conserved (Egenerated = Econsumed = 0) Elater Enow = Ein Eout

2) Energy can cross the boundary with mass or as work or heat Elater Enow = Win + Qin + min*ein Wout Qout mout*eout

3) The system is closed the evaporated coffee is negligible Elater Enow = Win + Qin Wout Qout

4) There is no work being done and we are assuming the coffee is hotter than the surroundings and heat flows out Elater Enow = Qout

5) The system energy is the sum of internal energy, kinetic and potential energy. The coffee isnt moving so PE and KE are out. Ulater Unow = Qout

6) Changes in internal energy are proportional to changes in temperature (over small temperature ranges) using the specific heat constant. mc(Tlater Tnow) = Qout

7) Lumped model of the system where coffee and cup are the same temperature and uniform in temperature. Some properties mcoffee = 8 oz = 0.25 kg, ccoffee = 4.2 kJ/kgK, mcup=0.1 kg , ccup = 1.4 kJ/kgK for the whole system mcoffeeccoffee + mcupccup = mc m = 0.35 kg, c = 3.4 kJ/kgK (the weighted average)

8) Newtons Law of Cooling Q=U(T-Ts), so Qout = U(TTs)dt

dt is some increment of time Ts , the temperature of the surroundings, is probably constant (lets say 25o C)

But What T do we use Tnow or Tlater ??

When the time increment, dt, is really small Tnow and Tlater are pretty much the same. We kind of know Tnow and want to find Tlater so lets go with Tnow for T. mc(Tlater Tnow) = U(TnowTs)dt We can solve for Tlater in terms of things we know: Tlater = Tnow U(TnowTs)dt/(mc) We can then use this Tlater as the new known temperature and calculate the next temperature one time step dt further along. And so on. And so on. And so on. Until the coffee is at room temperature. At this point we can think about updating or subscripts. Tnow = Tt=0 Tlater = Tt=dt Tlaterlater = Tt=n*dt this would occur if we did this n times. This sounds like something that could be done in a loop when the next value in a loop depends on the prior one. T(i+1) = T(i) or maybe T(i) = T(i1) Problem 1: [50 points] Work in pairs (2) to do this in MATLAB. Start with a time increment dt of 60 seconds. Calculate the temperature out for about 45 minutes. The initial temperature, To, is 90 C. Plot temperature as a function of time.

Problem 2: [50 points] Vary dt and see how you solution changes. Also check how long it takes your solution to run using the tic and toc commands. Also try dt = 5 minutes and dt = 1 sec. What value of dt is the best? Which is the fastest to calculate. Which is probably closest to reality? Make a single plot with Temperature plotted as a function of time for 4 different time steps as series (dt = 0.1, 1, 60, and 300 seconds)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management Systems Designing And Building Business Applications

Authors: Gerald V. Post

1st Edition

0072898933, 978-0072898934

Students also viewed these Databases questions