Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.2K Views
|
6 Replies
|
0 Total Likes
View groups...
Share
Share this post:

constructing a table with Minimize and NMinimize

Posted 10 years ago

I am trying to make a table, in a range where $\alpha$ = 0.01, 0.1,.....1.5....2.0, and $\mu$=0.01, 0.1, 0.2,....1.0, 1.1, ....10 for the following "Minimize" function, and compare it also to "NMinimize" with different methods:

NMinimize[ $\frac{\frac{64 b^5 \left(-16 b^5+4 b^3+\frac{3 \pi \sqrt{\frac{1}{b^2}} b}{\sqrt{1-b^2}}-\frac{6 \sin ^{-1}(b)}{\sqrt{1-b^2}}+6 b\right)}{\pi \left(96 b^5-96 b^7\right)}-\frac{4\, \alpha\, b^3}{(2 b+\mu )^2}}{b^2+1}$]

What's the recommended set of commands to do this?

I also tried D[ $\frac{\frac{64 b^5 \left(-16 b^5+4 b^3+\frac{3 \pi \sqrt{\frac{1}{b^2}} b}{\sqrt{1-b^2}}-\frac{6 \sin ^{-1}(b)}{\sqrt{1-b^2}}+6 b\right)}{\pi \left(96 b^5-96 b^7\right)}-\frac{4\, \alpha\, b^3}{(2 b+\mu )^2}}{b^2+1},\,b$], and the using the result with Solve[result==0,b], but the evaluation doesn't complete even after 10 minutes on an i7 machine with 16 GB RAM. Also doesn't seem to work even with ND[ ].

POSTED BY: Tushar G
6 Replies

Thank you

POSTED BY: Tushar G
Posted 10 years ago

If the results end up in a variable named t, then you might use

t = Flatten[t, 1];
t3 = Table[{t[[i, 1]], t[[i, 2]], b /. t[[i, 3]][[2]]}, {i, Length[t]}]
ListPointPlot3D[t3, AxesLabel -> {"\[Alpha]", "\[Mu]", "b"}, PlotRange -> All]
ListPlot3D[t3, PlotRange -> All]

with output

ListPointPlot3D ListPlot3D

POSTED BY: Jim Baldwin

Many thanks Jim! I am now trying to plot the list of triplets of the form {0.1,0.01,{1.99839,{b->0.0478935}}}. Being a newbie, I am transferring all of the values in another editor, substitute the -> and then plotting a 3D graph. Is there a better way to combine Plot2D and Plot3D in the same (or sequential) declarative command? "Table" command also appears to be working, but I have to check it thoroughly. I don't know how to combine Plot in either the list from the first method or from the Table directly.

POSTED BY: Tushar G
Posted 10 years ago

You might want to try the following using Do loops to see if things are working:

Do[Do[Print[{alpha, mu, 
    NMinimize[{(-((4*alpha*b^3)/(2 b + mu)^2) + (64 b^5 (6 b + 4 b^3 - 16 b^5 + (3 Sqrt[1/b^2] b \[Pi])/
               Sqrt[1 - b^2] - (6 ArcSin[b])/Sqrt[1 - b^2]))/((96 b^5 - 96 b^7) \[Pi]))/(1 + b^2), 
      0 <= b <= 0.9999999}, {b}]}],
      {alpha, N[Flatten[{Range[10]/100, Range[2, 20]/10}]]}],
       {mu, N[Flatten[{Range[10]/100, Range[2, 100]/10}]]}] 

But when you are comfortable that things are working, using a Table command is much better:

t = Table[{alpha, mu, 
   NMinimize[{(-((4*alpha*b^3)/(2 b + mu)^2) + (64 b^5 (6 b + 4 b^3 - 16 b^5 + (3 Sqrt[1/b^2] b \[Pi])/
              Sqrt[1 - b^2] - (6 ArcSin[b])/Sqrt[1 - b^2]))/((96 b^5 - 96 b^7) \[Pi]))/(1 + b^2), 
     0 <= b <= 0.9999999}, {b}]},
     {alpha, N[Flatten[{Range[10]/100, Range[2, 20]/10}]]},
     {mu, N[Flatten[{Range[10]/100, Range[2, 100]/10}]]}]
POSTED BY: Jim Baldwin

Sorry, I should have pointed out that this was a conditional expression Im[b^2] != 0 || Re[b^2] >= 0], and Mathematica calculated this from Integrate[(p^2 (p^2 + 1)^(3/2))/(b^2 + p^2)^4, {p, 0, Infinity}].

I am unsure how to do a loop in Mathematica to construct a table of the value of the the minimum expression, and the value of "b" where the minimum occurs, either using NMinimize or Minimize i.e. vary alpha from 0.01,0.02,...0.1,0.2,0.3....1.0,1.1...2.0, and vary [Mu] from 0.01,0.02,..0.1,0.2,0.3....1.0,1.1,....10. It's an uneven grid, so alpha values go from 0.01 in increments of 0.01, then from 0.9 to 2.0 in increments of 0.1 etc.

NMinimize[{(-((4 *alpha* b^3)/(2 b + \[Mu])^2) + (
   64 b^5 (6 b + 4 b^3 - 16 b^5 + (3 Sqrt[1/b^2] b \[Pi])/Sqrt[
      1 - b^2] - (6 ArcSin[b])/Sqrt[1 - b^2]))/((96 b^5 - 
      96 b^7) \[Pi]))/(1 + b^2), 0 <= b <= 0.9999999}, {b}]

An aside is the problem that evaluating D(-((4 alpha b^3)/(2 b + \[Mu])^2) + ( 64 b^5 (6 b + 4 b^3 - 16 b^5 + (3 Sqrt[1/b^2] b \[Pi])/Sqrt[ 1 - b^2] - (6 ArcSin[b])/Sqrt[1 - b^2]))/((96 b^5 - 96 b^7) \[Pi]))/(1 + b^2), b], then equating the result to == 0, and solving it -- the calculation doesn't complete even after 15 minutes. Same is the case if numerical differentiation is performed and the result equated to 0.

POSTED BY: Tushar G
Posted 10 years ago
POSTED BY: Jim Baldwin
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard