0

On some of the queries, I have seen people ask on how to draw linear inequalities (i.e. how to fill the area with color based on the inequality). Sorry, my code is super long:

\documentclass[12pt]{article}
\usepackage{pgfplots}
%\pgfplotsset{compat=1.16}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usepackage{changepage}
\usepackage[margin=1in]{geometry} 
\usepackage{float}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{decorations.markings}
\tikzset{arrow marks/.style={postaction=decorate,decoration={markings,
            mark=between positions #1 and 1 step #1 with {\arrow{>}}}},
    arrow marks/.default=10pt}
\begin{document}
    \begin{figure}[H]
        \begin{adjustwidth}{-0.7in}{-0.7in}
            \centering
            \begin{tikzpicture}
                \def\a{0.5}
                \def\lambda{5}
                \def\xTwoInitPosToZeroOne{1.5}
                \def\xOneInitPosToZeroOne{ln(1 +(\lambda*\a* \xTwoInitPosToZeroOne)/(\lambda + 2*\a*\xTwoInitPosToZeroOne))/(\a^2) - \xTwoInitPosToZeroOne/\a}
                \def\zeroControlPosToNegOne{ln((2*\a* \xTwoInitPosToZeroOne + \lambda)/\lambda)/\a}
                \def\xTwoInitPosToZeroTwo{2}
                \def\xOneInitPosToZeroTwo{ln(1 +(\lambda*\a* \xTwoInitPosToZeroTwo)/(\lambda + 2*\a*\xTwoInitPosToZeroTwo))/(\a^2) - \xTwoInitPosToZeroTwo/\a}
                \def\zeroControlPosToNegTwo{ln((2*\a* \xTwoInitPosToZeroTwo + \lambda)/\lambda)/\a}
                \def\xTwoInitPosToZeroThree{3}
                \def\xOneInitPosToZeroThree{ln(1 +(\lambda*\a* \xTwoInitPosToZeroThree)/(\lambda + 2*\a*\xTwoInitPosToZeroThree))/(\a^2) - \xTwoInitPosToZeroThree/\a}
                \def\zeroControlPosToNegThree{ln((2*\a* \xTwoInitPosToZeroThree + \lambda)/\lambda)/\a}

                \def\xTwoInitNegToZeroOne{-1.5}
                \def\xOneInitNegToZeroOne{-ln(1 -(\lambda*\a* \xTwoInitNegToZeroOne)/(\lambda - 2*\a*\xTwoInitNegToZeroOne))/(\a^2) - \xTwoInitNegToZeroOne/\a}
                \def\zeroControlNegToPosOne{ln((-2*\a* \xTwoInitNegToZeroOne + \lambda)/\lambda)/\a}

                \def\xTwoInitNegToZeroTwo{-2}
                \def\xOneInitNegToZeroTwo{-ln(1 -(\lambda*\a* \xTwoInitNegToZeroTwo)/(\lambda - 2*\a*\xTwoInitNegToZeroTwo))/(\a^2) - \xTwoInitNegToZeroTwo/\a}
                \def\zeroControlNegToPosTwo{ln((-2*\a* \xTwoInitNegToZeroTwo + \lambda)/\lambda)/\a}

                \def\xTwoInitNegToZeroThree{-3}
                \def\xOneInitNegToZeroThree{-ln(1 -(\lambda*\a* \xTwoInitNegToZeroThree)/(\lambda - 2*\a*\xTwoInitNegToZeroThree))/(\a^2) - \xTwoInitNegToZeroThree/\a}
                \def\zeroControlNegToPosThree{ln((-2*\a* \xTwoInitNegToZeroThree + \lambda)/\lambda)/\a}
                \begin{axis}[
                    %xtick distance = {1},
                    %ytick distance = {1},
                    xmin=-12,xmax=12,
                    ymin=-8,ymax=8,
                    height = 7in,width=1.2\textwidth,
                    axis lines=center,
                    axis line style=->, xlabel = {$x_1$}, ylabel={$x_2$},
                    %axis equal,
                    legend cell align = {left},
                    every axis x label/.style={at={(ticklabel* cs:1.05)}, anchor=west,},
                    every axis y label/.style={at={(ticklabel* cs:1.05)}, anchor=south,}, 
                    title= {Bang-off-bang Control Trajectories},         title style={xshift=0, yshift=2em},
                    domain=-15:15,samples=300,legend pos=outer north east]
                    \addplot[->,>=latex,arrow marks=1cm,color = blue, thick, domain = -8:0,tips=proper]({-ln(1-\a*x)/\a^2 - x/\a}, {x}) node[below left, pos = 0.3, font = \small] {\(u^* = 1\)};
                    \addplot[->,>=latex,arrow marks=1cm,color = red, thick, domain = 8:0,tips=proper]({ln(1+\a*x)/\a^2 - x/\a}, {x}) node[above right, pos = 0.3, font = \small] {\(u^* = -1\)};
                    \addplot[dotted, color = black, thick, domain = 8:0,tips=proper]({ln(1+(\lambda*\a*x)/(\lambda + 2*\a*x))/\a^2 - x/\a}, {x});
                    \addplot[dotted, color = black, thick, domain = -8:0,tips=proper]({-ln(1-(\lambda*\a*x)/(\lambda - 2*\a*x))/\a^2 - x/\a}, {x}) node[above right, pos = 0.3, font = \small] {\(u^* = 0\)};

                    %%Starting from here, I am not sure if this is necessary or not
                    \addplot[->,>=latex,arrow marks=1cm, tips = proper,
                    color=red, dashed,thick,domain=-6:0] 
                    ({x/\a + (\xTwoInitPosToZeroOne/\a - 1/(\a^2))*(1 - exp(-\a*x)) + \xOneInitPosToZeroOne}, {1/\a + (\xTwoInitPosToZeroOne - 1/\a)*exp(-\a*x)});
                    \addplot[->,>=latex, color=red, tips = proper, dashed,thick,domain=0:\zeroControlPosToNegOne] ({(\xTwoInitPosToZeroOne/\a)*(1 - exp(-\a*x)) + \xOneInitPosToZeroOne}, {\xTwoInitPosToZeroOne*exp(-\a*x)});%1 Pos

                    \addplot[->,>=latex,arrow marks=1cm, tips = proper,
                    color=red, dashed,thick,domain=-6:0] 
                    ({x/\a + (\xTwoInitPosToZeroTwo/\a - 1/(\a^2))*(1 - exp(-\a*x)) + \xOneInitPosToZeroTwo}, {1/\a + (\xTwoInitPosToZeroTwo - 1/\a)*exp(-\a*x)});
                    \addplot[->,>=latex, color=red, tips = proper, dashed,thick,domain=0:\zeroControlPosToNegTwo] ({(\xTwoInitPosToZeroTwo/\a)*(1 - exp(-\a*x)) + \xOneInitPosToZeroTwo}, {\xTwoInitPosToZeroTwo*exp(-\a*x)});%2 Pos

                    \addplot[->,>=latex,arrow marks=1cm, tips = proper,
                    color=red, dashed,thick,domain=-6:0] 
                    ({x/\a + (\xTwoInitPosToZeroThree/\a - 1/(\a^2))*(1 - exp(-\a*x)) + \xOneInitPosToZeroThree}, {1/\a + (\xTwoInitPosToZeroThree - 1/\a)*exp(-\a*x)});
                    \addplot[->,>=latex, color=red, arrow marks=1cm, tips = proper, dashed,thick,domain=0:\zeroControlPosToNegThree] ({(\xTwoInitPosToZeroThree/\a)*(1 - exp(-\a*x)) + \xOneInitPosToZeroThree}, {\xTwoInitPosToZeroThree*exp(-\a*x)});%3 Pos

                    \addplot[->,>=latex,arrow marks=1cm, tips = proper,
                    color=blue, dashed,thick,domain=-6:0] 
                    ({-x/\a + (\xTwoInitNegToZeroOne/\a + 1/(\a^2))*(1 - exp(-\a*x)) + \xOneInitNegToZeroOne}, {-1/\a + (\xTwoInitNegToZeroOne + 1/\a)*exp(-\a*x)});
                    \addplot[->,>=latex, color=blue, tips = proper, dashed,thick,domain=0:\zeroControlNegToPosOne] ({(\xTwoInitNegToZeroOne/\a)*(1 - exp(-\a*x)) + \xOneInitNegToZeroOne}, {\xTwoInitNegToZeroOne*exp(-\a*x)});%1 Neg
                    \addplot[->,>=latex,arrow marks=1cm, tips = proper,
                    color=blue, dashed,thick,domain=-6:0] 
                    ({-x/\a + (\xTwoInitNegToZeroTwo/\a + 1/(\a^2))*(1 - exp(-\a*x)) + \xOneInitNegToZeroTwo}, {-1/\a + (\xTwoInitNegToZeroTwo + 1/\a)*exp(-\a*x)});
                    \addplot[->,>=latex, color=blue, tips = proper, dashed,thick,domain=0:\zeroControlNegToPosTwo] ({(\xTwoInitNegToZeroTwo/\a)*(1 - exp(-\a*x)) + \xOneInitNegToZeroTwo}, {\xTwoInitNegToZeroTwo*exp(-\a*x)});%2 Neg
                    \addplot[->,>=latex,arrow marks=1cm, tips = proper,
                    color=blue, dashed,thick,domain=-6:0] 
                    ({-x/\a + (\xTwoInitNegToZeroThree/\a + 1/(\a^2))*(1 - exp(-\a*x)) + \xOneInitNegToZeroThree}, {-1/\a + (\xTwoInitNegToZeroThree + 1/\a)*exp(-\a*x)});
                    \addplot[->,>=latex, color=blue, arrow marks = 1cm, tips = proper, dashed,thick,domain=0:\zeroControlNegToPosThree] ({(\xTwoInitNegToZeroThree/\a)*(1 - exp(-\a*x)) + \xOneInitNegToZeroThree}, {\xTwoInitNegToZeroThree*exp(-\a*x)});%3 Neg
                \end{axis}
            \end{tikzpicture}
        \end{adjustwidth} 
        \caption{Optimal control trajectories for Problem 4 for $a = 0.5$ and $\lambda = 5$. The solid plot is the final switching curve, the dotted plot is the switching curve to ``off" mode, while the dashed plots are the state trajectories that are not originally on the switching curve.}
    \end{figure}
\end{document}

I put Starting from here, I am not sure if this is necessary or not because I am not sure if the color filling will fill over the dashed curves. Here is my output (with "highlights"): enter image description here

What I am looking for is that on the LHS (i.e. to the left of the top part of the black dotted curve and to the left of the blue solid curve), I want to shade that area red (or pink, with some opacity), the area between the dotted and the solid curves (both red and blue) orange (or any color), and the RHS (i.e. to the right of the bottom part of the black dotted curve and to the right of the red solid curve) blue (with some opacity). Is there a way of doing so (without covering the dashed curves)?

1 Answer 1

1

The problem is that when using fillbetween, the paths must be named, but it will not work if these include the decoration style in this case with markings, I do not know why but it does not work, for that I have placed copies without drawing draw=none and style markings, so that with these the filled areas are generated with a certain opacity, fill opacity=0.3, also add some points so that the entire graph is filled (data)--++(15cm,0);.

RESULT: enter image description here

MWE:

\documentclass[12pt]{article}
\usepackage{pgfplots}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows,patterns,backgrounds}
\usepackage{changepage}
\usepackage[margin=1in]{geometry} 
\usepackage{float}
\usepgfplotslibrary{fillbetween}
\usetikzlibrary{decorations.markings}
\tikzset{arrow marks/.style={postaction=decorate,decoration={markings,
            mark=between positions #1 and 1 step #1 with {\arrow{>}}}},
    arrow marks/.default=10pt}
\begin{document}
    \begin{figure}[H]
        \begin{adjustwidth}{-0.7in}{-0.7in}
            \centering
            \begin{tikzpicture}
            \def\a{0.5}
            \def\lambda{5}
            \def\xTwoInitPosToZeroOne{1.5}
            \def\xOneInitPosToZeroOne{ln(1 +(\lambda*\a* \xTwoInitPosToZeroOne)/(\lambda + 2*\a*\xTwoInitPosToZeroOne))/(\a^2) - \xTwoInitPosToZeroOne/\a}
            \def\zeroControlPosToNegOne{ln((2*\a* \xTwoInitPosToZeroOne + \lambda)/\lambda)/\a}
            \def\xTwoInitPosToZeroTwo{2}
            \def\xOneInitPosToZeroTwo{ln(1 +(\lambda*\a* \xTwoInitPosToZeroTwo)/(\lambda + 2*\a*\xTwoInitPosToZeroTwo))/(\a^2) - \xTwoInitPosToZeroTwo/\a}
            \def\zeroControlPosToNegTwo{ln((2*\a* \xTwoInitPosToZeroTwo + \lambda)/\lambda)/\a}
            \def\xTwoInitPosToZeroThree{3}
            \def\xOneInitPosToZeroThree{ln(1 +(\lambda*\a* \xTwoInitPosToZeroThree)/(\lambda + 2*\a*\xTwoInitPosToZeroThree))/(\a^2) - \xTwoInitPosToZeroThree/\a}
            \def\zeroControlPosToNegThree{ln((2*\a* \xTwoInitPosToZeroThree + \lambda)/\lambda)/\a}

            \def\xTwoInitNegToZeroOne{-1.5}
            \def\xOneInitNegToZeroOne{-ln(1 -(\lambda*\a* \xTwoInitNegToZeroOne)/(\lambda - 2*\a*\xTwoInitNegToZeroOne))/(\a^2) - \xTwoInitNegToZeroOne/\a}
            \def\zeroControlNegToPosOne{ln((-2*\a* \xTwoInitNegToZeroOne + \lambda)/\lambda)/\a}

            \def\xTwoInitNegToZeroTwo{-2}
            \def\xOneInitNegToZeroTwo{-ln(1 -(\lambda*\a* \xTwoInitNegToZeroTwo)/(\lambda - 2*\a*\xTwoInitNegToZeroTwo))/(\a^2) - \xTwoInitNegToZeroTwo/\a}
            \def\zeroControlNegToPosTwo{ln((-2*\a* \xTwoInitNegToZeroTwo + \lambda)/\lambda)/\a}

            \def\xTwoInitNegToZeroThree{-3}
            \def\xOneInitNegToZeroThree{-ln(1 -(\lambda*\a* \xTwoInitNegToZeroThree)/(\lambda - 2*\a*\xTwoInitNegToZeroThree))/(\a^2) - \xTwoInitNegToZeroThree/\a}
            \def\zeroControlNegToPosThree{ln((-2*\a* \xTwoInitNegToZeroThree + \lambda)/\lambda)/\a}
            \begin{axis}[
            %xtick distance = {1},
            %ytick distance = {1},
            xmin=-12,xmax=12,
            ymin=-8,ymax=8,
            height = 7in,width=1.2\textwidth,
            axis lines=center,
            axis line style=->, xlabel = {$x_1$}, ylabel={$x_2$},
            %axis equal,
            legend cell align = {left},
            every axis x label/.style={at={(ticklabel* cs:1.05)}, anchor=west,},
            every axis y label/.style={at={(ticklabel* cs:1.05)}, anchor=south,}, 
            title= {Bang-off-bang Control Trajectories},         title style={xshift=0, yshift=2em},
            domain=-15:15,samples=300,legend pos=outer north east
            ]

            %IV Cuadrant blue plot as path A.
            \addplot[name path=A,->,draw=none,domain = -8:0]({-ln(1-\a*x)/\a^2 - x/\a}, {x});
            \addplot[->,>=latex,arrow marks=1cm,color = blue, thick, domain = -8:0,tips=proper]({-ln(1-\a*x)/\a^2 - x/\a}, {x}) node[below left, pos = 0.3, font = \small] {\(u^* = 1\)};
            %IV Cuadrant dashed black plot as path B.
            \addplot[name path=B,dotted, color = black, thick, domain = -8:0,tips=proper]({-ln(1-(\lambda*\a*x)/(\lambda - 2*\a*x))/\a^2 - x/\a}, {x}) node[above right, pos = 0.3, font = \small] {\(u^* = 0\)};
            %Fill  between A and B
            \addplot[orange,fill opacity=0.2]fill between[of=A and B];

            %II Cuadrant red plot as path C.
            \addplot[name path=C,draw=none, domain = 8:0]({ln(1+\a*x)/\a^2 - x/\a}, {x});
            \addplot[->,>=latex,arrow marks=1cm,color = red, thick, domain = 8:0,tips=proper]({ln(1+\a*x)/\a^2 - x/\a}, {x}) node[above right, pos = 0.3, font = \small] {\(u^* = -1\)};
            %II Cuadrant dashed black plot as path D.
            \addplot[name path=D,dotted, color = black, thick, domain = 8:0,tips=proper]({ln(1+(\lambda*\a*x)/(\lambda + 2*\a*x))/\a^2 - x/\a}, {x});
            %Fill between path C and D
            \addplot[orange,fill opacity=0.2]fill between[of=C and D];


            %%Starting from here, I am not sure if this is necessary or not
            %1st Red arrow marks dashed path E
            \addplot[name path=E,draw=none,domain=0:-6] 
            ({x/\a + (\xTwoInitPosToZeroOne/\a - 1/(\a^2))*(1 - exp(-\a*x)) + \xOneInitPosToZeroOne}, {1/\a + (\xTwoInitPosToZeroOne - 1/\a)*exp(-\a*x)})-- ++(-15cm,0);
            \addplot[->,>=latex,arrow marks=1cm, tips = proper,
            color=red, dashed,thick,domain=-6:0] 
            ({x/\a + (\xTwoInitPosToZeroOne/\a - 1/(\a^2))*(1 - exp(-\a*x)) + \xOneInitPosToZeroOne}, {1/\a + (\xTwoInitPosToZeroOne - 1/\a)*exp(-\a*x)});
            %complement
            \addplot[name path=E2,draw=none,domain=0:\zeroControlPosToNegOne] ({(\xTwoInitPosToZeroOne/\a)*(1 - exp(-\a*x)) + \xOneInitPosToZeroOne}, {\xTwoInitPosToZeroOne*exp(-\a*x)});%1 Pos
            \addplot[->,>=latex, color=red, tips = proper, dashed,thick,domain=0:\zeroControlPosToNegOne] ({(\xTwoInitPosToZeroOne/\a)*(1 - exp(-\a*x)) + \xOneInitPosToZeroOne}, {\xTwoInitPosToZeroOne*exp(-\a*x)});%1 Pos

            %2nd Red arrow marks dashed path F
            \addplot[name path=F,draw=none,domain=-6:0] 
            ({x/\a + (\xTwoInitPosToZeroTwo/\a - 1/(\a^2))*(1 - exp(-\a*x)) + \xOneInitPosToZeroTwo}, {1/\a + (\xTwoInitPosToZeroTwo - 1/\a)*exp(-\a*x)});
            \addplot[->,>=latex,arrow marks=1cm, tips = proper,
            color=red, dashed,thick,domain=-6:0] 
            ({x/\a + (\xTwoInitPosToZeroTwo/\a - 1/(\a^2))*(1 - exp(-\a*x)) + \xOneInitPosToZeroTwo}, {1/\a + (\xTwoInitPosToZeroTwo - 1/\a)*exp(-\a*x)});
            %Complement
            \addplot[name path=F2,draw=none,domain=0:\zeroControlPosToNegTwo] ({(\xTwoInitPosToZeroTwo/\a)*(1 - exp(-\a*x)) + \xOneInitPosToZeroTwo}, {\xTwoInitPosToZeroTwo*exp(-\a*x)});%2 Pos
            \addplot[->,>=latex, color=red, tips = proper, dashed,thick,domain=0:\zeroControlPosToNegTwo] ({(\xTwoInitPosToZeroTwo/\a)*(1 - exp(-\a*x)) + \xOneInitPosToZeroTwo}, {\xTwoInitPosToZeroTwo*exp(-\a*x)});%2 Pos
            %Fill between path E and F 
            \addplot[red,fill opacity=0.2]fill between[of=F and E];
            \addplot[red,fill opacity=0.2]fill between[of=F2 and E2];

            \addplot[->,>=latex,arrow marks=1cm, tips = proper,
            color=red, dashed,thick,domain=-6:0] 
            ({x/\a + (\xTwoInitPosToZeroThree/\a - 1/(\a^2))*(1 - exp(-\a*x)) + \xOneInitPosToZeroThree}, {1/\a + (\xTwoInitPosToZeroThree - 1/\a)*exp(-\a*x)});
            \addplot[->,>=latex, color=red, arrow marks=1cm, tips = proper, dashed,thick,domain=0:\zeroControlPosToNegThree] ({(\xTwoInitPosToZeroThree/\a)*(1 - exp(-\a*x)) + \xOneInitPosToZeroThree}, {\xTwoInitPosToZeroThree*exp(-\a*x)});%3 Pos

            %Blue path G
            \addplot[name path=G,draw=none,domain=0:-6] 
            ({-x/\a + (\xTwoInitNegToZeroOne/\a + 1/(\a^2))*(1 - exp(-\a*x)) + \xOneInitNegToZeroOne}, {-1/\a + (\xTwoInitNegToZeroOne + 1/\a)*exp(-\a*x)}) -- ++(15cm,0);
            \addplot[->,>=latex,arrow marks=1cm, tips = proper,
            color=blue, dashed,thick,domain=-6:0] 
            ({-x/\a + (\xTwoInitNegToZeroOne/\a + 1/(\a^2))*(1 - exp(-\a*x)) + \xOneInitNegToZeroOne}, {-1/\a + (\xTwoInitNegToZeroOne + 1/\a)*exp(-\a*x)});
            %complement
            \addplot[name path=G2,draw=none,domain=0:\zeroControlNegToPosOne] ({(\xTwoInitNegToZeroOne/\a)*(1 - exp(-\a*x)) + \xOneInitNegToZeroOne}, {\xTwoInitNegToZeroOne*exp(-\a*x)});%1 Neg
            \addplot[->,>=latex, color=blue, tips = proper, dashed,thick,domain=0:\zeroControlNegToPosOne] ({(\xTwoInitNegToZeroOne/\a)*(1 - exp(-\a*x)) + \xOneInitNegToZeroOne}, {\xTwoInitNegToZeroOne*exp(-\a*x)});%1 Neg

            %Blue path H
            \addplot[name path=H,draw=none,domain=-6:0]({-x/\a + (\xTwoInitNegToZeroTwo/\a + 1/(\a^2))*(1 - exp(-\a*x)) + \xOneInitNegToZeroTwo}, {-1/\a + (\xTwoInitNegToZeroTwo + 1/\a)*exp(-\a*x)});
            \addplot[->,>=latex,arrow marks=1cm, tips = proper,
            color=blue, dashed,thick,domain=-6:0] 
            ({-x/\a + (\xTwoInitNegToZeroTwo/\a + 1/(\a^2))*(1 - exp(-\a*x)) + \xOneInitNegToZeroTwo}, {-1/\a + (\xTwoInitNegToZeroTwo + 1/\a)*exp(-\a*x)});
            %complement
            \addplot[name path=H2,draw=none,domain=0:\zeroControlNegToPosTwo] ({(\xTwoInitNegToZeroTwo/\a)*(1 - exp(-\a*x)) + \xOneInitNegToZeroTwo}, {\xTwoInitNegToZeroTwo*exp(-\a*x)});%2 Neg
            \addplot[->,>=latex, color=blue, tips = proper, dashed,thick,domain=0:\zeroControlNegToPosTwo] ({(\xTwoInitNegToZeroTwo/\a)*(1 - exp(-\a*x)) + \xOneInitNegToZeroTwo}, {\xTwoInitNegToZeroTwo*exp(-\a*x)});%2 Neg
            %Fill between path G and H 
            \addplot[blue,fill opacity=0.2]fill between[of=G and H];
            \addplot[blue,fill opacity=0.2]fill between[of=G2 and H2];

            \addplot[->,>=latex,arrow marks=1cm, tips = proper,
            color=blue, dashed,thick,domain=-6:0] 
            ({-x/\a + (\xTwoInitNegToZeroThree/\a + 1/(\a^2))*(1 - exp(-\a*x)) + \xOneInitNegToZeroThree}, {-1/\a + (\xTwoInitNegToZeroThree + 1/\a)*exp(-\a*x)});
            \addplot[->,>=latex, color=blue, arrow marks = 1cm, tips = proper, dashed,thick,domain=0:\zeroControlNegToPosThree] ({(\xTwoInitNegToZeroThree/\a)*(1 - exp(-\a*x)) + \xOneInitNegToZeroThree}, {\xTwoInitNegToZeroThree*exp(-\a*x)});%3 Neg
            \end{axis}
            \end{tikzpicture}
        \end{adjustwidth} 
        \caption{Optimal control trajectories for Problem 4 for $a = 0.5$ and $\lambda = 5$. The solid plot is the final switching curve, the dotted plot is the switching curve to ``off" mode, while the dashed plots are the state trajectories that are not originally on the switching curve.}
    \end{figure}
\end{document}
3
  • Hello, I didn’t need E2 and F2 to be added in there, but it looks like the (partial) result is what I wanted. I will try it out for the rest of the plots to see how it goes. I will accept it for now and let you know if any more problems arise.
    – Superman
    Apr 29, 2020 at 14:52
  • 1
    @Superman I am afraid that this is not the right attitude for this site. You can ask a well-defined question, and at a given point you may receive an answer for that specific question. If the specific question is solved, you can accept the answer. The idea is not that the answer is a hook for further requests. It is nontrivial to ask a well-defined, self-contained question from which and from the answer of which you and other users can learn how to generally solve related problems.
    – user194703
    Apr 29, 2020 at 22:30
  • Sorry, I wasn’t aware of it, I will keep in mind next time...
    – Superman
    Apr 30, 2020 at 15:42

You must log in to answer this question.

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