A particular problem is de-railing due to curving of the tracks. This problem is sometimes also called sun curves, since it is caused by the sun heating the rails. When the rails heat up they expand slightly. When the endpoints are fixed instead of expansion along the track the rail will curve out in a circle segment. Perhaps surprisingly even a small expansion can cause a significant lateral displacement. A particular rail has a base length L=20m. During the day it has expanded with 2mm = 0.002m. Determine the lateral displacement h caused by this. Use Newton's method to solve the problem. How can you find a good starting approximation for h?
Fix a positive number z > 1. Choose your initialization point x(0) > sqrt(z) in the following.
Procedure 1: Define the recursion: x(n+1) = (z+x(n))/(1+x(n)). Implement the above recursion on Matlab, run it for a while. Is it converging to the square root of z? (You might want to use some square number as your test case first since then you know what the sequence is expected to converge to) What can we say about the odd sequence (i.e., x(1), x(3), ...) and the even sequence? Plot the sequence and the absolute error. Try to figure out the convergence rate, i.e., linear or quadratic or something else?
Procedure 2: Define the recursion: x(n+1) = .5 * (x(n) + z/x(n)). Implement the recursion again on Matlab, run it. Is x(n) monotonically converging to the square root of z? Plot the sequence, absolute error, and figure out the convergence rate.
How shall we compute the square root of z, if z < 1?
Now, by slightly modifying the second procedure, you can easily compute the k-th root. (Hint: the second procedure can be interpreted as Newton's method for the nonlinear equation x^2=z.) Implement the algorithm and test it for a few cases. (Don't forget that you might need to change the initialization point as well!)