hi all
I am new in using mathematica , I need to excute this algorithem but I have no idea how to start
hope you could help me.
1-set n(max)=(cb-cop)/(cmea+cit).
2-set n=1
3-set m(max)=(cb-cit*n)/(cop+ cmea*n)
4-set m=1
5-find f such that (cop*f*m+cmea*n*m+cit*n) <=cb
6-calculate G(f,l,n).
7-set m=m+1 and repeat steps and 6 until m=m(max).
8-set n=n+1,and repeat steps 3 to 7until n=n(max).
9- the optimal solution G"(f",l",n") can be obtained as min G(f,l,n).

Thank you very much dear Bill...you saved my life .But I need your help again ,by this code i get the minimum of G(f,l,n),i need to obtain the values of f ,l and n that correspond this minimum..how could i do it ?

First part. Instead of Sow[G[f,l,n]]; use Sow[{G[f,l,n],f,l,n}];
That will save the value AND the parameters for that value as a list.

Second part. Now Min[gfln] is no longer sufficient to extract the data you want, but Sort can be a substitute. try
First[Sort[gfln,(First[#1]<First[#2])&]]
What that does is sort your gfln list on the value of the function only and then discard all but the smallest entry.

As always with Mathematica, there are at least a dozen other ways of doing anything, at least several of which are incomprehensible.

I am concerned by your line:
...
Do[f <= (cb - (cmea*n*k + cit*n))/(cop*k);
...
Did you perhaps mean
Do[f=(cb - (cmea*n*k + cit*n))/(cop*k);
because otherwise you are just comparing an uninitialized f against an expression and then throwing away the result.

But that still doesn't seem to change your k when I fiddle with cb,cop,cmea,cit.

If I change your last line of code to
Sort[gfkn, OrderedQ[{First[#1], First[#2]}] &] // MatrixForm
then it appears it is correctly sorting on the first column and for small values of the first column k just seems to usually be 1.

Can you provide some specific values for cb,cop,cmea,cit where k should not be 1?