Message Boards Message Boards


Usage FindRoot and ArgMin together

Posted 1 year ago
4 Replies
0 Total Likes

I create the function "L" which use the solution of simultaneous equation. Next, I would like to find argmin of this function and plot it. Unforunetly, I get a warning about converage. It doesn't apear when I calculate value of L function, it apear only when I plot M1 function. In attachment I present the part of my code which show my problem. I use Mathematica rarely and I don't have idea how I can solve it. I will be very grateful for any help.

4 Replies

It seems that ArgMin has difficulties for h2 near zero. Also M1 is slow. I would recommend just finding some individual values and using ListPlot, e.g. as below.

pts = Table[M1[h2, alfa], {h2, 1, 4, .1}]

(* During evaluation of In[25]:= FindRoot::lstol: The line search decreased the step size to within tolerance specified by AccuracyGoal and PrecisionGoal but was unable to find a sufficient decrease in the merit function. You may need more than MachinePrecision digits of working precision to meet these tolerances.

Out[25]= {0.740801310481, 0.743546550015, 0.746262102117, \
0.748946758827, 0.751599326706, 0.754218423529, 0.756802639581, \
0.759350378122, 0.761860051955, 0.764329776816, 0.766757576657, \
0.769141333117, 0.77147870336, 0.773767096003, 0.776003732953, \
0.778185434305, 0.780308828275, 0.782370016638, 0.784364756123, \
0.786288212858, 0.788134995015, 0.789898927894, 0.791573003166, \
0.793149155073, 0.794618101184, 0.79596891941, 0.79718881863, \
0.798262566846, 0.799171885286, 0.799894480346, 0.800402813371} *)


enter image description here

Posted 1 year ago

Thank you for the suggestion. I think that it will be the best solution for my problem.

Function $H[a,b,h2]$ is not defined at $h2=0$, respectively, functions $L[d,h2,alpha1]$ and $M1[h2, alpha1]$ also not defined at $h2=0$. This can be checked

In[21]:= H[1, 2, 0]

During evaluation of In[21]:= Power::infy: Infinite expression 1/0. encountered.

During evaluation of In[21]:= Infinity::indet: Indeterminate expression 0. ComplexInfinity encountered.

During evaluation of In[21]:= Power::infy: Infinite expression 1/0. encountered.

Out[21]= Indeterminate
Posted 1 year ago

Oh, that's right. I missed out it. Thank you.

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract