在 tikz 中绘制相空间曲线

在 tikz 中绘制相空间曲线

我想绘制一个像我所附的图表来描述一些微分方程的解族。

这就是我想要的

我设法绘制了极值曲线,但绘制内部曲线时遇到了一些困难,特别是我不知道如何绘制遵循外部曲线“轮廓”的线条。我在这里还附上我绘制的带有内部线条的示例,这不是我想要的。

\documentclass[border=3pt]{standalone}
\usepackage{amsmath, amssymb, amsfonts, amscd, amsthm, bigints}
\usepackage{tikz}

\usetikzlibrary{decorations.pathmorphing, calc, shapes, positioning,fit,arrows,fadings,decorations.pathreplacing,     decorations.pathmorphing,intersections}
\usetikzlibrary{decorations.markings}
%%%%%%%%Tikz definitions %%%%%%%%%%%%%%%%%
\tikzset{->-/.style={decoration={
markings,
mark=at position #1 with {\arrow{latex}}},postaction={decorate}}}
%
\begin{document}
\begin{tikzpicture}
        %
    \def\N{7}
        \def\thetaDW4{60}
        \def\dDW4{5}
        \def\thetaAdS4{90}
        \def\dAdS4{5}
        %
    \node[label=below:$\mathrm{AdS}_2 \times \Sigma_\mathfrak{g}$, fill, draw, circle, minimum size=0.01, inner sep=1] (AdS2) at (0,0) {};
        \node[fill, draw, circle, minimum size=0.01, inner sep=1] (DW4) at ($(AdS2) + (\thetaDW4:\dDW4)$) {};
        \node[label=above:$\mathrm{AdS}_4$, fill, draw, circle, minimum size=0.01, inner sep=1] (AdS4) at ($(AdS2) + (\thetaAdS4:\dAdS4)$) {};
    \node at (1.2,5.15) {$\textcolor{blue}{m^2 \varphi^2}$};
    \node at (-.55, 3.5) {$\textcolor{red}{\bigintss\!\! F = q}$};

       \def\outDW4{-75}
       \def\outAdS4{-85}
       \def\inAdS2{75}
    %
           \draw[->-=.45, color= red] (DW4) to [out=\outDW4, in=\inAdS2] (AdS2);
           \draw[->-=.45, color= red] (AdS4) to [out=\outAdS4, in=\inAdS2] (AdS2);
           \draw[->-=.55] (AdS4) to [out=0, in=\inAdS2] (AdS2);

       \path[name path=AdS4DW4, draw, color = blue, ->-=.4] (AdS4) to[out=10, in=190] (DW4);

\end{tikzpicture}
\end{document}

在此处输入图片描述

答案1

你可以定义一个装饰来帮助你标记里程碑,然后使用这些里程碑来计算同伦

\documentclass[border=9,tikz]{standalone}
\usetikzlibrary{calc,decorations}

\pgfdeclaredecoration{mark milestone}{initial}{
    \state{initial}[width=0pt,next state=mark]{
        \xdef\markmilestoneindex{0}
        \xdef\markmilestonename{\csname tikz@fig@name\endcsname}
        \pgfmathsetmacro\markmilestonesep{\pgfdecoratedpathlength/10}
        \xdef\markmilestonesep{\markmilestonesep}
    }
    \state{mark}[width=\markmilestonesep pt]{
        \coordinate(\markmilestonename-\markmilestoneindex);
        \pgfmathtruncatemacro\markmilestoneindex{\markmilestoneindex+1}
        \xdef\markmilestoneindex{\markmilestoneindex}
    }
    \state{final}{
        \pgftransformshift{\pgfpointdecoratedpathlast}
        \coordinate(\markmilestonename-\markmilestoneindex);
    }
}

\begin{document}
    \begin{tikzpicture}
        \def\N{7}
        \def\thetaDW4{60}
        \def\dDW4{5}
        \def\thetaAdS4{90}
        \def\dAdS4{5}
        \node(AdS2)at(0,0){};
        \node(DW4)at($(AdS2)+(\thetaDW4:\dDW4)$){};
        \node(AdS4)at($(AdS2)+(\thetaAdS4:\dAdS4)$){};
        \def\outDW4{-75}
        \def\outAdS4{-85}
        \def\inAdS2{75}
        \draw[blue](AdS4)to[out=10,in=190](DW4);
        \draw[red](DW4)to[out=\outDW4,in=\inAdS2](AdS2);
        \path[name=pathA,decorate,decoration={mark milestone}]
                  (AdS4)to[out=10,in=190](DW4)
                  (DW4)to[out=\outDW4,in=\inAdS2](AdS2);
        \draw[red](AdS4)to[out=\outAdS4,in=\inAdS2](AdS2);
        \path[name=pathB,decorate,decoration={mark milestone}]
                  (AdS4)to[out=\outAdS4,in=\inAdS2](AdS2);
        \foreach\r in{.1,.2,...,.9}{
            \draw[rounded corners,opacity=\r]
                ($(pathA-0)!\r!(pathB-0)$)
                foreach\i in{1,...,10}{
                    --($(pathA-\i)!\r!(pathB-\i)$)
                }
            ;
        }
    \end{tikzpicture}
\end{document}

相关内容