One form of an equation to estimate a components heat capacity is: Cp=a+bT+cT-2 Using a switch structure write a main program m file in MATLAB which will call a user function named heatcap to calculate the heat capacity of any compound having the above form in which the coefficients a, b & c along with the temperature in Kelvin are passed to the function and the heat capacity is returned. The user should be prompted to enter a 1 or a 2 to select the type of loop used for the problem. When case 1 is selected a for loop should execute and when case 2 is selected a while loop should run to find the heat capacity for both Magnesium Oxide and Ferric Oxide for temperatures ranging from 300K to 900K in 50 degree increments. A header should be put outside the loop and then each time through the loop the values of heat capacity should be printed as shown below. Temperature(K) (Kelvin) 300 350 Cp-MgO (J/mol-K) Cp-Fe203 (J/mol-K) XX.X XX.X XX.X XX.X The program should also store the values of the heat capacity and temperature for both components into an array and then plot the heat capacity as a function of temperature on a single plot, which is labeled appropriately. Data Needed: MgO a =45.44 b=0.5008e-2 c=-8.732e5 Fe203 a =103.4 b=6.711e-2 c=-17.72e5;

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
One form of an equation to estimate a components heat capacity is:
Cp=a+bT+cT-2
Using a switch structure write a main program m file in MATLAB which will call a user
function named heatcap to calculate the heat capacity of any compound having the above
form in which the coefficients a, b & c along with the temperature in Kelvin are passed to the
function and the heat capacity is returned.
The user should be prompted to enter a 1 or a 2 to select the type of loop used for the
problem. When case 1 is selected a for loop should execute and when case 2 is selected a
while loop should run to find the heat capacity for both Magnesium Oxide and Ferric Oxide
for temperatures ranging from 300K to 900K in 50 degree increments.
A header should be put outside the loop and then each time through the loop the values of
heat capacity should be printed as shown below.
Temperature(K)
(Kelvin)
300
350
Cp-MgO
(J/mol-K)
Cp-Fe203
(J/mol-K)
XX.X
XX.X
XX.X
XX.X
The program should also store the values of the heat capacity and temperature for both
components into an array and then plot the heat capacity as a function of temperature on a
single plot, which is labeled appropriately.
Data Needed:
MgO
a =45.44
b=0.5008e-2
c=-8.732e5
Fe203
a =103.4
b=6.711e-2
c=-17.72e5;
Transcribed Image Text:One form of an equation to estimate a components heat capacity is: Cp=a+bT+cT-2 Using a switch structure write a main program m file in MATLAB which will call a user function named heatcap to calculate the heat capacity of any compound having the above form in which the coefficients a, b & c along with the temperature in Kelvin are passed to the function and the heat capacity is returned. The user should be prompted to enter a 1 or a 2 to select the type of loop used for the problem. When case 1 is selected a for loop should execute and when case 2 is selected a while loop should run to find the heat capacity for both Magnesium Oxide and Ferric Oxide for temperatures ranging from 300K to 900K in 50 degree increments. A header should be put outside the loop and then each time through the loop the values of heat capacity should be printed as shown below. Temperature(K) (Kelvin) 300 350 Cp-MgO (J/mol-K) Cp-Fe203 (J/mol-K) XX.X XX.X XX.X XX.X The program should also store the values of the heat capacity and temperature for both components into an array and then plot the heat capacity as a function of temperature on a single plot, which is labeled appropriately. Data Needed: MgO a =45.44 b=0.5008e-2 c=-8.732e5 Fe203 a =103.4 b=6.711e-2 c=-17.72e5;
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education