0

I have a quantity as below, P[k_0,A_]= A Log [k0]. I want to generate data for this for A={0,10^3} and k0=10^{-11} to 10^{-2} using a Do loop but I don't know how to apply a loop on two variables simultaneously. Can anyone please guide.

  • Outer[P[10^#1, #2] &, Range[-11, -2], Range[0, 10^3, 100]] Adjust as required. – Bob Hanlon Feb 28 '23 at 17:37
  • Welcome to the Mathematica Stack Exchange. Another variation: P[k0_, A_] := A Log[k0] and res1 = Table[ P[k0, A], {k0, PowerRange[10^-11, 10^-2, 10]}, {A, 0, 10^3, 100}] // N – Syed Feb 28 '23 at 18:00
  • Thanks a lot for your reply. Is there any way to monitor the result during calculations. Since if I apply this trick to some variable which is being integrated then it takes a lot of time, and one cannot find any error or bug occurring during calculations until the final output. On the other hand, we can print the result in loop to monitor and stop the calculations immediately if there is any bug... – adeela afzal Feb 28 '23 at 19:45
  • Similar to 43543. – Syed Feb 28 '23 at 20:32
  • Also relevant: 171402. – Syed Feb 28 '23 at 20:39
  • The problem statement is confusing. A small example would help. –  Apr 10 '23 at 20:53

0 Answers0