我正在尝试绘制酸碱滴定曲线,如下图所示:
我画出了曲线,但我不知道如何画切线和\frac{\dd pH}{\dd V_b}
,下面是我尝试画曲线:
\begin{center}
\begin{tikzpicture}[ultra thick,scale=1]
\begin{axis}[ axis x line=bottom,axis y line = left, smooth, minor tick num=4,ymin=0,ymax=12,ultra thick, xlabel={$V_{B}$ ml},ylabel={pH }]
\addplot[smooth, black] coordinates {
(0,2) (2,2.1) (4,2.2) (6,2.3) (8,2.4) (10,2.5) (12,2.6) (14,2.7) (16,2.9) (18,3.3) (18.5,3.45)(19,3.6)
(19.5,4.2)(20,7)(20.5,9.3)(21,10)(21.5,10.3)(22,10.5)(24,10.9)(26,11)(28,11.1)(30,11.2)};
\end{axis}
\end{tikzpicture}
\end{center}
有没有什么方法可以画出两条切线、角平分线以及函数g(V_b)
?
答案1
如果您想要更平滑的滴定曲线,您可以使用 查看我的答案tikz
。35° 角作为切线效果很好。
\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{intersections}
\tikzset{%
every pin/.style={font=\small, pin distance=5mm, inner sep=0pt},
every pin edge/.style={draw=black, line width=0.5*\pgflinewidth},
small dot/.style={fill=black, circle, scale=0.25}
}
\begin{document}
\begin{tikzpicture}
%draw grid and axix with ticks
\draw[help lines, gray!25!white] (0,0) grid[step=0.5] (15,6);
\draw[-stealth] (0,0) -- (0,6.5) node[above] {pH};
\draw[-stealth] (0,0) -- (15.5,0) node[right] {$\mathrm{V_B~/~mL}$};
\foreach [evaluate=\i as \n using (\i)*2] \i in {0,2.5,5,...,15} {
\draw (\i,0) -- (\i,-0.125) node[below] {\n};
}
\foreach [evaluate=\i as \n using (\i)*2] \i in {0,1,...,6} {
\draw (0,\i) -- (-0.125,\i) node[left] {\n};
}
% draw titration curve
% \draw [gray!50] (0,1) -- (2,1.5) -- (8,2) -- (9,5) -- (15,6);
\draw [black, name path=a] plot [smooth, tension=0.5] coordinates {(0,1) (2,1.5) (8,2) (9,5) (15,6)};
% draw second function g(VB)
% \draw [gray!50] (7,0) -- (8.25,0.1) -- (8.5,1) -- (8.75,0.1) -- (10,0);
\draw [black, name path=b] plot [smooth, tension=0.5] coordinates {(7,0) (8.25,0.1) (8.5,1) (8.75,0.1) (10,0)};
% draw linear funktion with 35° slope which points through (9,5); (8.5,3.5); (8,2)
\draw[domain=6:10, smooth, variable=\x] plot ({\x, \x*0.47381472+0.735667516});
\draw[domain=6.5:10.5, smooth, variable=\x] plot ({\x, \x*0.47381472-0.527425124});
\draw[domain=7:11, smooth, variable=\x] plot ({\x, \x*0.47381472-1.790517763});
% draw linear function perpendicular to the upper ones (m1*m2=-1) which penetrates (9.75 and y value of first liea function)
\draw[domain=9.75:10.73, smooth, variable=\x] plot ({\x, \x*-2.1105296+25.9330248});
% draw equiv point
\draw[densely dashed] (0,3.5) node[left] {$\mathrm{{pH}_{equiv}}$} -- (8.5,3.5) node[above left] {$\mathrm{E}$} -- (8.5,0) node[below] {$\mathrm{V_{equiv}}$};
% label functions
\path[name path=c] (0,5) -- (15,5);
\path[name intersections={of=c and a},];
\coordinate (P1) at (intersection-1);
\path[name path=d] (0,0.75) -- (15,0.75);
\path[name intersections={of=d and b},];
\coordinate (P2) at (intersection-2);
\node[small dot, pin={above left:$\mathrm{pH=f(V_B)}$},] at (P1) {};
\node[small dot, pin={above right:$\mathrm{\frac{d(pH)}{d(V_B)}=g(V_B)}$},] at (P2) {};
\end{tikzpicture}
\end{document}
答案2
我决定在左边画,因为曲率非常接近图片的右侧。您可以将代码适配到任何切线,因为点坐标就在切线上。
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots,tkz-euclide}
\begin{document}
\begin{tikzpicture}[ultra thick,scale=1]
\begin{axis}[ axis x line=bottom,axis y line = left, smooth, minor tick num=4,ymin=0,ymax=12,ultra thick, xlabel={$V_{B}$ ml},ylabel={pH }]
\addplot[smooth, black] coordinates {
(0,2) (2,2.1) (4,2.2) (6,2.3) (8,2.4) (10,2.5) (12,2.6) (14,2.7) (16,2.9) (18,3.3) (18.5,3.45)(19,3.6)
(19.5,4.2)(20,7)(20.5,9.3)(21,10)(21.5,10.3)(22,10.5)(24,10.9)(26,11)(28,11.1)(30,11.2)};
% Tangent lines
\addplot[domain=5:27, samples=100,thin]{0.2*x+6.2} coordinate[pos=0.1] (A) coordinate[pos=0.9] (A');
\addplot[domain=10:30, samples=100,thin]{0.2*x-0.4} coordinate[pos=0.1] (C) coordinate[pos=0.9] (D);
\end{axis}
\begin{scope}[line width=.75pt]
\tkzDefLine[perpendicular=through A](D,C) \tkzGetPoint{A'}
\tkzInterLL(A,A')(C,D) \tkzGetPoint{B}
\tkzDefMidPoint(A,B)\tkzGetPoint{M}
\tkzDefLine[parallel=through M](C,D) \tkzGetPoint{N}
\tkzDrawLine[add=0.1 and 0.1](M,N)
\tkzDrawSegment(A,B)
\tkzMarkSegments[mark=s||](A,M M,B)
\path (M) -- (N) node[pos=0.65] (e) {};
\pgfgetlastxy{\xe}{\ye}
\draw[dashed] (\xe,0) |- (0,\ye);
\node[above left] at (e) {E};
\end{scope}
\end{tikzpicture}
\end{document}