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.

2 comments:

  1. Hi JC, thanks for providing these Codes. I used the HP48G in college, but once I took the PE Exam, I dropped it for the CASIO Fx115.

    Anyway, thanks for putting these codes up here for everyone. This will be useful I am sure.

    Sometimes you do need to solve a quadratic equation, and not practical to do that by hand ;)

    Just curious.. Do you have any codes, use tips, etc for the CASIO fx115 series?

    ReplyDelete
  2. This program for the HP35s will fail due to an error in interpreting the negative sign at the beginning of the equation on line 6. The following change to line 6 will allow the program to execute properly:

    Q006 (-1)*B÷(2xA)

    ReplyDelete