Showing posts with label IISc. Show all posts
Showing posts with label IISc. Show all posts

Tuesday, March 15, 2011

Catenary - shape of a chain hanging from two points

Problem: Given a chain (string) or length L and it is hanged somewhere by fixed its both endpoints, but the euclidean distance between endpoints in 3D is less than L. And the chain have μ mass per unit length. Determine the shape of the resulting curve.


Commentary: Shape formed is known as Catenary in literature. Solution of this problem is precisely the shape of garlands hanging in weddings or temples. Mathematical treatment of this problem leads to some very interesting insight into the physical characteristics of these types of curves.


Analysis: A nearly complete analysis of this problem is given at http://en.wikipedia.org/wiki/Catenary#Alternative_analysis

Coding: Even though the equations are given on wikipedia page, it is unclear how to code to get the shape of curve given two endpoints and length of the string. But this problem was thoroughly discussed in NSDE lecture 04 (12-01-2011) by Prof. Atanu Mohanty. He gave some hints regarding how to implement it in C.
If you are interested in seeing the code it is available here.

Result:

Friday, August 27, 2010

Facts of Lagrange Interpolation

"Lagrangian interpolation is praised for analytic utility and beauty but deplored for numerical practice." This heading, from the extended table of contents of one of the most enjoyable textbooks of numerical analysis [1],expresses a widespread view. 

[...] Given (x0, f0), (x1, f1), . . ., (xn, fn) with arbitrary spaced xj, Lagrange had the idea of multiplying each fj by a polynomial that is 1 at xj and 0 at the other n nodes and then taking the sum of these n + 1 polynomials. Clearly, this gives the unique interpolation polynomial of degree n or less. [...]
                  ( Erwin Kreyszig, Advanced Engineering Mathematics )

Figure : Lagrange Interpolation of function 1/(1+x*x)


[...] Lagrange and other interpolation at equally spaced points, as in the example above, yield a polynomial oscillating above and below the true function. This behaviour tends to grow with the number of points, leading to a divergence known as Runge's phenomenon; the problem may be eliminated by choosing interpolation points at Chebyshev nodes. [...]
                  ( Wikipedia )

Although their are superior interpolation methods than lagrange interpolation method. But it is quite easy to understand and it is superior than Taylor Series Approximation of a function. It can be seen easily by following diagram.
Here I choose f(x) = e^x in the interval [0, 2]

[1]  F. S. Acton, Numerical Methods That [Usually] Work, AMS, Providence, RI, 1990.