blob: 40ddc0109a815e0b189d92f870078c90dfe3d576 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
// Theory and Problems of Thermodynamics
// Chapter 1
// Basic Concepts
// Example 4
clear ;clc;
//Given data
Pf = 0.4 //Pf = pressure of the gas in MPa
Pa = 0.1 //Pa = atmospheric pressure in MPa
A = 10^-2 // A = cross-sectional area of piston in m^2
Vi = 0.1 // initial volume in m^3
Vf = 0.2 // final volume in m^3
//Calculate spring force constant
Pf = Pf * 10^6; // units conversion MPa to Pa
Pa = Pa * 10^6; // units conversion MPa to Pa
K = (Pf-Pa)*A^2/(Vf-Vi); //spring force constant
// Results
mprintf('Spring force constant = %3.0f N/m', K)
|