Level Curve Graphing Java Applet  Andrew Trusty (gtg877q) 



Questions & Answers Q. If you look at your graphs in which epsilon was too large, you will see that the curves “spiral out”. That is, all of the errors are of the same sign, and tend to increase the radius. Can you explain this? A. When epsilon is too large the approximation follows each step for an overly large distance and so each step goes further away from the actual level curve resulting in a large discrepancy between the actual level curve and the approximated curve that is graphed and appears spiraling out. Q. Do you ever run into points where the gradient of f is nearly zero? What does you program do then? How small do you have to take ε to get a good graph in this case? Discuss your reasoning. A. When presented with points where the gradient of the function approaches zero the applet will not approximate them very well at values of ε that work well for other functions. There will be a curve toward the origin but not a very steep curve and the graph will not ever seem to cross the origin. Given an ε close to 8*10^4 the applet will approximate the point where the gradient is zero much better with a sharper curve toward the origin but still not touching it. Q. Explain the improved "corrector" algorithm. A. The new algorithm works in such a way that if the point approximated by the old algorithm Y does not equal the previous point X it creates a scalar to adjust Y by the gradient at Y according to the difference between X and Y over the norm of the gradient at Y squared. The scalar is either a negative or positive value according to the difference between X and Y and this allows the scalar to scale the gradient at Y straight up or down hill as necessary which when added to Y adjusts the point. This small amount corrects the point Y to generate the new point. Q. Can you get away with larger values of ε (and therefore smaller values of N) using the improved program? If so, how much larger can ε be to get a graph of the same quality? Discuss the efficiency of the new algorithm: There are fewer steps, but each one takes more computation. Does it really pay off? A. You can get away with larger values of ε with the improved algorithm but the difference is not huge. With correction a graph takes about 5% less steps to achieve the same quality as its its equivalent graph without correction. The efficiency may not always be as good as the original algorithm but graphing with my applet there seems to be a negligible time difference between graphing with correction and without. It really depends though on what value of ε you will be using and how approximate you need your graph to match the real level curve. 