# Usage FindRoot and ArgMin together

**URL:** <https://community.wolfram.com/t/usage-findroot-and-argmin-together/12442>\
**Category:** Questions\
**Tags:** finance, mathematica, equation-solving, graphics-and-visualization, optimization\
**Created:** [May 9, 2018, 1:42pm UTC](https://community.wolfram.com/t/usage-findroot-and-argmin-together/12442 "2018-05-09T13:42:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulina9412](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@paulina9412](https://community.wolfram.com/u/paulina9412)\
**Post date:** [May 9, 2018, 1:42pm UTC](https://community.wolfram.com/t/usage-findroot-and-argmin-together/12442/1 "2018-05-09T13:42:48Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![danl](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/danl/32/41267_2.png) [@danl](https://community.wolfram.com/u/danl)\
**Post date:** [May 9, 2018, 2:54pm UTC](https://community.wolfram.com/t/usage-findroot-and-argmin-together/12442/2 "2018-05-09T14:54:32Z")

</div>

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} *)

ListPlot[pts]

```

 ![WC.png](https://global.discourse-cdn.com/wolfram/original/2X/0/0ddd304176aa76d9911fb72307be0c9f513b8e67.png)

---

<div class="post-metadata">

**Author:** ![trounev](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/trounev/32/7405_2.png) [@trounev](https://community.wolfram.com/u/trounev)\
**Post date:** [May 9, 2018, 4:30pm UTC](https://community.wolfram.com/t/usage-findroot-and-argmin-together/12442/3 "2018-05-09T16:30:28Z")

</div>

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

```

---

<div class="post-metadata">

**Author:** ![paulina9412](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@paulina9412](https://community.wolfram.com/u/paulina9412)\
**Post date:** [May 10, 2018, 9:15am UTC](https://community.wolfram.com/t/usage-findroot-and-argmin-together/12442/4 "2018-05-10T09:15:49Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![paulina9412](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@paulina9412](https://community.wolfram.com/u/paulina9412)\
**Post date:** [May 10, 2018, 9:21am UTC](https://community.wolfram.com/t/usage-findroot-and-argmin-together/12442/5 "2018-05-10T09:21:02Z")

</div>

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