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
POSTED BY: Tushar G
Posted 10 years ago

If you post the Mathematica code (using the Code Sample icon) for the NMinimize and D[...,b] code above, you're more likely to get responses. And is that (1/b^2)^(1/2)*b in the equation? That would simplify to 1 would it not? Having the code would eliminate such guesswork.

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