Why this blog

This blog is intended to save time during the PE exam by taking advantage of the programming capabilities of the HP calculators allowed in the exam.

During my undergrad studies I had HP 48SX and 48GX which I programmed with a variety of engineering programs that helped me immensely during my exams.

As I advance in my studies for the PE exam this October/2011 I'll post some small programs/formulas and examples that I believe are standard in the exam.

Saturday, March 10, 2012

Quadratic Equation

Just came across with a program for quadratic equations. I am not sure where the code is coming from but it certainly works. It will ask you the values A, B and C from the formula Ax^2+Bx+C=0

Blue key, R/S [PRGM]

Line   Instruction          Description, input.  
  Q001   LBL Q         , program's name "Q"
  Q002   CF 10         , Yellow key, up arrow [FLAGS], 2CF, 10        
  Q003   INPUT A      
  Q004   INPUT B      
  Q005   INPUT C      
  Q006   -B÷(2xA)     
  Q007   ENTER        
  Q008   ENTER        
  Q009   B^2-4xAxC    
  Q010   x>=0?        
  Q011   GTO Q017     
  Q012   +/-          
  Q013   sqrt         ;press k key
  Q014   i            
  Q015   x            
  Q016   GTO Q018     
  Q017   sqrt         
  Q018   2xA          
  Q019   ÷            
  Q020   +            
  Q021   x<>y         
  Q022   LASTx        
  Q023   -            
  Q024   RTN          

Execute the program: XEQ Q ENTER. Enter A, B and C according to the equation Ax^2+Bx+C=0. It will show both solutions in x and y registers.

Tuesday, August 9, 2011

CONSTRUCTION: Engineering Economics

The Time Value of Money

 Press the EQN key, then follow this:

A x 100 x ( 1 - ( 1 + I ÷ 100 )^ -N)  ÷ I + F x ( 1 + I ÷ 100 ) ^ -N + P

A= uniform amount per interest period
I=interest rate
N= # of periods
F=Future Value FV
P=Present Value PV (Benefit)

For HP 35S users, when input -N use the "+/-" key instead of the subtraction key "-"

Question: A city engineer is deciding which of two alternatives to select.

Alternative     Cost      Annual Benefit    Salvage       Useful Life
     A          $48,000        $13,000            $0              6 yrs
     B           $40,000        $12,000           $0               6 yrs

 If the interest rate is 10% per year, the Benefit-Cost analysis ratio of the alternative to be selected is most nearly:

a. 1.125
b. 1.179
c. 1.307
d. 1.387

Alternative A:
Press the key SOLVE and select the variable you are looking for, in this case the Present Value "P" , then select the equation pressing EQN and selecting the pv equation
A? 13,000; press "R/S"
I? 10; press "R/S"
N? 6; press "R/S"
F? 0; press "R/S"
P? press "R/S"
The screen will show "RUNNING"
then the answer is 56,618.4 which is the present value of the investment.
the initial cost is $48,000
the Benefit-Cost analysis ratio of alternative A is 56,618.4/48,000 = 1.18%

Same methodology for Alternative B => present value is $52,263

the Benefit-Cost analysis ratio of alternative B is 52,263/40,000 = 1.31%

Answer= C

Question: A residential community will need to add an additional unit to the existing water treatment plant when the population reaches 40,000. An average of 6,000 new residents are moving into the community each year. The estimated birthrate for the community is 8 per 1,000 and the death rate is 14 per 1,000 resulting in a negative annual increase of -0.6%. The number of years before the second unit is needed for the new water treatment plant is most nearly:
a. 6.57
b. 6.78
c. 6.91
d. 6.87
Solution: The population must reach 40,000 before the additional unit is needed, so that F = 40,000. The number of new residents expected each year is 6,000, therefore, A = 6,000.
The residents should have a natural rate of negative annual increase of -0.6%, i = -0.006.
Use the F/A equation as follows and solve for n:
F = (A (1+i)^n – 1)/i
n = (ln( F i / A + 1))/(ln (1+i))
n = (ln (40,000 x (-0.006)) / 6,000] + 1))/(ln (1 - 0.006))
n = 6.78

Using the equation it gives you the same result: N=6.78323

Monday, August 8, 2011

RPN mode

First things first. It is clear that we own HP calculators because we are familiar with the Reverse Polish Notation (RPN). Programs are better in RPN mode than the traditional algebraic mode because they execution is faster and it uses less memory.