Which is the same way I implement it for functions of single input functions, only with the extra inputs now hard coded in. PRINT*, "Too many iterations with no result." The way I'm implementing the secant method is: SUBROUTINE secant(f, x0, n_max, accuracy, mu, u, res)ĭerivate = (f(x0+0.001d0, mu, u) - f(x0, mu, u)) / 0.001d0 In particular mu is another non-linear function of T, but I have an array of all mus for the temperatures I'm considering. Where gamma, mp and k are just numbers but u and mu are other values that I have to input for external arrays. This time I'm trying to find the zeros of a function, which I can normally do, but now I have a function that has more than one input: Sooner than expected, I have yet another problem with my Fortran code.
0 Comments
Leave a Reply. |