Chapter 01:Introduction and Basic Concepts

Example 1.1-2 Page Number 19

In [4]:
import math

#Variable Declaration
UnitCostOfEnergy=0.09 #Unit cost of Energy in $/kWh
TimeInterval=2200 # Time Interval in hours
EnergyperUnitTime=30 # Rated Power kW

#Calculation
TotalEnergy=EnergyperUnitTime*TimeInterval # Total Energy in kWh
 
#Money Saved
MoneySaved=TotalEnergy*UnitCostOfEnergy # Money Saved in $

#Calculations in Joules
Tot=EnergyperUnitTime*TimeInterval*(3600) #Total Energy in kJ

#Result
print"The Total Energy Generated is",round(TotalEnergy),"kWh"
print"The Total Money Saved is",round(MoneySaved),"$" 
The Total Energy Generated is 66000.0 kWh
The Total Money Saved is 5940.0 $

Example 1.1-3, Page Number 20

In [3]:
import math

#Variable Decleration
rho=850 #density of oil in kg/m^3
V=2 #Volume of tank in m^3

#Calculations
#We intend to find m
m=rho*V #mass in the tank in kg

#Result
print"The mass in the tank is", round(m),"kg"
The mass in the tank is 1700.0 kg

Example 1.1-4, Page Number 21

In [2]:
import math

#Variable Decleration
m=1 #mass in lbm
g=32.174 #Gravatational Acceleration in ft/s^2

#Calculations
W=(m*g)*(1/g) #weight in lbf

#Result
print"The weight in lbf is ",round(W),"lbf"
The weight in lbf is  1.0 lbf

Example 1.1-6, Page Number 30

In [1]:
import math

#Variable Decleration
V=1.1 #Volume of water collected in gal 
delt=45.62 # time required in s
gal_conv=3.785*10**-3 #Gal conversion constant
mi=60 #1 minute equals 60 seconds  

#Calculations
V_dot=(V/delt)*(gal_conv/1)*(mi/1) #Volume flow rate in m^3/min

#Result
print"The volume flow rate is ",round(V_dot,4), "m^3/min"
The volume flow rate is  0.0055 m^3/min