\def\g(#1,#2,#3,#4,#5,#6,#7,#8,#9,#10){(#6)*exp(-(#2)/(#7))+((#6)**2)*exp(2*(-(#2))/(#7))*(#9)*exp((#4)/(#7)}%
\def\f(#1,#2,#3,#4,#5,#6,#7,#8,#9,#10){1+2*(#6)*exp(-(#2)/(#7))+((#6)**2)*exp(2*(-(#2))/(#7))*exp((#4)/(#7))}%
\def\h(#1,#2,#3,#4,#5,#6,#7,#8,#9,#10){2*(#10)*exp(-(#1)/(#7)) +exp( (#3)/(#7) )*( (#10)*exp(-(#1)/(#7) ) )^2 + 2*(#6)*exp(-(#2)/(#7))*(#10)*exp(-(#1)/(#7) )*exp((#5)/(#7)) }%
\def\v(#1,#2,#3,#4,#5,#6,#7,#8,#9,#10){( \g(#1,#2,#3,#4,#5,#6,#7,#8,#9,#10) + (#6)*exp(-(#2)/(#7))*(#10)*exp(-(#1)/(#7))*(#8)*exp((#5)/(#7)) )/(\f(#1,#2,#3,#4,#5,#6,#7,#8,#9,#10) + \h(#1,#2,#3,#4,#5,#6,#7,#8,#9,#10) )}}
\begin{tikzpicture}
\begin{axis}
\addplot[blue,mark=none,
domain=0.0001:1,samples=300, line width=1]
gnuplot { \v(0,(-10),0,0,0,x/10^3,1,1,1,1) }
\end{axis}
\end{tikzpicture}
\end{document}
答案1
这个想法是
\documentclass{article}
\usepackage{xparse,pgfplots}
\ExplSyntaxOn
\NewExpandableDocumentCommand{\E}{mm}
{
\clist_item:nn { #1 } { #2 }
}
\ExplSyntaxOff
\NewExpandableDocumentCommand{\funcg}{m}
{
(\E{#1}{6})*exp(-(\E{#1}{2})/(\E{#1}{7}))+((\E{#1}{6})**2)*
exp(2*(-(\E{#1}{2}))/(\E{#1}{7}))*(\E{#1}{9})*exp((\E{#1}{4})/(\E{#1}{7})
}
\NewExpandableDocumentCommand{\funcf}{m}
{
1+2*(\E{#1}{6})*exp(-(\E{#1}{2})/(\E{#1}{7}))+((\E{#1}{6})**2)*
exp(2*(-(\E{#1}{2}))/(\E{#1}{7}))*exp((\E{#1}{4})/(\E{#1}{7}))
}
\NewExpandableDocumentCommand{\funch}{m}
{
2*(\E{#1}{10})*exp(-(\E{#1}{1})/(\E{#1}{7})) +
exp( (\E{#1}{3})/(\E{#1}{7}) )*( (\E{#1}{10})*exp(-(\E{#1}{1})/(\E{#1}{7}) ) )^2 +
2*(\E{#1}{6})*exp(-(\E{#1}{2})/(\E{#1}{7}))*(\E{#1}{10})*exp(-(\E{#1}{1})/(\E{#1}{7}) )*
exp((\E{#1}{5})/(\E{#1}{7}))
}
\NewExpandableDocumentCommand{\funcv}{m}
{
(\funcg{#1} + (\E{#1}{6})*exp(-(\E{#1}{2})/(\E{#1}{7}))*
(\E{#1}{10})*exp(-(\E{#1}{1})/(\E{#1}{7}))*(\E{#1}{8})*exp((\E{#1}{5})/(\E{#1}{7})) )/
(\funcf{#1} + \funch{#1} )
}
\begin{document}
\begin{tikzpicture}
\begin{axis}
\addplot[blue,mark=none, domain=0.0001:1,samples=300, line width=1]
gnuplot { \funcv{0,(-10),0,0,0,x/10^3,1,1,1,1} };
\end{axis}
\end{tikzpicture}
\end{document}
其中\E{#1}{<number>}
代表你的#<number>
。
检查函数定义,因为我收到 gnuplot 错误;扩展版本似乎是
( (x/10^3)*exp(-((-10))/(1))+((x/10^3)**2)* exp(2*(-((-10)))/(1))*(1)*exp((
0)/(1) + (x/10^3)*exp(-((-10))/(1))* (1)*exp(-(0)/(1))*(1)*exp((0)/(1)) )/ ( 1
+2*(x/10^3)*exp(-((-10))/(1))+((x/10^3)**2)* exp(2*(-((-10)))/(1))*exp((0)/(1))
+ 2*(1)*exp(-(0)/(1)) + exp( (0)/(1) )*( (1)*exp(-(0)/(1) ) )^2 + 2*(x/10^3)
*exp(-((-10))/(1))*(1)*exp(-(0)/(1) )* exp((0)/(1)) )