Question: ( 3 ONLY FOR CONTEXT SOLVE 4 PLS ) Assume H 2 behaves as an ideal gas with constant specific heat. A 3 m 3
ONLY FOR CONTEXT SOLVE PLS Assume H behaves as an ideal gas with constant specific heat. A m
rigid tank holds H at
kPa and K The gas is cooled down to K Without using mematlab,
determine the final pressure kPa and the heat transfer of the system kJ
Pfhand,Qhand hwpartc
Pfhand kPadouble final pressure
Qhand kJdouble heat transfer during the process
Repeat Part C but this time with mematlab. Observe the difference between this
approach and the previous manual calculation.
Pflib,Qlib hwpartc
Pflib kPadouble final pressure
Qlib kJdouble heat transfer during the process
NON EDITABLE CODE PART:
Part C
NOTE: finish the local functions for each subproblem in the FUNCTIONs SECTION
fprintf
Part C
;
fprintf
;
TimliqTfWsys hwpartc;
fprintfInitial temperature Ti g K
Ti;
fprintfFinal temperature Tf g K
Tf;
fprintfMass of liquid of state mliqg kg
mliq;
fprintfTotal work Wsys g kJ
Wsys;
fprintf
;
units hwpartc;
fprintf# of required units g
units;
fprintf
;
Pfhand,Qhand hwpartc;
fprintfFinal pressure Pfhand g kPa
Pfhand;
fprintfTransferred heat Qhand g kJ
Qhand;
fprintf
;
Pflib,Qlib hwpartc;
fprintfFinal pressure Pflib g kPa
Pflib;
fprintfTransferred heat Qlib g kJ
Qlib;
EDITABLE CODE PART: ADD ONTO IT PLS THANKS
function Pflib,Qlib hwpartc
Pflib; Qlib;
Start writing your code under here
attached is the melibrary to be consulted for the problem
ME MATLAB SOFTWARE
The software package contains classes state and process and function thplot. The
following is the description of their use. You can also get the builtin information by typing help
state, help process, help processget and help thplot in the MATLAB
command line.
Function thplot
Function thplot displays saturated lines in a graphical form. The following options are
available:
thplot default to 'water'
thplotsubstance substance: 'water',ra
The properties displayed on the axes can be chosen from the corresponding selection boxes, and
the units can be chosen by clicking on the units with the righthand button of the mouse.
Class state
A call
st statesubstancepropertyvalueunits;propertyvalueunits
creates an object of class state. Each such object contains the following fields:
stp pressure in units of kPa
stt temperature in units of K
stv specific volume in units of mkg
stu specific energy in units of kJkg
sth specific enthalpy in units of kJkg
sts specific entropy in units of kJkg K
stx quality fraction
stphys 'liquid','sat liquid','twophase','sat vapor','vapor','ideal gas'
stsubstance 'water', 'air', 'nitrogen',
stmolW molecular weight kgkmol
stR gas constant
Examples are:
s statewaterp'MPa';x
s statewaterv ;'sat','liquid'
s stateairp'bar';h
The empty units field, implies base units in addition to help state, typing
Units.base
displays the base units
Object of class state can be a single state or a list of states, ie
st st st
or equivalently,
UCB, Spring
M Frenklach Page of
ME Thermodynamics Last updated
st st;
st st;
creates an object with two states, st and st each defined through a call to state.
To get the property values of state st use the dot syntax, for example,
stp or stp
which returns the value of p in base units ie kPa
Once you created state object st you can display its states on a thermodynamic diagram via
plotst or stplot
This will display the same diagram as calling thplot, but with states marked with red dots
Clicking with righthand button of the mouse on a state dot displays the state number; selecting
this box displays all the property values of the state. Selecting one of them draws a constant
property line; selecting it again removes this line. Clicking with the righthand button on a line
connecting states, displays the constant property of the corresponding process if exists.
Class process
Having a set of states, st st st stN whose lengthst a call
pr processst
creates an object of class process, ie a set of connected states,
st st stend
When the initial state is the same as the final state, ie st st st st the call to
process makes a cycle,
st st st
A call with multiple state sets, eg
pr processst st st st st stst st
creates a splitflux process,
st st st with st also connected to st
You can get process properties by the following calls to getpr :
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
