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;

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section: Chapter Questions
Problem 8PP: (Statistical) In many statistical analysis programs, data values considerably outside the range of...
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
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,