如何绘制复杂函数

如何绘制复杂函数

我知道如何绘制轴和除此处的函数之外的所有其他内容,请给我提示以绘制此函数

在此处输入图片描述

谢谢您的帮助

答案1

这是你想要的吗?

在此处输入图片描述

\documentclass[tikz,border=1mm]{standalone}
\usepackage{amsmath,amssymb}
\begin{document}
\begin{tikzpicture}[x=4cm,y=5cm]
\begin{scope}
\clip (-.2,-.2) rectangle (1.6,1.2);
\draw[dashed,magenta] 
(0,0) .. controls +(0:.3) and +(181:1.75) .. (1.5,.97);
\draw[blue] (0,0) .. controls +(0:.25) and +(180:1.8) .. 
(1.5,.97);
\end{scope}

\foreach \i in {.1,.2,...,1.5} 
\draw (\i,0)--+(90:1mm);
\foreach \i in {0.3,0.6,0.9,1.2,1.5} 
\draw (\i,0) node[below]{$\i$}--+(90:2mm);

\foreach \j in {.1,.2,...,1.1} 
\draw (0,\j)--+(0:1mm);
\foreach \j in {0.2,0.4,0.6,0.8,1} 
\draw (0,\j) node[left]{$\j$}--+(0:2mm);

\draw (0,1.1)--(0,0)--(1.5,0);
\draw[red,dotted,thick] (0,1)--+(0:1.5);
\path (0,0) node[below]{$0$} node[left]{$0$};

\draw[blue] (.7,.7)--++(0:.4) node[right]{Debye}; 
\draw[magenta,dashed] 
(.7,.6)--++(0:.4) node[right]{Einstein};

\path 
(current bounding box.west) coordinate (W)
(current bounding box.south) coordinate (S); 
\path 
(W)++(90:.1) node[left=5mm,rotate=90]{$\dfrac{C_V}{3NK}$}
(S) node[below=-4mm]{$T/\theta$};

\end{tikzpicture}
\end{document}

答案2

您可以声明一个函数并绘制它。相关函数众所周知,参见例如这篇维基百科文章

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}[
    declare function={
        cV(\T,\TD,\a,\b) =
            (\a/(\T/\TD))^2 * exp(\b/(\T/\TD)) / (exp(\b/(\T/\TD))-1)^2;
    },
]
    \begin{axis}[
        xlabel={$T/T_\mathrm{D}$},
        ylabel={$c_V/(3Nk_\mathrm{B})$},
        legend style={at={(0.9,0.6)}},
        domain=0.001:1.5,
        samples=101,
        smooth,
    ]
        \addplot [black]    {cV(x,1,1,1)};
        \addplot [dashed]   {cV(x,{(pi/6)^(-1/3)},1,1)};
        \addplot [densely dotted,red,samples=2] {1};

        \legend{
            Debye,
            Einstein,
        }
    \end{axis}
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容