goalseek (as in Excel)
Posted: Wed May 30, 2012 8:54 pm
I use GoalSeek a fair amount in spreadsheets. It's fast enough, but I confess I don't understand how it works. Googling produced discussions about Newton Rhapson, something that Computer Science and Math students seem to know about. Having last looked at math a half century ago on finishing my schooling, I can't pick up what it's about.
Recently some other clever mathematical stuff was added to newLISP. Has anybody ever tried something like GoalSeek in newLISP? If so, I'd appreciate an explanation of the algorithm.
As an example, I use it in spreadsheets to arrive at what a payment instalment will be over [n] months, at a certain rate of interest. It isn't simply a matter of dividing sum of principle + interest by number of months, because interest is compounded monthly. It looks to me like GoalSeek is able to cope with this, as though it calculates the a root of compound interest. Microsoft gives an simple explanation of the algorithm which didn't help me at all. Perhaps it just iterates, adding a cent at a time, until its guess subtracted from target is close enough to zero. I'd imagine it would be easier to bisect, as in a binary search, but I can't get my head around the code even in pseudocode. Any ideas?
Recently some other clever mathematical stuff was added to newLISP. Has anybody ever tried something like GoalSeek in newLISP? If so, I'd appreciate an explanation of the algorithm.
As an example, I use it in spreadsheets to arrive at what a payment instalment will be over [n] months, at a certain rate of interest. It isn't simply a matter of dividing sum of principle + interest by number of months, because interest is compounded monthly. It looks to me like GoalSeek is able to cope with this, as though it calculates the a root of compound interest. Microsoft gives an simple explanation of the algorithm which didn't help me at all. Perhaps it just iterates, adding a cent at a time, until its guess subtracted from target is close enough to zero. I'd imagine it would be easier to bisect, as in a binary search, but I can't get my head around the code even in pseudocode. Any ideas?