Path: utzoo!utgpu!cs.utexas.edu!uunet!samsung!olivea!orc!inews!iwarp.intel.com!gargoyle!chinet!laird From: laird@chinet.chi.il.us (Laird J. Heal) Newsgroups: alt.sources.wanted Subject: Re: mortgage program Message-ID: <1991Jan04.112213.5193@chinet.chi.il.us> Date: 4 Jan 91 11:22:13 GMT References: <9101022144.AA13152@hp370b.CFSMO.Honeywell.COM> <1991Jan3.194905.247@ee.rochester.edu> Organization: Chinet - Public Access UNIX Lines: 50 >Does anyone has a source program for mortgage payment calculations? I like >to run it on my IBM PC...please e-mail the program...thanks! Well, I make a habit of deriving the formula every so often - not on the net before, so here goes: P=principal, n=number of payments, i=interest, x=payment: month Principal Interest payment new Principal 1 P iP x P+iP-x 2 P-iP+x i(P+iP+x) x P+iP-x+i(P+iP-x)-x iP+(i**2)P-ix P+2iP+(i**2)P-ix-2x 3 P+2iP+(i**2)P-ix-2x iP+2(i**2)P+(i**3)P-(i**2)x-2ix x P+3iP+3(i**2)P+(i**3)P-(i**2)x-3ix-3x P(1+i)**3-((i**3)x+3i(**2)x+3ix)/i P(1+i)**3-((i**3)x+3i(**2)x+3ix+x - x)/i P(1+i)**3-((i+1)**3) - 1)x/i and unless you misbelieve the patterns, to set "new Principal" to zero after n months, we have to set P(1+i)**n=((i+1)**n) - 1)x/i and x = Pi((1+i)**n)/(((1+i)**n) - 1) which can be further reduced, by means of such modern tools as pencil and paper, to x=Pi(1/(1-(1/(1+i)**n))) in order to only make one exponentiation. Well, I didn't write the program for you (I usually just use a pocket calculator) but the only thorny problem is really the one: given the monthly payment I can afford and the price/interest-rate I am facing, how long will it take to make to payoff? as x=Pi((1+i)**n)/(1 - (1+i)**n) x - x(1+i)**n = Pi(1+i)**n x=(Pi+x)(1+i)**n x/(Pi+x)=(1+i)**n n=(log(x/(Pi+x)))/log(1+i) Now maybe if I get really ambitious I will put together a little bit of scanf() and printf() and...nah. -- Laird J. Heal The Usenet is dead! Here: laird@chinet.chi.il.us Long Live the Usenet!