1
$\begingroup$

When plotting a function that depends on FindRoot, the function is not rendered. I can calculate individual values. I sometimes get errors:

FindRoot::precw: The precision of the argument function (70.0001 -((10+10/(1+Power[<<2>>])) Log[x/10])/Log[10]==45) is less than WorkingPrecision (20.`).

This is similar to bug reported in "Is FindRoot wrong about its WorkingPrecision". I have tried changing the WorkingPrecision and precision of input boundaries to no avail, Code:

attArea[x_] := 10*(1/(1 + Exp[(-5/250)*(x - 250)])) + 10
ca[Le_] := FindRoot[(Le - (attArea[x] * Log[10, x/10]) == 45), {x, 300}]
Plot[ca[LL], {LL, 70, 75}]

Any suggestions?

$\endgroup$
3
  • 2
    $\begingroup$ Try ca[Le_] := x /. FindRoot[(Le - (attArea[x]*Log[10, x/10]) == 45), {x, 300}] $\endgroup$
    – Karsten7
    Commented Jun 3, 2017 at 10:44
  • $\begingroup$ Table[{LL,ca[LL]}, {LL, 70, 75,1/10}] , then ListPlot $\endgroup$
    – george2079
    Commented Jun 3, 2017 at 10:56
  • $\begingroup$ The fix suggested by Karsten works. That was quick! Thanks also for the fallback Table Solution from George2079. $\endgroup$
    – icemover
    Commented Jun 3, 2017 at 11:19

1 Answer 1

2
$\begingroup$

Answered: The solutions from Karsten is to prepend the FindRoot with x /. which is a replacement see ReplaceAll in documentation. I am assuming this forces the expression to be evaluated before entering the plot function.

$\endgroup$
1
  • 2
    $\begingroup$ Great job answering your own question based upon comment! Please write Karsten's solution on your answer. Don't make the reader have to read the comment. Show an example. $\endgroup$ Commented Jun 3, 2017 at 13:54

Not the answer you're looking for? Browse other questions tagged or ask your own question.