Note that there are some explanatory texts on larger screens.

plurals
  1. POabout plotting process -- a further question about "A problem in Mathematica 8 with function declaration"
    primarykey
    data
    text
    <p>Related <a href="https://stackoverflow.com/questions/6046626/a-problem-in-mathematica-8-with-function-declaration">A problem in Mathematica 8 with function declaration</a></p> <pre><code>Clear["Global`*"] model = 4/Sqrt[3] - a1/(x + b1) - a2/(x + b2)^2 - a3/(x + b3)^4; fit = {a1 -&gt; 0.27, a2 -&gt; 0.335, a3 -&gt; -0.347, b1 -&gt; 4.29, b2 -&gt; 0.435, b3 -&gt; 0.712}; functionB1[x_] = model /. fit; functionB2[x_] := model /. fit; </code></pre> <p>The evaluation difference between functionB1 and functionB2 can be revealed by <code>Trace</code> command in mma, as below:</p> <pre><code>functionB1[Sqrt[0.2]] // Trace functionB2[Sqrt[0.2]] // Trace </code></pre> <p>I have no question about functionB1. <strong>what puzzles me is that</strong> because <code>functionB2[Sqrt[0.2]]</code> doesn't even gives a numeric result but gives a function of x <code>4/Sqrt[3] - 0.335/(0.435 + x)^2 + 0.347/(0.712 + x)^4 - 0.27/( 4.29 + x)</code>, and then how its plot <code>Plot[functionB2[Sqrt[x]], {x, 0, 1}]</code> is possible? </p> <p>I mean when you run <code>Plot[functionB2[Sqrt[x]], {x, 0, 1}]</code>, what happens inside mma is:</p> <p>x takes a number, say, 0.2, then 0.2 is finally passed to functionB2, but functionB2 gives a function, not a number. Then how is the following figure generated?</p> <p><img src="https://i.stack.imgur.com/Scrrn.gif" alt="enter image description here"></p> <p>And its trace result ( <code>Plot[functionB2[Sqrt[x]], {x, 0, 1}] // Trace</code> ) seems very unreadable. I wonder the clear plotting process of functionB2. Can anybody show it?</p> <p>thanks~ :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload