How do I draw an attachment? Bugs: For (a) the last oval problem; For (b) Rotation, Arrow and Size; For (c) Just the arrow for lins. Can they please help?
\documentclass{article}
\usepackage[margin=1.5in]{geometry}
\usepackage{tikz}
\usetikzlibrary{decorations.pathreplacing,decorations.markings,arrows.meta, bending, decorations.markings,calc}
\usepackage{pgfplots,pgfplotstable}
\usepackage{rotating}
\usepackage{subcaption}
%\pgfplotset{compar=1.15}
\usepackage{pstricks-add}
\psset{plotpoints=500, algebraic, arrowinset=0.2, labelsep=3pt}
\tikzset{
on each segment/.style={
decorate,
decoration={
show path construction,
moveto code={},
lineto code={
\path [#1]
(\tikzinputsegmentfirst) -- (\tikzinputsegmentlast);
},
curveto code={
\path [#1] (\tikzinputsegmentfirst)
.. controls
(\tikzinputsegmentsupporta) and (\tikzinputsegmentsupportb)
..
(\tikzinputsegmentlast);
},
closepath code={
\path [#1]
(\tikzinputsegmentfirst) -- (\tikzinputsegmentlast);
},
},
},
mid arrow/.style={postaction={decorate,decoration={
markings,
mark=at position .5 with {\arrow[#1]{stealth}}
}}},
}
\begin{document}
\begin{figure}[htb]
\centering
\begin{subfigure}[h]{6.5cm}
\begin{tikzpicture}[scale=.6]
\draw (-4,4) node[left]{4} -- (4,4) -- (4,-4) node[below]{4} -- node[midway,below]{$x$} (-4,-4) node[below]{-4} node[left]{-4} -- node[midway,left]{$\dot{x}$} cycle;
\foreach \x in {-3,...,3}
\draw (\x cm,-4) -- (\x cm,-3.9){};
\foreach \xx in {-3,...,3}
\draw (\xx cm,4) -- (\xx cm,3.9){};
\foreach \y in {-3,...,3}
\draw (-4,\y) -- (-3.9,\y){};
\foreach \yy in {-3,...,3}
\draw (4,\yy) -- (3.9,\yy){};
\draw[dashed] (-4,0) -- (4,0);
\draw[dashed] (0,-4) -- (0,4);
\draw (0,0) (0,0) circle(.25);
\path [draw=black,postaction={on each segment={mid arrow=black}}]
(0,0) circle(.6)
(0,0) circle(1)
(0,0) circle(1.75)
(0,0) ellipse (2.75cm and 2.2cm);
\end{tikzpicture}
\caption{Stable in the sense of Lyapunov}
\end{subfigure} \\
%
\begin{subfigure}[h]{6.5cm}
\begin{tikzpicture}[scale=.6,
decoration = {markings,mark=at position .84 with
{\arrowreversed[black]{Latex[length=1.5mm]}}}
]
\draw (-4,4) node[left]{4} -- (4,4) -- (4,-4) node[below]{4} -- node[midway,below]{$x$} (-4,-4) node[below]{-4} node[left]{-4} -- node[midway,left]{$\dot{x}$} cycle;
\foreach \x in {-3,...,3}
\draw (\x cm,-4) -- (\x cm,-3.9){};
\foreach \xx in {-3,...,3}
\draw (\xx cm,4) -- (\xx cm,3.9){};
\foreach \y in {-3,...,3}
\draw (-4,\y) -- (-3.9,\y){};
\foreach \yy in {-3,...,3}
\draw (4,\yy) -- (3.9,\yy){};
\draw[dashed] (-4,0) -- (4,0);
\draw[dashed] (0,-4) -- (0,4);
\psplot[polarplot, arrows=-, linewidth=.5pt, dotsize=2.5pt]{0}{25}{-1.2*EXP(-x/4)}
\psplot[polarplot, arrows=-, linewidth=.5pt, dotsize=2.5pt]{0}{25}{-1*EXP(-x/4.5)}
\psplot[polarplot, arrows=-, linewidth=.5pt, dotsize=2.5pt]{-1.55}{25}{-1.7*EXP(-x/4.5)}
\psplot[polarplot, arrows=-, linewidth=.5pt, dotsize=2.5pt]{-1.55}{25}{-2*EXP(-x/5)}
\end{tikzpicture}
\caption{Asymptotically stable}
\end{subfigure}
%
\begin{subfigure}[h]{6.5cm}
\begin{tikzpicture}[scale=.6]
\draw (-4,4) node[left]{0.4} -- (4,4) -- (4,-4) node[below]{-0.4} -- node[midway,below]{$x$} (-4,-4) node[below]{-0.4} node[left]{-0.4} -- node[midway,left]{$\dot{x}$} cycle;
\foreach \x in {-3,...,3}
\draw (\x cm,-4) -- (\x cm,-3.9){};
\foreach \xx in {-3,...,3}
\draw (\xx cm,4) -- (\xx cm,3.9){};
\foreach \y in {-3,...,3}
\draw (-4,\y) -- (-3.9,\y){};
\foreach \yy in {-3,...,3}
\draw (4,\yy) -- (3.9,\yy){};
\draw[dashed] (-4,0) -- (4,0);
\draw[dashed] (0,-4) -- (0,4);
\draw (-3.5,-4) .. controls (-2.8,-2) and (-2,-.5) .. (-2.75,2);
\draw (-3,-4) .. controls (-2,-2) and (.5,-.75) .. (-1.5,2.25);
\draw (-3,-4) .. controls (0.25,-.5) and (-.25,-.5) .. (1,-2.5);
\begin{scope}[rotate=180]
\draw (-3.5,-4) .. controls (-2.8,-2) and (-2,-.5) .. (-2.75,2);
\draw (-3,-4) .. controls (-2,-2) and (.5,-.75) .. (-1.5,2.25);
\draw (-3,-4) .. controls (0.25,-.5) and (-.25,-.5) .. (1,-2.5);
\end{scope}
\end{tikzpicture}
\caption{Unstable (saddle)}
\end{subfigure}
\end{figure}
\end{document}



pgfplotsto solve an ODE, see https://tex.stackexchange.com/a/139141. In principle this can be done with TikZ only, too. If you know the analytic expressions for these curves, it will be easier, of course. – Nov 26 '19 at 07:40\pgfplotset{compar=1.15}in the preamble, to avoid ugly axis ticks. – Rmano Nov 26 '19 at 08:48