' Puzzlet #082.
|
| PROGRAM NOTES The simplest way to tackle this problem is to use Newton's method. This has appeared in previous Puzzlets, so I don't propose to give a detailed description of its operation here. If you want to read more about it, use the Archives page to view Puzzlet #005. One important point, however: you can see by inspection that the result is going to be near unity (just substitute 1 for x in the equation to try it out). So I chose to take two starting roots just either side of 1 and run the program twice. The code shows this as root = 0.5 and then root = 1.5. |
| One
thing that might exercise your memory is the second term of the
equation: 6.54x.
You'll have to find the first derivative of this when applying
Newton's method. If you check the code, you'll see that this derivative
is as shown inset. |
|
![]() |
![]() |
|
The inset graph shows the
function's curve. You can see where the two results lie on the zero y
axis. When I zoomed into the graph, it shows the two values as 0.7085 and 1.0414. |
| The
inset screen shot shows the result of running the code above. As you can see, this is in accordance with the graph values. |
|
|
Roots: 0.7085 found in 5 iterations 1.0414 found in 7 iterations That's all, folks! Press a key ... |
| Site design/maintenance: Dave Ellis | E-mail
me! |
Last Updated: March 28th, 2004. |