0

So I have a tanh curve and a straight line that cross at the point:

msol=FindRoot[Tanh[x] == (T/Tc03) x, {x, 1}]

This gives me the roots that I need at a certain temperature, T. I now need these roots to iteratively get a value for chi at different temperatures between 0K and 4K. I am currently using a Table to do this like so:

(*constants*)

mu = 6.0281*10^-23;
Tc03 = 0.00459;
k = 1.3806488*10^-23;

(*calculation*) 

chi = Table[(mu^2 Sech^2[(Tc03/(mu T)) FindRoot[
     Tanh[x] == (T/Tc03) x, {x, 1}]])/(k T (1 - (Tc03/
      T) Sech^2[(Tc03/(mu T)) FindRoot[
        Tanh[x] == (T/Tc03) x, {x, 1}]])), {T, 1*10^-6, 4, 1}]

This gives me the values but where the FindRoot is, it says x->y where y is the root at that temperature, i.e. not numerical values that I can plot. The aim is to plot T vs chi iteratively and then join up the dots and get the form of the curve.

The table also does not tell me what value of T the iteration has taken place at, which I need for the plot.

Any help would be much appreciated.

sarahreid
  • 3
  • 1

1 Answers1

0

Your expression for chi should be rewritten as

chi = 
  Table[
    With[{
      val = Sech[Tc03/(mu T) ((T/Tc03) x /. 
              FindRoot[Tanh[x] == (T/Tc03) x, {x, 1}])]},
      (mu^2 val^2)/(k T (1 - (Tc03/T) val^2))], 
    {T, 1.*10^-6, 4., 1.}]
{-5.73535*10^-20, 2.64408*10^-22, 1.319*10^-22, 8.78661*10^-23}

However, FindRoot will always find the root 0 at x = 0, val will always evaluate to 1., so I question your formulation of your problem.

m_goldberg
  • 107,779
  • 16
  • 103
  • 257