MATLab +Follow Requirements+ Mechanical engineers, as well as most other enginee
ID: 2086113 • Letter: M
Question
MATLab
+Follow Requirements+
Mechanical engineers, as well as most other engineers, use thermodynamics extensively in their work. The following polynomial can be used to relate the zero-pressure specific heat of dry air cp in kJ/(kg K) to temperature in K: Ep?0.99403+1.671 × 10-4T+ 9.7215 × 10-8T2 -9.5838 × 10-11T3 + 1.9520 x 10-14T4 Write a MATLAB program to plot ep versus a range of T-0 to 1200 K, and to determine the temperature that corresponds to a specific heat of 1.1 kJ/(kg K) using MATLAB polynomial Requirement: Use 50 points for T when generating your plot Must use a function handle for cp Must determine cp one element at a time using a for loop When determining what temperature, T is the answer for the second part, use matlabs isreal function inside a loop (where the loop goes through each root one at a time) to determine if the value is real and if it is greater than zero. If these are both true you have the answer After determining T for the second part of the assignment output the results as follows: The temperature corresponding to a specific heat of #.4 kJ/(kg K) ?s #.## K. 1. 2. 3. 4. 5. Solution: The tenperature corresponding to a specific heat of 1.1 kJ/ (kg K) is 544.09 K Zero-pressure Specific Heat of Dry Air Tamporatune (K)Explanation / Answer
clear all;clc
t=linspace(0,1200,50);
cp=0.99403+(1.671*10^-4*t)+(9.7215*10^-8*t.^2)-(9.5838*10^-11*t.^3)+(1.9520*10^-14*t.^4);
plot(t,cp)
fp=fit(cp',t','poly2');
t_at=feval(fp,1.1);
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.