PGFPlot 的数据太小

PGFPlot 的数据太小

我正在尝试在图表中绘制维恩定律和瑞利-金斯定律$I \times \nu$

Wien Law:
\[ I=\frac{2h\nu^3}{c^2}e^{-\textstyle\frac{h\nu}{kT}}\]

Rayleigh-Jeans Law:
\[I=\frac{2k\nu^2T}{c^2}\]

但 PGFPlot 总是崩溃,因为常数(以 SI 单位)太小了!最好的方法是什么?

谢谢!

编辑:我仅使用维恩定律的实际代码是:

\begin{tikzpicture}
\begin{axis}[
    axis lines = left,
    xlabel = $\nu$,
    ylabel = {$I(\nu,T)$ em $T=8.10^{-3}K$},
]

\addplot [
domain=0:10, 
samples=100, 
color=red,
]
{(1.48*10^(-50))*(x^3)*exp((-6*10^(-9))x)};
\addlegendentry{Lei de Wien}
\end{axis}
\end{tikzpicture}

我不知道最佳域名是什么。

答案1

您发布的代码在这里工作正常,您只是忘记了*最后一个之前的一个乘法符号()x,并且有一个多余的)

\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=newest,
  grid=both,
  axis lines=middle,
  width=6cm,
  height=8cm,
  scale only axis,
}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
    axis lines = left,
    xlabel = $\nu$,
    ylabel = {$I(\nu,T)$ em $T=8.10^{-3}K$},
    ylabel style={left}
]

\addplot [
domain=0:10, 
samples=100, 
color=red,
]
{(1.48*10^(-50))*(x^3)*exp((-6*10^(-9))*x};
\addlegendentry{Lei de Wien}
\end{axis}
\end{tikzpicture}

\end{document}

在此处输入图片描述

答案2

使用临时图并添加一些来自 OP 代码的命令:

\documentclass{article}

\usepackage{tikz}
\usepackage{pgfplots}

\pgfplotsset{compat=newest,
  grid=both,
  axis lines=middle,
  width=6cm,
  height=8cm,
  scale only axis,
}






\begin{document}

\def\planck{6.6e-34}
\def\light{3e8}
\def\temperature{5800}
\def\kB{1.38e-23}
\def\pivalue{3.14159}


\begin{tikzpicture}
\begin{axis}[
    axis lines = left,
    xlabel = $\nu$,
    ylabel = {$I(\nu,T)$ em $T=8.10^{-3}K$},
]
\addplot[samples=200,red, line width = 1pt,domain=0:4e14]{ 2*\planck*x^3 / (\light^2)*exp(-(\planck *x) / (\kB* \temperature)};
\addlegendentry{Lei de Wien};
\addplot[samples=200,blue, line width = 1pt,domain=0:4e14]{ 2* \kB * x^2 * \temperature/\light^2};
\addlegendentry{Lei de Rayleigh};
\end{axis}
\end{tikzpicture}


\end{document}

%\addplot[samples=200,black, line width = 1pt,domain=0:4e14]{ (8.0 * \pivalue * \planck / \light^3) * x^3 * 1.0/(exp((\planck *x) / (\kB* \temperature) -1))};

在此处输入图片描述

相关内容