Help me to write a programme

D

Dumidu

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)
 
T

Thomas Matthews

Dumidu said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top