blob: 7bdffa0a4425181f5f1acdb6a9cf4855cd4bc17a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
clc
clear
//INPUT
t1=373;//temperature in K
t2=273;//temperature of sink in K
q=10^4;//heat taken at higher temperature in cal
j=4.2*10^7;//joules constant in ergs/cal
//CALCULATIONS
w=q*j*(t1-t2)/t1;//work done in ergs
//OUTPUT
mprintf('work done is %3.2f ergs',w)
|