Q:

In thermodynamics, the Carnot efficiency is the maximum possible efficiency of a heat engine operating between two reservoirs at different temperatures. The Carnot efficiency is given as

0

In thermodynamics, the Carnot efficiency is the maximum possible efficiency of a heat engine operating between two reservoirs at different temperatures. The Carnot efficiency is given as

where C T and H T are the absolute temperatures at the cold and hot reservoirs, respectively. Write a script “carnot” that will prompt the user for the two reservoir temperatures in Kelvin, call a function to calculate the Carnot efficiency, and then print the corresponding Carnot efficiency to 3 decimal places. Also write the function. 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

carnot.m

% Calculates the Carnot efficiency, given the temps

% of cold and hot reservoirs, error-checking both

Tc = input('Enter the cold reservoir temperature: ');

Th = input('Enter the hot reservoir temperature: ');

carnotEff = calcCarnot(Tc, Th);

fprintf('The Carnot efficiency is %.3f\n',carnotEff)

calcCarnot.m

function eff = calcCarnot(Tc, Th)

eff = 1 - (Tc/Th);

end

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now