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

Determining The Work of The Thermodynamic System in Polytropic Processes PV Const

The document describes a Matlab project to determine the work done by a thermodynamic system in polytropic processes where pVk=constant. Students are asked to write a program that allows a user to select between polytropic, isothermal, or isochoric processes, input initial pressure, volume and number of moles, plot the P-V graph, and calculate the work done symbolically. The program output should include an explanation of the code and the code itself verified to run properly in Matlab.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views2 pages

Determining The Work of The Thermodynamic System in Polytropic Processes PV Const

The document describes a Matlab project to determine the work done by a thermodynamic system in polytropic processes where pVk=constant. Students are asked to write a program that allows a user to select between polytropic, isothermal, or isochoric processes, input initial pressure, volume and number of moles, plot the P-V graph, and calculate the work done symbolically. The program output should include an explanation of the code and the code itself verified to run properly in Matlab.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Applied Physics Department, FAS, HCMUT Matlab Projects – Physics 1

Project 7:
Determining the work of the thermodynamic system in polytropic
processes pVk=const.
1. Content
The work of an ideal gas thermodynamic system in a polytropic process is defined as follows:

With k = 0: isobaric process, k = 1: isothermal process, k = : adiabatic process; k = : isochoric


process. This project requires students to use Matlab to represent the graph (P, V) of the above
processes from given P and V values and thereby calculate the work done by the processes.

2. Requirements
1) Students should have basic programming knowledge of MATLAB.
2) Learn about symbolic calculation and graphical interpretation in MATLAB.

3. Tasks
Write Matlab program to:
1) Enter data for number of gas moles n, initial pressure P0, initial volume V0.
2) Create a button to select the process (polytropic, isothermal, isothermic or exit) and enter
values of P and V for selected process. (You can refer to the command line below or create a
GUI interface)
3) Draw a graph of the above process on the scale (P, V).
4) Use symbolic operations to calculate the work of selected process.
Note: Students can use other non-symbolic approaches.
Submitting report has to contain text explaining the content of the program and the entire code
verified to run properly in Matlab.

4. References:
A. L. Garcia and C. Penland, MATLAB Projects for Scientists and Engineers, Prentice Hall,
Upper Saddle River, NJ, 1996. http://www.algarcia.org/fishbane/fishbane.html. Or
https://www.mathworks.com/matlabcentral/fileexchange/2268-projects-for-scientists-and-
engineers

%@ Select type of path (isobar, isochore or isotherm) or quit


iPoint = iPoint + 1; % Next point
fprintf('For leg #%g \n',iPoint-1);
PathType = menu(sprintf('Leg %g: Select next path',iPoint-1), ...
'Isobar (Constant P)', 'Isochore (Constant V)', ...
'Isotherm (Select new V)','QUIT');

%@ If the next path leg is an isobar (Constant P)


if( PathType == 1 )
close(gcf); % Close the figure window
%@ Determine the new volume, pressure and temperature
V(iPoint) = input('Enter new volume: ');
P(iPoint) = P(iPoint-1); % New pressure same as old pressure
T(iPoint) = P(iPoint)*V(iPoint)/(nMoles*R); % New temperature
%@ Compute the work on done an isobar
W = P(iPoint)*( V(iPoint) - V(iPoint-1) );
%@ Add volume and pressure to plot data

1/1
Applied Physics Department, FAS, HCMUT Matlab Projects – Physics 1

VPlot = [VPlot V(iPoint)]; % Add points to volume data for plotting


PPlot = [PPlot P(iPoint)]; % Add points to pressure data for plotting

%@ else if the next path leg is an isochore (Constant V)


elseif( PathType == 2 )
close(gcf); % Close the figure window
%@ Determine the new volume, pressure and temperature

1/2

You might also like