Question: Please solve as a function using Matlab One form of an equation to estimate a components heat capacity is: Cp = a +bT + cT?

Please solve as a function using Matlab
Please solve as a function using Matlab One form of an equation

One form of an equation to estimate a components heat capacity is: Cp = a +bT + cT? 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 l 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) XX.X Cp-Fe203 (J/mol-K) 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 -8.732e5 Fe2O3 a = 103.4 b =6.711e-2 -- 17.72e5

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Chemical Engineering Questions!