나는 투석기(Eq2)와 파생물(Eq1)의 질량 전달에 관한 일부 동일성을 플롯하려고 합니다. b=d이면 x/0이 되는 경향이 있으므로 케이스별로 플롯해야 합니다. 제공된 그림에서 볼 수 있듯이 이것은 다른 경우에도 잘 작동합니다.
! Extra }, or forgotten \endgroup.
EQ2를 사용하면 내가 올바르게 검색한 경우 내 오류와 연결되지 않은 것 같은 오류가 발생합니다 .
이 문제를 어떻게 극복할 수 있는지 어떤 아이디어가 있나요?
MWE:
\documentclass[11pt,oneside,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{tikz}
\usepackage{pgfplots}
\usetikzlibrary{backgrounds}
\usepackage{amsmath}
\pgfplotsset{width=7.5cm,compat=newest,
}%compat ist die versionsnummer
\usepgfplotslibrary{external} %rendert, speichert, laedt und spart so zeit
\tikzexternalize
\begin{document}
\begin{equation}
\begin{split}
& \frac{\partial K(QB,QD,KoA)}{\partial QB}= \\ & \begin{cases} \frac{(de^{k/b}(dbe^{k/b}+(k-d)e^{k/d}b-dke^{k/d}))}{(b(de^{k/b}-e^{k/d}b)^2)} &\forall ~QB \neq QD\\\
k^2/(2(d + k)^2)&\forall ~QB= QD\
\end{cases}
\end{split}
\label{e:dkdqb}
\end{equation}
with:
\begin{equation}
K_{Diffusion} =\begin{cases} QB \frac{e^{\frac{koA}{QB}-\frac{KoA}{QD}}-1}{e^{\frac{koA}{QB}- \frac{KoA}{QD}}-\frac{QB}{QD}}
\quad & \forall \frac{QB}{QD} \neq 1 \\
\frac{KoA}{\frac{KoA}{QB}+1}
\quad & \forall \frac{QB}{QD} = 1\end{cases}\label{e:k}
\end{equation}
\begin{figure}
\begin{tikzpicture}[show background rectangle,tight background,
declare function={
kqb(\b,\d,\k)=ifthenelse(
\b==\d,%
(\k^2/(2(\d+\k)^2)),%
((\d*exp(\k/\b)*(\d*\b*exp(\k/\b)+(\k-\d)*exp(\k/\d)*\b-\d*\k*exp(\k/\d)))/
(\b*(\d*exp(\k/\b)-exp(\k/\d)*\b)^2))
);
kqb2(\b,\d,\k)=((\d*exp(\k/\b)*(\d*\b*exp(\k/\b)+(\k-\d)*exp(\k/\d)*\b-\d*
\k*exp(\k/\d)))/(\b*(\d*exp(\k/\b)-exp(\k/\d)*\b)^2))
);
},
]
\begin{axis}[
width=0.475\textwidth,
height=0.475\textwidth,
% title={nummer1},
xlabel=$QB$, ylabel=$KoA$,
% zlabel=$\frac{\partial k}{\partial QD}$,
xtick={100,200,300,400,500},
% ytick={200,500,1000},
% zlabel style={yshift=-0.25cm},
xlabel style={yshift=0.2cm},
ylabel style={yshift=.75cm,xshift=-.375cm },
% ztick={0,0.5,1},
x dir=reverse,
grid=major,
% view={0}{90},
minor tick num=4,
%colormap,
%colorbar=blackwhite
]
\addplot3[
surf,
domain=500:100,
domain y=300:1500,
% contour gnuplot={
% number=10,
% levels={0.01,0.025,0.05,0.1,0.2,0.3,0.4,0.5,0.6},
% labels={true}},
% thick,
samples=45,samples y=45,
]
% {(kk2(x,1000,y))};
% {(kqb2(x,1000,y))};
{(kqb(x,1000,y))};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}[show background rectangle,tight background,
declare function={
kk2(\b,\d,\k)=ifthenelse(\b==\d,%
(\d^2/(\d+\k)^2),%
(((\d-\b)^2*exp(\k/\d+\k/\b))/(\b*exp(\k/\d)-\d*exp(\k/\b))^2));
},
]
\begin{axis}[
width=0.475\textwidth,
height=0.475\textwidth,
% title={nummer1},
xlabel=$QB$, ylabel=$KoA$,
% zlabel=$\frac{\partial k}{\partial QD}$,
xtick={100,200,300,400,500},
% ytick={200,500,1000},
% zlabel style={yshift=-0.25cm},
xlabel style={yshift=0.2cm},
ylabel style={yshift=.75cm,xshift=-.375cm },
% ztick={0,0.5,1},
x dir=reverse,
grid=major,
% view={0}{90},
minor tick num=4,
%colormap,
%colorbar=blackwhite
]
\addplot3[
surf,
domain=500:100,
domain y=300:1500,
% contour gnuplot={
% number=10,
% levels={0.01,0.025,0.05,0.1,0.2,0.3,0.4,0.5,0.6},
% labels={true}},
% thick,
samples=45,samples y=45,
]
{(kk2(x,1000,y))};
% {(kqb(x,1000,y))};
% {(kqb(x,1000,y))};
\end{axis}
\end{tikzpicture}
\begin{tikzpicture}[show background rectangle,tight background,
declare function={
kqb2(\b,\d,\k)=((\d*exp(\k/\b)*(\d*\b*exp(\k/\b)+(\k-\d)*exp(\k/\d)*\b-\d*
\k*exp(\k/\d)))/(\b*(\d*exp(\k/\b)-exp(\k/\d)*\b)^2)));
},
]
\begin{axis}[
width=0.475\textwidth,
height=0.475\textwidth,
% title={nummer1},
xlabel=$QB$, ylabel=$KoA$,
% zlabel=$\frac{\partial k}{\partial QD}$,
xtick={100,200,300,400,500},
% ytick={200,500,1000},
% zlabel style={yshift=-0.25cm},
xlabel style={yshift=0.2cm},
ylabel style={yshift=.75cm,xshift=-.375cm },
% ztick={0,0.5,1},
x dir=reverse,
grid=major,
% view={0}{90},
minor tick num=4,
%colormap,
%colorbar=blackwhite
]
\addplot3[
surf,
domain=500:100,
domain y=300:1500,
% contour gnuplot={
% number=10,
% levels={0.01,0.025,0.05,0.1,0.2,0.3,0.4,0.5,0.6},
% labels={true}},
% thick,
samples=45,samples y=45,
]
% {(kk2(x,1000,y))};
{(kqb2(x,1000,y))};
% {(kqb(x,1000,y))};
\end{axis}
\end{tikzpicture}
\end{figure}
\end{document}
답변1
@muzimuzhi가 지적했듯이 그것은 단지 누락된 것이었습니다 *
kqb(\b,\d,\k)=ifthenelse(\b==\d,(\k^2/(2 (\d+\k)^2)),)에 *가 누락되었습니다.