7

I would like to draw a graph like the one I attach to describe a family of solutions of some differential equations.

This is what I would like

I managed to draw the extremal curves, but I have some difficulties with the internal ones, in particular I don't get how to make the lines following the "profile" of the external ones. I attach here also an example of what I get, with an internal line, which is not what I would like to get.

\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}

enter image description here

1 Answer 1

4

You can define a decoration that help you mark the milestones and then use these milestones to calculate the homotopy

\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}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .