blob: b6522f3d203d2bb2046b760ba0fd9e14be98cda0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
//Variable declaration:
//For the problem at hand, take as a basis 1 kilogram of water and assume the potential energy to be zero at ground level conditions.
z1 = 0 //Intial height from ground level (m)
z2 = 10 //Final height from ground level (m)
PE1 = 0 //Initial potential energy at z1 (J)
m = 1 //Mass of water (kg)
g = 9.8 //Gravitational acceleration (m/s^2)
gc = 1 //Conversion factor
//Calculations:
PE2 = m*(g/gc)*z2 //Final potential energy at z2 (J)
//Result:
disp("The potential energy of water is :")
disp(PE2)
disp("J ")
|