You are on page 1of 5

# Computer Programming Skills MathCad Solution by DF Sozinando Student at the

## Vaal University of Technology

Data matrix is extracted from steam table. The columns (from left to right) of the matrix are respectively
1. Pressure in kPa,
2. Temperature in oC,
3. Specific volume dry saturated vg in m3/kg,
4. Specific enthalpy of liquid saturated hf in kJ/kg
5. Specific enthalpy of vaporisation hfg in kJ/kg, and
6. Specific enthalpy of dry saturated steam in kJ/kg, and
7. The specific volume liquid saturated vf m3/kg

Write a function that will return the quality of stean for a provided value of the enthalpy
The quality of steam is subcool (h < hf), liquid saturated (h = hf) , wet ( hf < h < hg), dry saturated (h = hg),
superheated ( h > hg).
Write a program that will return the quality of steam for a given value of the enthalpy. Test your program with
vector h at 19 kPa for respective values of h = 2000; 2608; 3000; 200 and 247. Your display wi ll be presented in a
function Quality(x)

ORIGIN 1
Data
sup
10
8.80
7.863
7.1045
6.47913
5.95494
18
13.2969
10.5435
8.73473
7.45568
6.50337
14.67
16.67
18.67
20.67
22.67
24.67
8.445
11.445
14.445
17.445
20.445
23.445
|

\
|
|
|
|
|
|
|
.
:=
Data
5
5.5
6
6.5
7
7.5
8
8.5
9
9.5
10
11
12
13
14
15
16
17
18
19
20
32.9
34.6
36.2
37.7
39
40.3
41.6
42.7
43.8
44.8
45.8
47.7
49.5
51.1
52.6
54
55.3
56.6
57.8
59
60.1
28.19
25.77
23.74
22.02
20.53
19.24
18.10
17.10
16.2
15.40
14.67
13.42
12.36
11.47
10.69
10.02
9.433
8.911
8.445
8.027
7.650
138
145
152
158
163
169
174
179
183
188
192
200
207
214
220
226
232
237
242
247
252
2424
2420
2416
2413
2410
2406
2403
2401
2398
2395
2393
2388
2384
2380
2377
2373
2370
2367
2364
2361
2358
2562
2565
2568
2571
2573
2575
2577
2580
2581
2583
2593
2588
2591
2594
2597
2599
2602
2604
2606
2608
2610
0.00100533
0.0010059
0.00100645
0.00100699
0.0010075
0.001008
0.00100848
0.00100895
0.0010094
0.00100984
0.00101027
0.0010111
0.00101188
0.00101263
0.00101335
0.00101404
0.00101471
0.00101535
0.00101597
0.00101658
0.00101716
|

\
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.
:=
Computer Programming Skills MathCad Solution by DF Sozinando Student at the
Vaal University of Technology
n 20 :=
Quality x ( ) h x
h
f
Data
n 4 ,
( )

h
fg
Data
n 5 ,
( )

h
g
Data
n 6 ,
( )

sorting "subcool" h h
f
< if
"liquid saturated" h h
f
= if
"wet" h
f
h < h
g
< if
"dry saturated" h h
g
= if
"superheated" h h
g
> if

## augment sorting ( ) return

:= Quality 2000 ( ) "wet" ( ) =
Quality 2608 ( ) "dry saturated" ( ) =
Quality 3000 ( ) "superheated" ( ) =
Quality 200 ( ) "subcool" ( ) =
Quality 247 ( ) "liquid saturated" ( ) =
Computer Programming Skills MathCad Solution by DF Sozinando Student at the
Vaal University of Technology
The study of stress and strain of a structure subjected to axial loading is governed by the following set of equations:
Modulus of elaticity E is such that: E

x
= (Hooke's law)
Poisson's ratio

y

x
- =
Where:
x
Cross_Sectional_Area
= (stress)
and
x

x
Initial_Length
= (Axial Strain)
y

x
Initial_Diameter
= (Lateral Strains
g A rod of length L
3
500mm = anda diameter 16mm = made of homogeneous and isotropic material is observed
to increase in length by , and to decrease in diameter by
x
300m = , and to decrease in diameter by 2.4m =
(
y
- = ) when subjected to an axial load F
3
12kN =
Use the Programming toolbar and write a function constants P x , ,
x
,
y
,
( )

x

y
, , E ,
( )
=
Evaluate the program for the following numerical applications. Return results with 5 decimal digits, in order as
prescribed by the defined user-defined function output order
constants 12kN 500mm , 16mm , 300m , 24m , ( )
constants 18kN 60cm , 16mm , 300m , 24m , ( )

Computer Programming Skills MathCad Solution by DF Sozinando Student at the
Vaal University of Technology
constants P x , ,
x
,
y
,
( )

x
P

4

2

\
|
|
.

x
x

x
-
E

x
1
MPa

stack
x

y
, , E ,
( )
return
:=
constants 12kN 500mm , 16mm , 300 m , 2.4 m , ( )
0.0006
0.00015 -
0.25
99471.83943
|

\
|
|
|
|
|
.
=
constants 18kN 60cm , 0.64in , 300 m , 2.4 m , ( )
0.0005
0.000148 -
0.295276
173454.366919
|

\
|
|
|
|
|
.
=
verification 1

x
300m := p 12kN :=
3
16mm := 2.4 m := L
3
500mm :=
y
- :=

3
0.015 - % = :=
x

x
L
3
0.06 % = :=
x
p

3
2

4
|

\
|
|
|
.
59683.10366 kPa = :=

x
- 0.25 = := E

x
99471.83943 MPa = :=
Computer Programming Skills MathCad Solution by DF Sozinando Student at the
Vaal University of Technology
verification 2
p 18kN := 0.64 in := x 60cm :=

0.01476 - % = :=
x

x
x
0.05 % = :=
x
p

2

4
|

\
|
|
.
86727.18346 kPa = :=

x
- 0.29528 = := E

x
25157.42898 ksi = :=