iteration of loop in FORTRAN language
Hello
how I can write in FORTRAN an iterative loop that stops when the convergence condition is satisfied. The convergence condition is: the difference between the two values obtained by two successive iteration (X (iter2)-X (iter1)) is low in the order of [10] [-3]. thank you very much |
|
hello
thank you very much for the reply. i calculate the velocity. I want to express the difference between two values for two successive iteration if the difference is we stopped the iteration if not the calculated repeats |
Well, you have already described the algorithm:
compute the difference, compare it to some threshold and abort the computation or continue... I'm not sure what it is that confuses you... |
hello
yes that's what i want to calculate. i don't know how to write that the value of the velocity of the first iteration is the old one and the value of the second iteration is the new one and the convergence this the new - the old thank you |
This is very basic stuff. I suggest you work through something like this: http://www.cs.mtu.edu/~shene/COURSES...S/fortran.html
This will enable you to do want you intend to do! |
All times are GMT -4. The time now is 05:47. |