blob: ec0eee9f8ac07074d6f2168ddd1c4f212481c70c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
// Display mode
mode(0);
// Display warning for floating point exception
ieee(1);
clc;
disp("Introduction to Fluid Mechanics, 3rd Ed. William S. Janna Chapter - 1 Example # 1.1 ")
//Weight in lbf
F = 150;
//Solving part a
disp("Part a)")
//Acceleration due to gravity in ft/s2
a = 32.2;
//Calculating mass of the person in slug
disp("Mass of person in lbf.s2/ft (or slug) is")
m = F/a
//Answer varies slightly because of round-off error
//Solving part b
disp("Part b)")
//New aceleration due to gravity in ft/s2
a = a/6;
//Calculating new weight of the person in lbf
disp("Weight of person on the moon in lbf is")
F = m*a
|