kill(all)$

maxima :appendix extensive properties thermodynamics,version 1.0
peter.vlasschaert@gmail.com,08/09/2020

load packages, option
==================

load(lrats)$ratprint:false$

ref :https://en.wikipedia.org/wiki/Intensive_and_extensive_properties
extensive properties:V=volume,U = Internal energy,H = Enthalpy ,
                                    G= Gibbs free energy,S = Entropy
                                    C[V] = Heat Capacity, C[P] = Heat Capacity 

Extensive Properties
===================

→ math

f ,homogeneous of degree n.
======================

p1:f(x*λ,y*λ,z*λ)=λ^n*f(x,y,z);

p11:args(rhs(p1));

p111:args(p11[1]);

1e) set : u,v,w
===========

p1a:[u,v,w];

p1b:args(lhs(p1));

p1c:map("=",p1a,p1b);
p1c1:makelist(rhs(p1c[i])=lhs(p1c[i]),i,1,length(p1c));

depends(p1a,λ);

2e)  differentation ,p1
=================
use :1e

p1d:lratsubst(p1c1,p1);

→ rhs

p1da:diff(rhs(p1d),λ);

→ lhs

p1db:sum(diff(lhs(p1d),p1a[i])*diff(p1a[i],λ),i,1,length(p1a));

→ lhs = rhs

p1dc:p1db=p1da;

3e) back substitution
================

p1e:lratsubst(p1c,p1dc);

p1e1:makelist(part(lhs(p1e),i,1)=
    part(lhs(p1e),i,1,1,1),i,1,length(p111));

p1e2:lratsubst(p1e1,p1e);

4e) set  λ=1
================

first property
==========

p1f:lratsubst([λ=1],p1e2);

5e) set n=1
================

p1g:lratsubst([n=1],p1f);

6e) differentation : 'total differential of both sides '5e'
========================================

→  rhs

p1h1a:diff(rhs(p1g));

p1h1aa:[K,M,N];

p1h1b:makelist(part(p1h1a,i,1)=p1h1aa[i],i,1,length(p111)) ;

p1h1c:lratsubst(p1h1b,p1h1a);

→ lhs

p1i:lratsubst(p1h1b,lhs(p1g));

p1i1:diff(p1i);

→ lhs =rhs  <=>  lhs - rhs =0

p1i2:p1i1-p1h1c=0;

p1i3:makelist(rhs(p1h1b[i])=lhs(p1h1b[i]),i,1,length(p111));

second property
=============

p1i4:lratsubst(p1i3,p1i2);

E = 'Energy ( set : n=1 into p1)'
========================

E = energy = T*S -p *V +sum(n[i]*mu[i],i,1nc)
===================================
E                 =[ K*J/K]-[N*m]+ [J ]= [J ]
---------------------------------------------------------------
rem : G = H -T*S [J], Gibbs free energy

a) Thermodynamica : intensive  properties : p=pressure , T =temperature,mu[i] =potential
b)                                  extensive properties:  E ( = energy),'see list above'
====================================================================


first property 
===========

→  E(λ*n[i]) = λ *E(n[i])  'see list above' 
----------------------------------------------------------------
=>  T *S(λ*n[i])  = λ*T*S[n[i]]
=>  p*V(λ*n[i])  = p*λ*V(n[i])
-----------------------------------------------------------------
result : E(λ*S,λ*V,λ*n[i]) = λ E(S,V,n[i])

 second property 
=============

→ E =  T*S -p *V +sum(n[i]*mu[i],i,1nc)
----------------------------------------------------------------
result :S*dT-V*dp+sum(n[i]*del(mu[i]),i,1nc) = 0
=> Gibbs-Duheim Equation (T,P =constabt)
result :sum(n[i]*del(mu[i]),i,1nc) = 0
----------------------------------------------------------------
----------------------------------------------------------------
dT = del(T), dp = del(p),...........