在较小的域上绘制函数

在较小的域上绘制函数

我正在尝试绘制通量图\Psi(u) = u(1-u)(1-\beta u)\frac{1}{2} < \beta < 1u\in (0,1)

\begin{figure}[H]
    \centering
    \begin{tikzpicture}[xscale=4,yscale=7, domain=0:1]
     \draw[->] (0,0) -- (1,0) node[right] {$u$};
    \draw[->] (0,0) -- (0,0.4) node[above] {$q(u)$};
    \begin{scope};
    \clip (0,0) rectangle (1,1);
    \foreach \b in {0.5,0.7,1}{
        \draw[color=red] plot function{x*(1-x)*(1-\b*x)};
        };
        \end{scope};
\end{tikzpicture}
\end{figure}

我想要的是: 在此处输入图片描述

我拥有的:

https://i.imgur.com/HONRDfL.png

答案1

使用以下方式编译渐近线

size(10cm,7cm,false);
import graph;
real b=.9; // .9 is the nearest number with plot.
real x(real a){return a*(1-a)*(1-b*a); }
path g=graph(x,0,1,400);
draw(g,linewidth(1bp));

draw(Label("$u$",Relative(.98)),(-0.1,0)--(1.2,0),Arrow);
draw(Label("$q$",Relative(.98),LeftSide),(0,-0.02)--(0,.18),Arrow);
label("$0$",(0,0),dir(-135));

pair D=(0.1,x(0.1)),B=(0.3,x(0.3)),F=(0.7,x(0.7)),C=(0.9,x(0.9));
pen linestyle=dashed+gray+0.6bp;
draw((0.1,0)--D--(1,0),linestyle);
draw((0.3,0)--B,linestyle);
draw((0.7,0)--F,linestyle);
draw((0.9,0)--C,linestyle);
draw((0,0)--B--C,linewidth(1bp));

arrow("$q=q(u)$",(0.65,x(0.65)),length=1.5cm,dir(45),dashed);
dot("$D$",D,dir(135));
dot("$B$",B,dir(135));
dot("$F$",F,dir(45));
dot("$C$",C,dir(45));
dot("$E$",(1,0),dir(45));
label("$a$",(D.x,0),dir(-90));
label("$u_0$",(B.x,0),dir(-90));
label("$u_F$",(F.x,0),dir(-90));
label("$u_1$",(C.x,0),dir(-90));
label("$1$",(1,0),dir(-90));

在此处输入图片描述

相关内容