\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}
Asked
Active
Viewed 104 times
0
Thales Souza Freire
- 325
- 1
- 9
1 Answers
1
The idea is to do something like
\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}
where \E{#1}{<number>} stands for your #<number>.
Check the function definitions, because I get a gnuplot error; the expanded version seems to be
( (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)) )
egreg
- 1,121,712
#10can be used. Add it at the bottom of your question. – egreg Feb 02 '18 at 22:02