Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.2K Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

How in a custom function Mathematica passes the values

Posted 5 years ago

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.}}
POSTED BY: ederdax etm
Anonymous User
Anonymous User
Posted 5 years ago
POSTED BY: Anonymous User
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard