# Models where the variable is 'hid' in the function

GROUPS:
 hello[hh_] := there*hhManipulate[Plot[hello[hh], {hh, 1, 5}], {there, 1, 3}]Hi, how would I get the above code to work? If I was to define there=1 at the begining I could have a simple plot. However, I would like to be able to have a slider on the plot enabling me to change the value of 'there' and see the effects on the plot. Could anyone help please?
4 years ago
5 Replies
 David Reiss 1 Vote Perhaps the best approach is to redefine hello to include there (how's that for a gramattically interesting sentence??).Also, if you want the Manipulate to retain the definition of hello if you close and then reopen the notebook in a new Mathematica session (or in the CDFPlayer) you should use the SaveDefinitions option.hello[hh_, there_] := there*hh;Manipulate[ Plot[hello[hh, there], {hh, 1, 5}], {there, 1, 3},SaveDefinitions->True]
4 years ago
 unitflux = 2.07*10^-15 BI[a_] := (2*unitflux)/(Sqrt[3]*(a)^2)  NU[m_, n_] := m*m + m*n + n*n BK[m_, n_, a_] := (2 - BI[a])*((-1)^   NU[m, n])*(3^0.75/(2*\[Pi]))/(NU[m, n])^1.5 K[m_, n_,    a_] := ((2*\[Pi])/(a*(Sqrt[3]*a)/2)) {m*(Sqrt[3]*a)/2,     n*a - m*a*0.5}B[r_,a_] := BI[a] + (2 - BI[a])*   Sum[Sum[BK[m, n, a]*Cos[K[m, n, a]*r], {m, 8}], {n, 8}]Manipulate[Plot[B[{r, a}], {r, 0, 3*10^-9}], {a, 5*10^-10, 15*10^-10}]Haha, thanks. Unfortunately my real code is a bit more complicated and for some reason that method doesn't work. It works when I define a =1*10^-9 at the beginning but I can't  seem to get it to work where 'a' can vary. Either like above or with ContourPlot[B[{x,y}],{x, 0, 6*10^-9}, {y, 0, 6*10^-9}]. Any ideas?