如何在绘制某些曲线之前设置约束(pgfplot)

如何在绘制某些曲线之前设置约束(pgfplot)

我尝试在绘图之前为预定义函数设置一些约束(参见下面的代码),以避免函数发生变化。

约束必须是#6+#7=常数,所以我可以选择常数。

正如您在代码中看到的,我尝试将参数 #6 写为“x”,将参数 #7 写为“50-x”。但我不知道这是否是正确的,并且是否是唯一可以在不对 \def 函数进行任何修改的情况下设置此约束的方法。(抱歉我的英语不好)

\documentclass{standalone}
\usepackage[brazilian]{babel}
\usepackage{amsmath,amsfonts,physics,amssymb,mathtools,upgreek,bm}
\usepackage{tikz,pgfplots}
\pgfplotsset{compat=1.13,translate gnuplot=true}
\usepackage{xargs}
\usepackage{scalerel,relsize}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Definindo a Função IC50 %%%%%%%%%%%%%%%%%%%%

\def\g(#1,#2,#3,#4,#5,#6,#7,#8,#9){(#6)*exp(-(#2))+((#6)**2)*exp(2*(-(#2)))*(#9)*exp((#4))}%

\def\f(#1,#2,#3,#4,#5,#6,#7,#8,#9){1+2*(#6)*exp(-(#2))+((#6)**2)*exp(2*(-(#2)))*exp((#4))}%

\def\h(#1,#2,#3,#4,#5,#6,#7,#8,#9){2*(#7)*exp(-(#1)) +exp( (#3) )*( (#7)*exp(-(#1) ) )^2 + 2*(#6)*exp(-(#2))*(#7)*exp(-(#1) )*exp((#5)) }%

\def\v(#1,#2,#3,#4,#5,#6,#7,#8,#9){( \g(#1,#2,#3,#4,#5,#6,#7,#8,#9) + (#6)*exp(-(#2))*(#7)*exp(-(#1))*(#8)*exp((#5)) )/( \f(#1,#2,#3,#4,#5,#6,#7,#8,#9) + \h(#1,#2,#3,#4,#5,#6,#7,#8,#9) )}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
\begin{tikzpicture}

\begin{axis}[
            tick label style={font=\scriptsize},
        label style={font=\scriptsize},            
            xlabel=${[S](\upmu M)}$ / ${[H_2O]}$,           
            ylabel=${ ({d[P]}/{dt})(2K_{cat}[E_{tot}])^{-1}}$,      
            legend pos=north east,
            grid=major,        
            ymax=1, ymin=0,
            xmax=50, xmin=1,
            x dir=reverse,  
            ] 


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 \addplot[red,mark=none,domain=0.0001:200,samples=250, line width=1]
  gnuplot { \v((-12),(-12),0,0,0,x/10^6,(50-x)/10^6,1,1) };
\end{axis}

\end{tikzpicture}

\end{document}

相关内容