songsnsa.blogg.se

Fortran program for secant method examples
Fortran program for secant method examples













fortran program for secant method examples
  1. #Fortran program for secant method examples update
  2. #Fortran program for secant method examples code

Explanation File of Program above (Newton1) NEW.

fortran program for secant method examples

Program to demonstrate Newton's method subroutine.Explanation File of Program above (Mueller2) NEW.Program to demonstrate a two dimensional version of Mueller's method.Explanation File of Program above (Mueller) NEW.Program to demonstrate Mueller's method.Explanation File of Program above (Lin) NEW.Program to demonstrate the Lin's method subroutine.Program to demonstrate Bisection & Quartile subroutines.Program to demonstrate Bisection subroutine.Explanation File of Program above (Bernou) NEW.Program to demonstrate the Bernouilli subroutine.Explanation File of Program above (Bairsto1) NEW.Program to demonstrate the Bairstow subroutine (all roots).Program to demonstrate the Bairstow subroutine (2 conjugate complex roots).Program to demonstrate the complex domain Allroot subroutine.Explanation File of Program above (Aitken) NEW.Program to demonstrate the Aitken acceleration subroutine.Indeed, if the magnitude of the obtained solution is too large or too small, there might be some problem of conversion factors for physical units, for example.Choose a source program (*.f90) by clicking the appropriate button. (One TIP is to extract constant factors outside and pre-calculate them.)Īlso, for debugging purposes it is sometimes useful to check the consistency of physical dimensions and physical units of various terms. To avoid such issues, it is always useful to first arrange the expression for f(D) as simplest as possible before making a program. using Gnuplot.īut I am afraid that the expression for f(D) itself (given in the Fortran code) might include some typo due to many parentheses. To get a rough idea of where the solution is, it is useful to plot f(D) as a function of D, e.g. So, we see that f(D) = c1 - 2.0 * log( D / c2 ), so we can obtain the solution analytically as D = c2 * exp(c1/2.0) = 7.26526809959e-5, which agrees well with the numerical solution above. Where terms in Lines (1) and (3) are both constant, while terms in Line (2) are some constants over D. Here, we note that the function f(x) is defined as FUNCTION f(D,L,Q,hf,rho,mu,rough) If we change them as xold = 3.0d-5Īnd changing the threshold for convergence more tightly as IF (ABS(fx(xnew,L,Q,hf,rho,mu,rough)) <= 1.0d-10) THEN It seems that the initial values for xold and xolder are too far from the solution.

fortran program for secant method examples

IF (ABS(fx(xnew,L,Q,hf,rho,mu,rough)) = maxit) THEN REAL(DP)::z,phead,hf,L,Q,mu,rho,rough,eff,pump,nu,ppow,fric,pres,xnew,xold,xolder,D INTEGER,PARAMETER::DP=selected_real_kind(15)

#Fortran program for secant method examples update

If I figure this out I will update it to working.

#Fortran program for secant method examples code

I would appreciate any guidance.ĮDIT: I have updated the code with some suggestions from users, still seeing quick divergence. I've done this on paper and understand the mechanics of the equations. I am trying to write a program to solve for pipe diameter for a pump system I've designed.















Fortran program for secant method examples