2
$\begingroup$

Originally, I simply wanted a way to plot $\ln(T^{3/2})$ versus $\dfrac{1}{k_B T}$

But all that appeared was this:

Plot[ln[T^{3/2}], 1/{1.38 10^{-23} T} {T, 0, 10}, PlotLabels -> "Expressions"]

Thread::tdlen: Objects of unequal length in {{7.24638*10^22/T}} {T,0,10} cannot be combined. Plot::pllim: Range specification {T,0,10}/{1.38 10^{-23} T} is not of the form {x, xmin, xmax}.

So, I'm trying to plot a graph of $y=\ln(T^{3/2})$ and $y=\frac{1}{k_B T}$, wher $k_B\approx 1.38 \times 10^{-23}$ and is the Boltzmann constant. $T$ is the thermodynamic (absolute) temperature.

Plot[
  y = ln (T^{3/2}), y = frac {1} {1.38  10^{-23}  T}, 
  {T, 0.0001, 1000}, {y, 0, 100000} 
  PlotLabels -> "Expressions"]

Plot::nonopt: Options expected (instead of {y,0,100000} PlotLabels->Expressions) beyond position 2 in Plot[y=ln T^{3/2},y=frac {1} {1.38 10^{-23} T}, {T,0.0001,1000},{y,0,100000} PlotLabels->Expressions]. An option must be a rule or a list of rules. Out[17]=Plot[y = ln !(*SuperscriptBox[(T), ({*FractionBox[(3), (2)]})]), y = frac {1} {1.38 !(*SuperscriptBox[(10), ({(-23)})]) T}, {T, 0.0001, 1000}, {y, 0, 100000} PlotLabels -> "Expressions"]

I'm really stuck and don't know what to do, I would prefer if the first method (by not letting $y=...$) would work but since it didn't I tried the second way and that didn't either.

Any hints or tips will be appreciated.


Edit: I tried again using Log as mentioned in comment below, but still no success:

LogPlot[{, y}, {y, 0, 1}, AxesLabel -> {, y} ]

???

$\endgroup$
1
  • 5
    $\begingroup$ You need to look up some basic syntax here, start with Log[...] instead of ln. Braces have a special meaning in MMA; use simple parentheses (...) for grouping instead. Try ParametricPlot[{Log[tt^(3/2)], 1/(1.38*^-23 tt)}, {tt, 0, 10}, AspectRatio -> 1] $\endgroup$
    – MarcoB
    Jun 21, 2020 at 4:54

1 Answer 1

2
$\begingroup$

The only grouping brackets that Mathematica allows is parentheses. You can't use cur curly braces; they are reserved for delimiting lists.

Here is a plot that might work for you.

LogPlot[{Log[T^3/2], 1/1.38*^-23/T}, {T, 0, 10}, PlotLabels -> "Expressions"]

plot

$\endgroup$
2
  • $\begingroup$ Many thanks for your answer. This is a good idea using the LogPlot on the y-axis so that the two functions are visible; I could never get both functions in view at the same time. I am curious about something though: "1/1.38*^-23/T" is in your script above, the front slash seems to mean 1/1.38*^-23/T=T/1.38*^-23, yet the graph looks correct; the orange curve is $\frac{1}{k_B T}$. How is this possible? $\endgroup$
    – BLAZE
    Jun 22, 2020 at 18:29
  • 1
    $\begingroup$ @BLAZE. New users of Mathematica are often surprised to find that it transforms what they type in ways that are unintuitive to them. This is one of those times. The built-in function, FullForm, which prints out the internal form, is useful for demystifying such transforms. In this case, u = 1/1.38*^-23/T; u // FullForm prints Times[7.246376811594202`*^22, Power[T, -1]], which is likely not what you would expect, but is the way Mathematica sees the expression you are concerned about. $\endgroup$
    – m_goldberg
    Jun 24, 2020 at 2:24

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