Fortran Program For Secant Method Failure

Fortran Program For Secant Method Failure 4,1/5 1921 votes
Solve

This question already has an answer here:.2 answersI am trying to write a program to solve for pipe diameter for a pump system I've designed. I've done this on paper and in excel and understand the mechanics of the equations.

Secant Method Matlab Example

I would appreciate any guidance.At this point I am compiling but getting negative answers on the first iteration, my guess now is that it has to do with my initial guesses, the variables being passed to the function, or the secant calculation code itself. The three checks for phead, pump, and hf are correct.