0% found this document useful (0 votes)
4 views2 pages

Simulation 2

The document outlines a simulation lab focused on the fundamental equation of thermodynamics, specifically in the entropy representation. It includes two main problems: validating fundamental equations using MATLAB and finding the equilibrium state of a gas in a divided container. Submission instructions for code and a report are also provided, with deadlines specified for both.

Uploaded by

kushwahanirjala7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Simulation 2

The document outlines a simulation lab focused on the fundamental equation of thermodynamics, specifically in the entropy representation. It includes two main problems: validating fundamental equations using MATLAB and finding the equilibrium state of a gas in a divided container. Submission instructions for code and a report are also provided, with deadlines specified for both.

Uploaded by

kushwahanirjala7
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

CHE 221

Simulation Lab 2
Salman Ahmad Khan

28/1/2025

Fundamental equation of thermodynamics


The fundamental equation of thermodynamics in the entropy representation is: S(U, V, N ).
Here U is the internal energy, V is the volume, and N is the number of particles.
Recall you derived the following by maximizing the fundamental equation w.r.t to
different constraints:
 
∂S 1
= . (1)
∂U V,N T
 
∂S P
= . (2)
∂V U,N T
 
∂S µ
=− . (3)
∂N U,V T
Also recall the extensivity criterion:

λS(U, V, N ) = S(λU, λV, λN ) (4)


And finally the stability criterion that was discussed in yesterday’s class:
 2 
∂ S
≤ 0. (5)
∂X 2 Y,Z
Here X is U , V , or N , and Y and Z are the remaining two.

Problem 1: Properties of the fundamental equation


You are given 2 fundamental equations (fundamental1.p and fundamental2.p). These
functions can be accessed from a MATLAB script, for example as: fundamental1(S,V ,N ).
You have to determine which of these are valid fundamental equations. For this problem
assume that N is fixed and equal to 6.023 × 1023 . And limit your investigations to
1 ≤ U ≤ 10 and 1 ≤ V ≤ 10.

1. Plot S(U, V ) for both fundamental equations.

1
2. Determine if the fundamental equations give reasonable values of T and P . Write
a short comment in your MATLAB code about whether you get reasonable values of
T and P . Hint: Use MATLAB’s gradient function. See the demo codes.m file for
how to use the gradient function. (Report)

3. Check if the equations satisfy the extensivity criterion. Write a short comment in
your MATLAB code about the extensivity of the functions. Hint: You should think
abot calculating the difference between the L.H.S and R.H.S of e.q. 4. The abs()
and max() functions might be helpful here. (Report)

Note, we can similarly check for the stability criterion. But we are not doing that in
this exercise.

Problem 2: Finding the equilibrium state using the fundamental


equation
A container is divided into 2 chambers by a partition (chamber A and chamber B).
6.023 × 1023 particles of a gas are filled in chamber A and 12.046 × 1023 particles of the
same gas are filled in chamber B. The system has a total energy of 10J and the total
volume of the container is 10m3 . Initially, the energy and volume of chamber A are 4J
and 2m3 , respectively. Now the partition is made diathermal (can exchange energy) and
moveable (can exchange volume). The fundamental equation of the gas is given to you
as fundamental3.p.

1. Plot the total entropy of the system as a function of Ua and Va . Ua and Va are the
energy and volume of chamber A, respectively.

2. Find the values of Ua , Ub , Va , and Vb at equilibrium. You can visually do it but you
will be given full points for using fminunc. See the demo codes.m file for how to
use fminunc.

3. You do not have to answer this part (part 3) here with your code. Answer this in
the report. What will happen if the initial volume and energy of chamber A were
3J and 4m3 , respectively. (Report)

Code and report submission instructions


1. Upload your code as a single file on helloiitk. The format of the report is: ’name
rollnumber.zip’. This should be done in the lab. Unfortunately, the room is booked
after 5 pm for another lab. So the deadline to submit the code will be 4:50 pm.

2. Submit a short report answering questions marked with (Report) at the end. You
can submit the report by 11:59 pm today (28/01/2025).

You might also like