Dumidu wrote:
Help me to write a programme to solve mannings equation using
Newton-Raphson method.
Newton-Raphoson metod=
X^(m+1)= X^m - f(x^m)/[df(x^m)/dx]
mannings equation = V= (1/n)*r^(2/3)*s^(1/2)
Try searching the web, I'm sure there are plenty of
examples out there.
I'll assume double as the numeric base.
double V(double n, double r, double s)
{
return (1.0/n) * pow(r, 2.0/3.0) * pow(s, 0.5);
}
I leave the other equation for the O.P.
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq:
http://www.parashift.com/c++-faq-lite
C Faq:
http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book
http://www.sgi.com/tech/stl -- Standard Template Library