1
$\begingroup$

Consider a table:

Monitor[Module[{}, 
   Table2Temp[\[Theta]S_] := 
    Table[{\[Theta]S, mS, 10^\[Theta]2, 
      NIntegrate[
       Exp[-10^\[Theta]2 \[Theta]S*mS^3*10^2*x], {x, 0, 10000}]}, {mS,
       0.03, 2.03, 0.05}, {\[Theta]2, -15., -3., 0.02}]];, 
 Row[{ProgressIndicator[mS, {0.03, 2.03}], mS}, " "]]
Table2[\[Theta]S_] := Flatten[Table2Temp[\[Theta]S], {2, 1}];

When launching Table2 for particular values of \[Theta]S I found that the progress indicator does not work. This is somehow related to the := used in the definition of the table. How to fix it?

$\endgroup$
2
$\begingroup$

Use

table2[ts_] := 
 Module[{\[Theta]S = ts}, 
  Table1 = Monitor[
    Table[{\[Theta]S, mS, 10^\[Theta]2, 
      NIntegrate[
       Exp[-10^\[Theta]2 \[Theta]S*mS^3*10^2*x], {x, 0, 10000}]}, {mS,
       0.03, 2.03, 0.05}, {\[Theta]2, -15., -3., .02}], 
    Row[{ProgressIndicator[mS, {0.03, 2.03}], mS}, " "]]; 
  Flatten[Table1, {2, 1}]]
table2[1]

fig1

|improve this answer|||||
$\endgroup$
0
$\begingroup$

Alternative way:

Module[{}, 
  Table2Temp[\[Theta]S_] := 
   Table[{\[Theta]S, mS, 10^\[Theta]2, 
     NIntegrate[
      Exp[-10^\[Theta]2 \[Theta]S*mS^3*10^2*x], {x, 0, 10000}]}, {mS, 
     0.03, 2.03, 0.05}, {\[Theta]2, -15., -3., 0.02}]];
Table2[\[Theta]S_] := 
 Monitor[Flatten[Table2Temp[\[Theta]S], {2, 1}];, 
  Row[{ProgressIndicator[mS, {0.03, 2.03}], mS}, " "]]
|improve this answer|||||
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.