7

I'm trying to draw acid-base titration curve as it's shown here in this picture:

titration curve

I've drawn the curve, but I didn't know how to draw the tangents and \frac{\dd pH}{\dd V_b}, and here's my attempt to draw the curve :

\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}

enter image description here

Is there any method to draw the two tangents, the bisector, and also the function g(V_b)?

2
  • 1
    Hello Med-Elf. Do you need just a scheme or actual calculation?
    – Excelsior
    Mar 30 at 15:57
  • 3
    I am pretty sure TikZ allows you to specify a curve by points to pass through and slope at those points (using cubic splines). In that case you can actually draw your titration curve with slopes specified at certain points, after which drawing the tangent lines are easy. Mar 30 at 15:58
9

Just in case you want a smoother titration curve, you can check my answer using tikz. An angle of 35° works well as tangent.

\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}

enter image description here

1
  • 1
    (+1) and the correct answer, Thank you so much you deserve to get more upvotes, consider to edit your answer so it'll be shown for the others, I'm sure they're going to like it !
    – Med-Elf
    Mar 31 at 10:10
12

A straightforward solution using tkz-euclide. Titration curve

I decided to draw on the left, since your the curvation is really close to the right of the picture. You can adapt the code to any tangent, because the points coordinates are on them.

\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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.