Hi, I would like to know how in a custom function Mathematica passes the values of the variables. In this simple example I create a function f(T) with several tasks/lines. How can I make that tf takes the numerical value that FindMaximum is using in each iteration? I mean when I Print[tf] instead of having twait I want to assign a numerical value.
In[118]:= f[T_] :=
Module[{g, tf = T},
Print[tf];
g = Abs[(tf - 3)^2];
{g}
]
In[119]:= FindMinimum[f[twait], {twait, 5}]
During evaluation of In[119]:= twait
Out[119]= {2.61186*10^-19, {twait -> 3.}}