blob: 222526ca67670cac25df90519261b0626ff10fec (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
//example 5.14
clear;
clc;
//Given:
n=1;//no. of moles
T=300;//temperature[K]
V1=2;//initial volume[m3]
V2=20;//final volume[m3]
R=8.314;//Universal gas constant[J/K/mol]
//To find the work function or Helmholts free energy
A=-n*R*T*log(V2/V1);//Change in work function[J/mol]
printf("The change in Helmholts free energy is %f J/mol",A);
|