使用 Tikz 或 PStricks 在 Latex 中绘制卡诺和奥托循环图

使用 Tikz 或 PStricks 在 Latex 中绘制卡诺和奥托循环图

如何生成卡诺和奥托循环的 PV 或 TS 图?除了图片中显示的内容外,我还想为从 1 到 4 的步骤添加方向箭头。

在此处输入图片描述

在此处输入图片描述

另外,我尝试投影 y 坐标。但注释 $P_1$ 和 $P_2$ 离轴相当远。

  \documentclass{standalone}
    \usepackage{tikz}
    \usetikzlibrary{arrows,decorations.markings}

    \begin{document}

        \begin{tikzpicture}[
          > = latex,
          dot/.style = {draw,fill,circle,inner sep=1pt},
          arrow inside/.style = {postaction=decorate,decoration={markings,mark=at position .55 with \arrow{>}}}
          ]
          %\draw[<->] (0,6) node[above right] {$P$} |- (6,0) node[right] {$V$};
          %\draw[->] (0,0) node[above] {$P$} %|- (6,0) node[right] {$V$};
          \draw[->] (0,0) -- (6,0) node[right]{$V$};
          \draw[->] (0,0) -- (0,6) node[left]{$P$};
          \node[dot,label={right:$a$}] (@a) at (5,4) {};
          \node[dot,label={left:$b$}] (@b) at (1.5,4.5) {};
          \node[dot,label={below left:$c$}] (@c) at (2,1.5) {};
          \node[dot,label={right:$d$}] (@d) at (5.5,1) {};
          \draw[arrow inside] (@a) to[looseness=.7,bend left=20] (@b);
          \draw[arrow inside] (@b) to[looseness=.7,bend right=20] (@c);
          \draw[arrow inside] (@c) to[looseness=.7,bend right=20] (@d);
          \draw[arrow inside] (@d) to[looseness=.7,bend left=20] (@a);
          \draw[dashed] (@a) to [left] (0,4);
          \draw[dashed] (@c) to [left] (0,1.5);
          \draw (-.98,4.0) node {$P_1$};
          \draw (-.98,1.5) node {$P_2$};
        \end{tikzpicture}


    \end{document}

输出:

在此处输入图片描述

是因为tikzpicture没能领悟负坐标吗?

答案1

开始....Ts 图

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.markings}
\begin{document}
\begin{tikzpicture}[
  > = latex,
  dot/.style = {draw,fill,circle,inner sep=1pt},
  arrow inside/.style = {postaction=decorate,decoration={markings,mark=at position .55 with \arrow{>}}}
  ]
  \draw[<->] (0,4.3) node[above right] {$T$} |- (4.3,0) node[right] {$s$};
  \node[dot,label={left:$1$}] (@1) at (1,3) {};
  \node[dot,label={right:$2$}] (@2) at (4,3) {};
  \node[dot,label={right:$3$}] (@3) at (4,1) {};
  \node[dot,label={left:$4$}] (@4) at (1,1) {};
  \draw[arrow inside] (@1) -- (@2);
  \draw[arrow inside] (@2) -- (@3);
  \draw[arrow inside] (@3) -- (@4);
  \draw[arrow inside] (@4) -- (@1);
\end{tikzpicture}
\end{document}

编辑

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows,decorations.markings}
\begin{document}
\begin{tikzpicture}[
  > = latex,
  dot/.style = {draw,fill,circle,inner sep=1pt},
  arrow inside/.style = {postaction=decorate,decoration={markings,mark=at position .55 with \arrow{>}}}
  ]
  \draw[<->] (0,4.3) node[above right] {$p$} |- (4.3,0) node[right] {$V$};
  \node[dot,label={left:$1$}] (@1) at (0.5,4) {};
  \node[dot,label={right:$2$}] (@2) at (2.5,3) {};
  \node[dot,label={right:$3$}] (@3) at (4,1) {};
  \node[dot,label={below left:$4$}] (@4) at (1.5,2) {};
  \draw[arrow inside] (@1) to[looseness=.7,bend right=20] (@2);
  \draw[arrow inside] (@2) to[looseness=.7,bend right=20] (@3);
  \draw[arrow inside] (@3) to[looseness=.7,bend left=20] (@4);
  \draw[arrow inside] (@4) to[looseness=.7,bend left=20] (@1);
  \draw[dashed,thin] (0,4) node[left] {$p_1$} -- (0.5,4);
  \draw[dashed,thin] (0.5,0) node[below] {$V_1$} -- (0.5,4);
\end{tikzpicture}
\end{document}

答案2

像这样?

截屏

注释代码:

\documentclass[tikz,border=5mm]{standalone}
    %\usepackage{tikz}
    \usetikzlibrary{arrows,decorations.markings}
    \usetikzlibrary{calc}
    \usetikzlibrary{arrows.meta}% <-- new arrow library sinc version 3.0 of TikZ
    \usepackage[sfmath]{kpfonts}% <- use of sans serif kpfont family
    \begin{document}

        \begin{tikzpicture}[
          > = latex,
          directional arrow/.style={-{Stealth[inset=0pt, angle=45:8pt]},line width=2.5pt,red},%<-- new style for red arrows
          dot/.style = {draw,fill,circle,inner sep=1pt},
          arrow inside/.style = {postaction=decorate,decoration={markings,mark=at position .55 with \arrow{>}}}
          ]
          %\draw[<->] (0,6) node[above right] {$P$} |- (6,0) node[right] {$V$};
          %\draw[->] (0,0) node[above] {$P$} %|- (6,0) node[right] {$V$};
          \draw[->] (0,0) -- (6,0) node[right]{$V$};
          \draw[->] (0,0) -- (0,6) node[left]{$P$};
          \node[dot,label={right:$a$}] (@a) at (5,4) {};
          \node[dot,label={left:$b$}] (@b) at (1.5,4.5) {};
          \node[dot,label={below left:$c$}] (@c) at (2,1.5) {};
          \node[dot,label={right:$d$}] (@d) at (5.5,1) {};
          \draw[arrow inside] (@a) to[looseness=.7,bend left=20] (@b);
          \draw[arrow inside] (@b) to[looseness=.7,bend right=20] (@c);
          \draw[arrow inside] (@c) to[looseness=.7,bend right=20] (@d);
          \draw[arrow inside] (@d) to[looseness=.7,bend left=20] (@a);
          \draw[dashed] (@a) to [left] (0,4);
          \draw[dashed] (@c) to [left] (0,1.5);
          \node[left] at (@a -| 0,0)  {$P_1$};% <- use of Coordinate system perpendicular (see page 141 of TikZ 3.1.1 manual
          \node[left] at (@c -| 0,0) {$P_2$};% <- idem
          \draw [directional arrow]($(@a)!.5!(@b)!0mm!-80:(@b)$)node[above,text=black]{$Q_H$}--($(@a)!.5!(@b)!7mm!80:(@b)$);%<- use of calc library
           \draw [directional arrow]($(@d)!.5!(@c)!0mm!-80:(@c)$)--($(@d)!.5!(@c)!7mm!80:(@c)$)node[below,text=black]{$Q_L$};
        \end{tikzpicture}


    \end{document}

相关内容