The following warnings occurred:
Warning [2] Undefined array key 208172 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 208172 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





Hp 50g finance program



#2

Hello Hp 50g,

the hp 50g has a built-in modul for payments with constant periodical payments. This works fine.

My proggies here are calculating the cashflow and the internal rate of interest for a certain cashflow. The proggies are not tested with a lot of examples, but with some examples out of the 12c or 17bii manuals.

I like to explain the two proggies in a short way for input and output. Enjoy!

First: the CFLOW-Program:

%%HP: T(3)A(R)F(,);

\<< 100 / { } \-> Co L Z LE

\<< PUSH -3 SF -105 SF Co 1 L SIZE

FOR I L I GET OBJ\-> DROP Z 1 + SWAP NEG ^ 1 SWAP - Z / SWAP Z

1 + SWAP NEG 1 + ^ * * LE SWAP + 'LE' STO

NEXT LE + \GSLIST POP

\>>

\>>

INPUT:

STACK 3: payment "Co", mostly negativ.

STACK 2: a list with lists of three objects

STACK 1: interest rate for that cashflow

a example for the list: {{500 1 2}{400 3 5}{100 9 2}}
I have to explain the objects for example: {400 3 5}
First Value: Payment
Second Value: Payed at the end of third period
Third Value: The payment of 400 bucks for five periods (group of payment with constant value)

interest rate value as percent without percent: 10% -> 10 as Input

OUTPUT: netto present value (NPV).

Second program: IRR Program:

Very important! This program only works when the program CFLOW is in the same directory, too.

%%HP: T(3)A(R)F(,);

\<< 5, 10, \-> Co L XI XI1

\<< PUSH -3, SF -105, SF Co L XI CFLOW Co L XI1 CFLOW DUPDUP ABS

WHILE ,005 \>=

REPEAT 3, PICK - ROT SWAP / XI XI1 2, PICK - ROT * - XI1 'XI'

STO 'XI1' STO Co L XI1 CFLOW DUPDUP ABS

END 3, DROPN XI1 POP

\>>

\>>

INPUT:

STACK 2: payment "Co", mostly negativ.

STACK 1: a list with lists of three objects (explained above).

OUTPUT: the internal interest rate in percent without percent f. e.:
12,5 means 12,5 %

The IRR program works with the regula falsi method. There is a difference which can be zero in a division. The program is simple and has no error handling for this situation. May be the IRR value converges against the wrong value, that could be caused by wrong start values for the rate (here 5 and 10, the first two values in the beginning of the program). IRR terminates, when NPV is zero, that means less then 0,005 Cent.

Sincerely
peacecalc

Edited: 1 Jan 2012, 10:25 a.m.


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP Prime: run a program in another program Davi Ribeiro de Oliveira 6 2,286 11-11-2013, 08:28 PM
Last Post: Davi Ribeiro de Oliveira
  Female Finance Reporters & Their Calcs John W Kercheval 0 733 05-15-2012, 02:23 PM
Last Post: John W Kercheval
  Elastic Collisions Program: HP 50g Eddie W. Shore 9 2,510 03-28-2012, 07:58 AM
Last Post: bluesun08
  How a little HP-50g program mutated into an iPhone app Peter Murphy (Livermore) 6 1,920 01-12-2012, 06:06 PM
Last Post: Norman Dziedzic
  HP 50g trilogy. The new HP 50g Blue (and II) Pablo P (Spain) 18 4,651 09-19-2011, 03:08 AM
Last Post: BruceH
  How to install/ru​n this program in an Hp 50g. Vasheer 2 1,000 08-17-2010, 06:34 PM
Last Post: Daniel Oliva
  A useful HP-50G program to keep the DIRs clean... Bill Zimmerly 4 1,317 11-13-2009, 12:17 AM
Last Post: Bill Zimmerly
  Updates and strange Finance module behaviour (with HEPAX/NoVRAM) Diego Diaz 14 3,961 09-25-2008, 06:04 PM
Last Post: Dan Grelinger
  Stopwatch program for HP 50G hpnut 0 678 09-06-2008, 05:18 AM
Last Post: hpnut
  Finance Formulas Jeff Maloney 2 1,041 05-02-2008, 02:24 PM
Last Post: MacDonald Phillips

Forum Jump: