Saturday, January 24, 2015

Pressure of Human Feet


Example: Average person

Weight: 180 pounds
Area of one sole of foot: 30 square inch
Area of both soles of feet: 60 square inch

Pressure = Force/Area

Standing on Both Feet (smaller pressure)
P = 180/60 = 3 psi

Standing on One Foot (Bigger Pressure)
P = 180/30 = 6 psi

Thursday, August 14, 2014

Meaning of mm of Rain


1 mm (millimeter) of rain means that an area of 1 square meter will have a layer of rain 1 mm thick.

In terms of volume:
1 mm rain = 1 liter of rain in an area of 1 square meter

For farmers:
10 mm rain = 10 liters per square metre of the field

Rain in 1 Hectare of Field
A rainfall of 1 mm supplies 1 litre of water to each square metre of the field. Therefore, with a rainfall of 1 mm over 1 hectare of field, the total amount of water is 10, 000 litres or 10 cubic meters.

10 mm of rain over 1 hectare field will have a total of 100, 000 litres or 100 cubic meters, the equivalent of 10 water trucks (assuming a commercial Water Bowser Truck capacity of 10,000 Liters).


CONVERSION:
25 mm = 1 inch

1 hectare = 10,000 square metres (100 m by 100 m)
1 hectare = 0.01 square kilometres (1% of sq km)
1 hectare = 2.47 acres (2.5 approx.)

1 acre = 0.4047 hectare (2/5 of a hectare)



RAIN MEASUREMENT: How is rainfall measured
http://en.wikipedia.org/wiki/Rain_gauge


RAIN IN AGRICULTURE, CROPS
http://www.fao.org/docrep/r4082e/r4082e05.htm



Sunday, December 16, 2012

How to convert psi to bar, pascal, kilopascal, atmosphere, torr, inch mercury, inch water


This article will show how to convert from one unit of pressure to another. Common units of pressure are psi (pound per square inch), bar, pascal, kilopascal, atmosphere, torr (mm Mercury), and inch water (in H2O). Although there are many units of pressure, there are standard units of pressure according to a system of units. In the SI system, the unit for pressure is the pascal (Pa), which is equal to one newton per square meter (N/m2). In the English system, units of pressure are commonly psi, bar, and inch mercury.

Atmospheric Pressure


Atmospheric pressure or Barometric pressure is the force exerted by the weight of air on a surface of the Earth. Atmospheric pressure decreases with elevation. The atmospheric air pressure is lesser on top of a mountain than on sea level. For every 1,000 feet (305 meters) you ascend, the atmospheric pressure decreases by about 4%. The boiling point of water on sea level is 100 degrees Celsius or 212 degrees Fahrenheit. At higher altitudes, the boiling point of water will be lower than 100 C (212 F) because the air density is lesser (the air is thinner) and the atmospheric air pressure is lesser (lesser pressure acting on the water surface). This means that lesser energy is required to overcome the forces keeping the water in its liquid form. In other words, at the top of a mountain (higher elevation), it is easier and faster to boil water than it is at sea level (lower altitude).

Absolute Pressure


Absolute pressure (P abs) is equal to atmospheric pressure (P atm) plus gauge pressure (P gage).
P abs = P atm + P gage

Absolute pressure (P abs) is equal to atmospheric pressure (P atm) minus vacuum pressure (P vac).
P abs = P atm - P vac

Gauge pressure (P gage) is equal to absolute pressure (P abs) minus atmospheric pressure (P atm).
P gage = P abs - P atm

Vacuum Pressure (P vac) is equal to atmospheric pressure (P atm) minus absolute pressure (P abs). Vacuum pressure is air pressure below atmospheric pressure. This is a negative pressure reading on the pressure gauge (instrument).
P vac = P atm - P abs


How to calculate Absolute Pressure:

  
Example:
Calculate the absolute pressure (psia) in a system with a gauge pressure reading of 10 psi. When the system experiences a vacuum pressure of 2 psi, calculate the resulting absolute pressure in this conditon.

Given:
P gage = 10 psi
P vac = 2 psi

Required:
P abs (absolute pressure in psia)

Solution:
a.)
P abs = P atm + P gage
P abs = 14.7 + 10
P abs = 24.7 psia

b.)
P abs = P atm - P vac
P abs = 14.7 - 2
P abs = 12.7 psia


Standard units of Atmospheric Pressure


The reference unit of atmospheric pressure is One Standard Atmosphere (1 atm). This is measured according to the following conditions:
1. Altitude = sea level
2. Temperature = 20 °C (68 °F)
3. Air density = 1.225 kg/m3
4. Relative humidity = 20%

Under the given conditions above, One Standard Atmosphere (1 atm) is equal to:
1 atm = 14.7 psi
1 atm = 1.01325 bar
1 atm = 101, 325 Pa
1 atm = 101.325 KPa
1 atm = 760 mmHg (torr)
1 atm = 76 cm mercury
1 atm = 29.92 inHg
1 atm = 407.2 inch water 

Conversion from one unit of pressure to another 
  
Converting from one unit of pressure to another is easy. All you have to do is to use the equivalent of 1 atm (listed above) in your calculation to the desired unit of pressure. I will show an example of converting psi to other units of pressure. The procedure is similar when converting from one unit of pressure to another.

Conversion of psi to other units of pressure
  
Example:
The recommended tire pressure for a typical car is 32 psi minimum to 35 psi maximum. I will use this example maximum car tire pressure of 35 psi to covert to other units of pressure. 

1. How to convert psi to atm:
To convert psi to atm, divide the given pressure in psi by 14.7
35 psi x 1 atm/14.7 psi
35/14.7
= 2.38 atm

2. How to convert psi to bar:
To convert psi to bar, multiply the given pressure by 1.01325 and divide by 14.7
35 psi x 1.01325 bar/14.7 psi
35 x 1.01325/14.7
= 2.41 bar

3. How to convert psi to pascals:
To convert psi to pascals, multiply the given pressure by 101,325 and divide by 14.7
35 psi x 101,325 Pa/14.7 psi
35 x 101,325/14.7
= 241,250 Pa

4. How to convert psi to Kilo Pascals:
To convert psi to KPa, multiply the given pressure by 101.325 and divide by 14.7
35 x 101.325 KPa/14.7 psi
35 x 101.325/14.7
= 241.25 KPa

5. How to convert psi to mm Hg (millimeters of mercury or torr):
To convert psi to mmHg, multiply the given pressure by 760 and divide by 14.7
35 psi x 760 mmHg/14.7 psi
35 x 760/14.7
= 1809.52 mmHg

6. How to convert psi to cm Hg (centimeters Mercury):
To convert psi to cmHg, multiply the given pressure by 76 and divide by 14.7
35 psi x 76 cmHg/14.7 psi
35 x 76/14.7
= 180.95 cmHg

7. How to convert psi to in Hg (inches of Mercury):
To convert psi to inHg, multiply the given pressure by 29.92 and divide by 14.7
35 psi x 29.92 inHg/14.7 psi
35 x 29.92/14.7
= 71.24 inHg

8. How to convert psi to in H2O (inch of water):
To convert psi to inH2O, multiply the given pressure by 407.2 and divide by 14.7
35 psi x 407.2 inH2O/14.7 psi
35 x 407.2/14.7
= 969.52 inH2O

Saturday, December 15, 2012

C++ TUTORIAL FOR BEGINNERS: Program to compute for Total Monthly Income (Revenue), Expenses, and Net Income (Profit)


This C++ program is a simple basic addition and subtraction operation involving a typical household monthly salary, revenue, monthly bills and expenses and the total net profit. The user is required to enter the amounts and other information. If a field which requires a data to input does not apply to a given user, 0 (zero) should be entered. An output file called "income.txt" is generated by the program to reflect the values keyed in.

Sample data input:

income.txt file:

Source code:

/*
PROGRAM 6: Monthly Net Income
AUTHOR: eternaltreasures
DATE: 2010 September 18
*/


#include <iostream>
#include <fstream>
using namespace std;

#define newline '\n'

int main ()
{

int year;
char month[10];

float Wages_Salary,
      Spouse_Child_support,
      Other_income;

float Food_Grocery,
      Mortgage_Rent,
      Transportation,
      Retirement,
      Insurance,
      Education,
      Children,
      Cable_Internet,
      Home_Cell_phone,
      Loans_Credit_cards,
      Laundry,
      Electricity,
      Gas_Heating,
      Water_bills,
      Personal,
      Clothing,
      Medical,
      Recreation,
      Donations_Gifts,
      Other_expenses;
     
float INCOME, 
      EXPENSES,
      NET_INCOME;
     
//Open the output file     
ofstream fout;    
fout.open ("income.txt");

//Welcome and instructions
cout << "Welcome to the Monthly Net Income report program!";
cout << newline;
cout << newline;
cout << "Pls. fill up all the data.";
cout << newline;
cout << "Enter 0 if not applicable.";
cout << newline;
cout << newline;

//Year and Month  
cout << "Year: "; cin >> year;
cout << "Month: "; cin >> month;
cout << newline;

//INCOME sources
cout << "MONTHLY INCOME:";
cout << newline;
cout << "Wages/Salary: "; cin >> Wages_Salary;  
cout << "Spouse/Child support: "; cin >> Spouse_Child_support;
cout << "Other income: "; cin >> Other_income;
cout << newline;

//ALL EXPENSES
cout << "MONTHLY EXPENSES:";
cout << newline;
cout << "Food/Grocery: "; cin >> Food_Grocery;
cout << "Mortgage/Rent: "; cin >> Mortgage_Rent;
cout << "Transportation: "; cin >> Transportation;
cout << "Retirement: "; cin >> Retirement;
cout << "Insurance: "; cin >> Insurance;
cout << "Education: "; cin >> Education;
cout << "Children: "; cin >> Children;
cout << "Cable/Internet: "; cin >> Cable_Internet;
cout << "Home/Cell phone: "; cin >> Home_Cell_phone;
cout << "Loans/Credit cards: "; cin >> Loans_Credit_cards;
cout << "Laundry: "; cin >> Laundry;
cout << "Electricity: "; cin >> Electricity;
cout << "Gas/Heating: "; cin >> Gas_Heating;
cout << "Water bills: "; cin >> Water_bills;
cout << "Personal: "; cin >> Personal;
cout << "Clothing: "; cin >> Clothing;
cout << "Medical: "; cin >> Medical;
cout << "Recreation: "; cin >> Recreation;
cout << "Donations/Gifts: "; cin >> Donations_Gifts;
cout << "Other expenses: ";  cin >> Other_expenses;

//Compute Total Income
INCOME = Wages_Salary
       + Spouse_Child_support
       + Other_income;

cout << newline;
cout << "TOTAL MONTHLY INCOME: " << INCOME;

//Compute Total Expenses
EXPENSES = Food_Grocery
         + Mortgage_Rent
         + Transportation
         + Retirement
         + Insurance
         + Education
         + Children
         + Cable_Internet
         + Home_Cell_phone
         + Loans_Credit_cards
         + Laundry
         + Electricity
         + Gas_Heating
         + Water_bills
         + Personal
         + Clothing
         + Medical
         + Recreation
         + Donations_Gifts
         + Other_expenses;

cout << newline;
cout << newline;
cout << "TOTAL MONTHLY EXPENSES: " << EXPENSES;

//Compute Net Income
NET_INCOME = INCOME - EXPENSES;

cout << newline;
cout << newline;
cout << "MONTHLY NET INCOME: " << NET_INCOME;
cout << newline;
cout << newline;

//Write to output file (income.txt)
fout << "Year: " << year;
fout << newline;
fout << "Month: " << month;
fout << newline;
fout << newline;

fout << "MONTHLY INCOME:";
fout << newline;
fout << "Wages/Salary: " << Wages_Salary;  
fout << newline;
fout << "Spouse/Child support: " << Spouse_Child_support;
fout << newline;
fout << "Other income: " << Other_income;
fout << newline;
fout << newline;

fout << "MONTHLY EXPENSES:";
fout << newline;
fout << "Food/Grocery: "  << Food_Grocery;
fout << newline;
fout << "Mortgage/Rent: " << Mortgage_Rent;
fout << newline;
fout << "Transportation: " << Transportation;
fout << newline;
fout << "Retirement: " << Retirement;
fout << newline;
fout << "Insurance: " << Insurance;
fout << newline;
fout << "Education: " << Education;
fout << newline;
fout << "Children: " << Children;
fout << newline;
fout << "Cable/Internet: " << Cable_Internet;
fout << newline;
fout << "Home/Cell phone: " << Home_Cell_phone;
fout << newline;
fout << "Loans/Credit cards: " << Loans_Credit_cards;
fout << newline;
fout << "Laundry: " << Laundry;
fout << newline;
fout << "Electricity: " << Electricity;
fout << newline;
fout << "Gas/Heating: " << Gas_Heating;
fout << newline;
fout << "Water bills: " << Water_bills;
fout << newline;
fout << "Personal: " << Personal;
fout << newline;
fout << "Clothing: " << Clothing;
fout << newline;
fout << "Medical: " << Medical;
fout << newline;
fout << "Recreation: " << Recreation;
fout << newline;
fout << "Donations/Gifts: " << Donations_Gifts;
fout << newline;
fout << "Other expenses: " << Other_expenses;
fout << newline;

fout << newline;
fout << "TOTAL MONTHLY INCOME: " << INCOME;

fout << newline;
fout << newline;
fout << "TOTAL MONTHLY EXPENSES: " << EXPENSES;

fout << newline;
fout << newline;
fout << "MONTHLY NET INCOME: " << NET_INCOME;
fout << newline;
fout << newline;

fout.close();

return 0;
}

Thursday, December 13, 2012

C++ TUTORIAL FOR BEGINNERS: How to read a file and store the records in a string


The program works as follows:

- openbook.txt must have records to read input from
- the program opens the input file for reading
- while condition is used to keep on reading while it's not yet end of the file
- if a record is read, the getline command is used to store in string record
- cout command is used to display on the screen the record read

Source code:

#include<iostream>
#include <string>
#include<fstream>
using namespace std;

int main()
{
string record;
ifstream inputfile;

inputfile.open("openbook.txt");

if (inputfile.is_open())
{
 while (!inputfile.eof())
  {
   getline(inputfile, record);
   cout << record << endl;
  }
}
inputfile.close();
return 0;
}

C++ TUTORIAL FOR BEGINNERS: How to read a file and store the records in a character array


The program works as follows:

- database.txt must have records to read input from
- the main () function calls the function read_database_file
- the program opens the "database.txt" input file for reading
- while condition is used to keep on reading while it's not yet end of the file
- if a record is read, the >> operator is used to store the record in a character array (declared as char database_record [256];)
- cout command is used to display on the screen the contents of the character array ( char database_record [256] )

Source code:

#include<iostream>
#include <string>
#include<fstream>
using namespace std;

#define newline '\n'

char database_record [256];

void read_database_file ()
{
ifstream database_file;

database_file.open ("database.txt");

if (database_file.is_open())
{
 while (!database_file.eof())
  {
   database_file >> database_record;
   cout << database_record << endl;
  }
}
else
{ cout << "Input file not successfully opened.";

database_file.close();
}
}

int main()
{
read_database_file ();
return 0;
}

C++ TUTORIAL FOR BEGINNERS: How to capture the system date and time and display them in useful common format


Source code:

/*
PROGRAM: Capturing the System date and time in business & military format using C++ language
AUTHOR: eternaltreasures
DATE: 2010 September 26
*/

#include <iostream>
#include <time.h>
using namespace std;

int main()
{

/*
Option 1: Capturing the system date using the time () function
ctime format is DayOfTheWeek Month Day Hour:Minute:Seconds Year
*/

time_t systemtime;
time(&systemtime); 

cout << endl;
cout << "System date and time is: " << ctime(&systemtime);
cout << endl;   
   
/*
Option 2: Capturing the system date and time using strdate, strtime
System date format mm/dd/yy (month/day/year)
System time format hh/mm/ss (hour:minute:seconds)
*/

char sysdate[9];
char systime[9];

_strdate(sysdate);
_strtime(systime);

cout << "System time: " << systime << endl;
cout << "System date: " << sysdate << endl;

return 0;
}