0
$\begingroup$

I assign the result of a Solve to the variable eq8. Then I attempt to use this result in the definition of a function as follows:

In[166]:= eq8 = Solve[eq7, {V1}]
Out[166]= {{V1 -> -1.02 (461.185 - 1. im)}}
In[177]:= Vstrom = eq8[[1, 1, 2]]
Out[177]= -1.02 (461.185 - 1. im)
current[im_] := N[Vstrom]

This does not work. With copy of Out[177] and paste it - instead of Vstrom - into N[] I find

current[im_] := N[-1.0200000000000002` (461.184642121376` - 1.` im)]

When eliminating these characters, my function works. Why can't I use the notation N[Vstrom]? After all, these-characters in the above number are just the spec. that the number shall have maschine accuracy. So why does the funktion not work with these characters present?

$\endgroup$
4
  • 2
    $\begingroup$ This is related Meaning of backtick in floating-point literal. $\endgroup$
    – Artes
    Commented May 21, 2016 at 14:52
  • $\begingroup$ I have joined another user in voting to close this as a duplicate. Please read the Q&A linked in the banner at the top of your post. If this does not solve your problem please edit your question to describe exactly how your situation is different. $\endgroup$
    – Mr.Wizard
    Commented May 21, 2016 at 16:16
  • 1
    $\begingroup$ Set $NumberMarks = False if the backticks annoy you. $\endgroup$ Commented May 24, 2016 at 14:55
  • $\begingroup$ I think the question here is "Why can't I use the notation N[Vstrom]", not about tick notation. The problem here is current[im_] := N[Vstrom], where the expectation was that im would get replaced. But with :=, the RHS isn't evaluated, so im doesn't appear. Use current[im_] = N[Vstrom] instead. $\endgroup$
    – John Doty
    Commented May 24, 2016 at 18:08

0

Browse other questions tagged or ask your own question.