0

I'm trying to draw the functions y=(0.05*0.4+0.1*2*x)/(0.05+0.1*2) and x=-0.1/(2*30*(y - 0.1))+y, by using tikz as follows

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xmin=0,xmax=1,ymin=0,ymax=1, samples=1000, xlabel={$c$}, ylabel={$s$}]
 \addplot[blue, ultra thick] (x,{(0.05*0.4+0.1*2*x)/(0.05+0.1*2)});
 \addplot[red,  ultra thick] ({-0.1/(2*30*(x - 0.1))+x},x);
\end{axis}
\end{tikzpicture}
\end{document}

and the result is

enter image description here

Thanks to the answers to Tikz picture of two mathematical functions, I was able to draw the functions correctly. However, I notice (red) the presence of an asymptote which should be traced or removed (it is not part of fraph of a function).

1

It's not an asymptote, it's a straight line between 2 plots, because of a discontinuity: the graph defined by x=-0.1/(2*30*(y - 0.1))+y has discontinuity at y=0.1.

You can remedy so:

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\begin{tikzpicture}
\begin{axis}[xmin=0,xmax=1,ymin=0,ymax=1, samples=1000, xlabel={$c$}, ylabel={$s$}]
 \addplot[blue, ultra thick] (x,{(0.05*0.4+0.1*2*x)/(0.05+0.1*2)});
 \addplot[red,  ultra thick, domain=0:0.0999] ({-0.1/(2*30*(x - 0.1))+x},x);
 \addplot[red,  ultra thick, domain=0.1001:1] ({-0.1/(2*30*(x - 0.1))+x},x);
\end{axis}
\end{tikzpicture}
\end{document}

enter image description here

You can also simplify your code by replacing 2*30 with 60 and so on.

Edit: I don't see this question is a duplicate of Tikz picture of two mathematical functions, asked by the same user 4 hours ago.

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.