0
$\begingroup$

I have a proble with a system of two differential equations

operh[h_, c_] :=  h D[D[h, r, r] + 1/r D[h, r] - h, r] + m D[c, r]
operc[h_, c_] := {cmt h + 1/Sqrt[R² - r²] -    1/r D[r h (1 + h⁴  D[c, r]²) D[c, r], r]}

I want to solve the case when they are equal to zero

deqh := operh[h[r], c[r]] == 0
deqc := operc [h[r], c[r]] == 0 

For that I define "shot", a function of "cmt" (appears in the second equation), and of one coefficient "coefh" (appears in the taylor expansion of h) as follow:

shot[coefh_? NumericQ, cmt_? NumericQ] := {taylor expansion of h (variable r), taylor expansion of c (variable r); NDSolve{deqh,deqc}}

My problem is when I try to evaluate my fonction "shot", (I have an error message of course) and variables followed by the dollar symbol appear:

in[]:shot[0.1,0.1]
error:divided by 0, + other error messages
out[]:2.85328 (2 - r$)+ higher terms in r$, rh[r]c'[r]+ other terms with normal r

Where does this $ come from ? I beleive some of the other errors messages are related to this one.

Sorry for the big code post, but this is my very first use of mathematica and I didn't manage to isolate the error better than that...

Thanks for your help!

$\endgroup$

closed as off-topic by Yves Klett, MarcoB, user9660, Bob Hanlon, m_goldberg Jun 2 '16 at 21:39

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – Yves Klett, MarcoB, Community, Bob Hanlon, m_goldberg
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    $\begingroup$ Please post a complete working example (without the pseudo code "taylor expansion" in the third box). Look at Series if you don't know about it. $\endgroup$ – Jess Riedel Jun 1 '16 at 19:44
4
$\begingroup$

The $ is a symbol used by Mathematica to generate local variable names for variables that are confined to a particular scope. For instance, if you run

Module[{x}, Print[x]]

you'll find it prints something like x$4456. This is the name Mathematica gave the variable to distinguish it from any other x's outside the Module.

$\endgroup$

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