Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For the example of the concentration of tracer in a completely mixed reactor that we did in class, write a VBA program that will calculate

image text in transcribed

For the example of the concentration of tracer in a completely mixed reactor that we did in class, write a VBA program that will calculate both the exact analytical answer and approximate numerical answer using the values provided on the 1st worksheet ("Problem #1") in the indicated columns from t = 0 to t = 3 minutes. Read the values for V, Q, C0, C(t=0) and dt from the indicated cells on the worksheet.

Use functions to calculate:

the analytical value of c

the value of dc/dt

Remember that for the analytical solution, c = c0*(1 - e(-Q/V*t))

For the numerical solution, recall that

ci+1 = ci + dc/dt * dt

dc/dt = Q/V*c0 - Q/V*ci

You do NOT need to use any arrays or use a separate subroutine to output your results.

Try using different values for dt and see how smaller time steps affect the accuracy of the numerical solution.

Problem #2

Newton's law of cooling says that the temperature of an object changes at a rate proportional to the difference between its temperature and that of the surrounding medium (the ambient temperature). So the change in temperature of an object with respect to time can be written as:

dT/dt = -k(T - Ta)

where: T = the temperature of the object t = elapsed time k = the proportionality constant Ta = the ambient temperature

Use this relationship to numerically estimate the temperature of my cup of coffee cooling over time while sitting on my desk on the 2nd worksheet ("Problem #2") using the indicated values for T(t=0), k, Ta and dt from 0 to 10 minutes.

(Hint: you should be able to reuse your program from above without too much modification) BONUS POINT!

Show off your calculus skills to find the exact analytical solution to the above ODE, and output the exact answer from your program as well!

Problem #1 For the example of the concentration of tracer in a completely mixed reactor that we did in class, write a VBA program that will calculate both the exact analytical answer and approximate numerical answer using the values provided on the 1st worksheet ("Problem #1") in the indicated columns from t 0 to t = 3 minutes. Read the values for V, Q. CO, C(t=0) and dt from the indicated cells on the worksheet. Use functions to calculate: the analytical value of c . the value of dc/dt Remember that for the analytical solution, c co (1 eave) For the numerical solution, recall that Ci+1 Ci+ dc/dt dt You do NOT need to use any arrays or use a separate subroutine to output your results. Try using different values for dt and see how smaller time steps affect the accuracy of the numerical solution. Problem #2 Newton's law of cooling says that the temperature of an object changes at a rate proportional to the difference between its temperature and that of the surrounding medium (the ambient temperature). So the change in temperature of an object with respect to time can be written as: where: T-the temperature of the object t- elapsed time k- the proportionality constant Ta the ambient temperature Use this relationship to numerically estimate the temperature of my cup of coffee cooling over time while sitting on my desk on the 2nd worksheet ("Problem #2") using the indicated values for T(t=0), k, Ta and dt from 0 to 10 minutes. (Hint: you should be able to reuse your program from above without too much modifcation) BONUS POINT Show off your calculus skills to find the exact analytical solution to the above ODE, and output the exact answer from your program as wel! Problem #1 For the example of the concentration of tracer in a completely mixed reactor that we did in class, write a VBA program that will calculate both the exact analytical answer and approximate numerical answer using the values provided on the 1st worksheet ("Problem #1") in the indicated columns from t 0 to t = 3 minutes. Read the values for V, Q. CO, C(t=0) and dt from the indicated cells on the worksheet. Use functions to calculate: the analytical value of c . the value of dc/dt Remember that for the analytical solution, c co (1 eave) For the numerical solution, recall that Ci+1 Ci+ dc/dt dt You do NOT need to use any arrays or use a separate subroutine to output your results. Try using different values for dt and see how smaller time steps affect the accuracy of the numerical solution. Problem #2 Newton's law of cooling says that the temperature of an object changes at a rate proportional to the difference between its temperature and that of the surrounding medium (the ambient temperature). So the change in temperature of an object with respect to time can be written as: where: T-the temperature of the object t- elapsed time k- the proportionality constant Ta the ambient temperature Use this relationship to numerically estimate the temperature of my cup of coffee cooling over time while sitting on my desk on the 2nd worksheet ("Problem #2") using the indicated values for T(t=0), k, Ta and dt from 0 to 10 minutes. (Hint: you should be able to reuse your program from above without too much modifcation) BONUS POINT Show off your calculus skills to find the exact analytical solution to the above ODE, and output the exact answer from your program as wel

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 Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

What are the basic financial decisions ?

Answered: 1 week ago

Question

What is meant by 'Wealth Maximization ' ?

Answered: 1 week ago

Question

LO4 List options for development needs analyses.

Answered: 1 week ago