我想在我的文档中添加一些情节。我以前一直能够成功地这样做,但由于某些原因,这次却没有成功。我试着删除所有的东西,除了一个情节,但我仍然得到同样的错误。让我展示一下只有一个图的文档。
\documentclass[11pt]{amsart}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[domain=0:3,samples=100,yticklabels=\empty]
\addplot+[no markers] {20-500*\ln(0.998*exp(-x)+0.002+0*exp(x))-500*\ln(0.998*exp(x)+0.002+0*exp(-x))};
\end{axis}
\end{tikzpicture}
\end{document}
我得到的错误是 "Undefined control sequence.\foreach ...reach\let \pgffor@assign@before@code=[好多]"
当我把函数替换成简单的exp(x)时,绘图就可以了。那么这个更复杂的函数有什么问题呢?
谅谅
在公式中使用的对数函数为 ln
不 \ln
\documentclass[11pt]{amsart}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[domain=0:3,samples=100,yticklabels=\empty]
\addplot+[no markers] {20-500*ln(0.998*exp(-x)+0.002+0*exp(x))-500*ln(0.998*exp(x)+0.002+0*exp(-x))};
\end{axis}
\end{tikzpicture}
\end{document}