我怎样才能画出一个完美的有效牛顿势图?我试过了,但效果不如我想要的那么好。
\begin{tikzpicture}
\begin{axis}[
xmin=0,
]
\addplot[
red,
smooth,
domain=-5:1,
samples=201,
]
{0.1/x^2-3/x};
\end{axis}
\end{tikzpicture}
换句话说,我需要这样的东西
答案1
像这样吗?
\begin{tikzpicture}
% Set horizontal range
\pgfmathsetmacro{\nx}{8}
% Set vertical range
\pgfmathsetmacro{\ny}{2.5}
\pgfmathsetmacro{\xmin}{2*(sqrt(\ny+1)-1)/\ny}
\pgfmathsetmacro{\xmint}{2/sqrt(\ny)}
\pgfmathsetmacro{\xminb}{4/\ny}
\pgfmathsetmacro{\xmax}{2*\nx}
\begin{axis}[xmin=0,xmax=\xmax,axis x line*=middle, axis y line*=left, xtick=\empty, ytick=\empty]
\addplot[red,domain=\xmin:\xmax,samples=100]{1/x^2-1/x};
\addplot[domain=\xminb:\xmax,samples=100]{-1/x};
\addplot[domain=\xmint:\xmax,samples=100]{1/x^2};
\end{axis}
\end{tikzpicture}
您可以在第一行设置水平和垂直范围,nx 和 ny 的单位是图形最小点的坐标。
答案2
可能是这样的:
\documentclass{article}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11}
\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmax=1,
xmin=0,
ymax=10,
ymin=-250,
]
\addplot[
red,
%smooth, %% this will spoil the plot
domain=-5:5,
samples=1000,thick
]
{0.5/x²-22/x};
\end{axis}
\end{tikzpicture}
\end{document}
答案3
尝试这个
\documentclass[border=2pt]{standalone}
% Drawing
\usepackage{tikz}
\usepackage{physics}
\usepackage{nicefrac}
\usetikzlibrary{arrows.meta} % to control arrow size
\tikzset{>={Latex[length=4,width=4]}} % for LaTeX arrow head
% Tikz Library
\begin{document}
\begin{tikzpicture}
% Axis
\draw[-latex, thick] (0,-1) -- (0,7) node[left] {$V_{\text{eff}}$};
\draw[-latex, thick] (0,3) -- (9,3) node[below] {$r$};
\draw[rounded corners=30,thick] (8,2.8) to[out=180,in=40] (2,0.3) to[out=120,in=-85] (0.2,7) ;
\draw[dashed,rounded corners=30,thick] (3,1.14) to[out=220,in=60] (1.2,-1);
\node[left=3] at (0,3) {$E_{\text{parabola}}$};
\draw[dashed] (0,0.75)--(2.2,0.75);
\node[left=15] at (0,0.75) {$E_{\text{circle}}$};
\draw[<-,gray] (2.2,0.6) to[out=-60,in=170](6,-0.1)node[below right]{$\boxed{\grad{V}=\nicefrac{mv^2}{r}}$};
\draw[dashed] (0,2)--(4.25,2);
\node[left=13] at (0,2) {$E_{\text{ellipse}}$};
\draw[dashed] (0,5)--(0.425,5);
\node[left] at (0,5) {$E_{\text{hyperbola}}$};
\draw[dashed] (2.2,.75)--(2.2,3);
\node[above] at (2.2,3) {$r_{\text{circle}}$};
\draw[dashed] (1.1,2)--(1.1,3);
\node[above] at (1.1,3) {$r_{\text{min}}$};
\fill (1.1,2) circle (2pt) node[below left,scale=0.4] {$E=V_{\text{eff}}(r_{\text{min}})$};
\draw[dashed] (4.3,2)--(4.3,3);
\fill (4.3,2) circle (2pt) node[below right,scale=0.4] {$E=V_{\text{eff}}(r_{\text{max}})$};
\node[above] at (4.3,3) {$r_{\text{max}}$};
\node[right] at (1.8,-0.3) {$L=0$};
\draw[<->,thick] (2.3,0.75)--(2.3,2);
\draw[<-] (2.4,1.5) to[out=0,in=180] (5,1) node[right] {Radial Kinetic Energy};
\node at (6,6) {$\boxed{V_{\text{eff}}=-\frac{k}{r^n}+\frac{L^2}{2mr^2}}$};
\end{tikzpicture}
\end{document}