2

I have a problem using the TikZ/pgfplots package in LaTeX. I need to graph a function like this:

$y=-\log_{10} (0.5\cdot (-x+\sqrt{x^2+4 \cdot 10^{-14}})$

And I have been using this code without results:

\documentclass{article}
\usepackage{pgfplots}
\pgfmathdeclarefunction{a}{1}{\pgfmathparse{(0.1*(#1-50)/(50+#1))}}
\pgfmathdeclarefunction{c}{1}{\pgfmathparse{-log10(0.5*(-#1+(#1^2+4*10^(-14))^0.5))}}
\pgfplotsset{compat=newest,
width=150mm,
height=100mm}

\begin{document} \begin{center}

\Large $y=-\log_{10} (0.5\cdot (-x+\sqrt{x^2+4 \cdot 10^{-14}})$

\igskip

\begin{tikzpicture} \begin{axis} [ xlabel = {$V$}, ylabel = {$pH$}, clip=false, ymin=0, ymax=14, xmin=0, xmax=100, ]

\def\a{} \addplot[ domain=0:100, samples=200, unbounded coords=discard ] { c(a(x)) }; \end{axis}

\end{tikzpicture} \end{center} \end{document}

The graph is cut near x=50, almost when the slope became vertical.

enter image description here

What could be the problem?

0 Answers0