1

I'm transcribing some physics notes and I was unsure how to transcribe this diagram of an Otto Cycle in Tikz. Any assistance would be greatly appreciated.

  • 3
    What have you tried so far? – user156344 May 17 at 9:00
  • 2
    draw axes, determine four points, for connecting line use decorations.markings TikZ library, add labels to points and lines. for start search for siilar images, for example on texample.net – Zarko May 17 at 9:04
5

This is a very quick proposal.

If you add a simple code showing all what you have tried, like in one of your questions, you won't be flooded in downvotes.

\documentclass[tikz]{standalone}
\usetikzlibrary{decorations.markings}
\tikzset{
    mypath/.style={
        postaction=decorate,
        decoration={markings,
                    mark=at position #1 with {\coordinate (x);\arrow{>}}},
        thick},
    >=stealth
}
\begin{document}
\begin{tikzpicture}[scale=1.8]
\draw[<->] (4.5,0) node[below] {$V$} -| (0,3.5) node[left] {$p$};
\path (1,1) coordinate (2) {} (2.5,.8) coordinate (1) {}
      (1,2) coordinate (3) {} (2.5,1.5) coordinate (4) {};
\path[font=\footnotesize] (1) node[below right] {1}
                          (2) node[left] {2}
                          (3) node[above right] {3}
                          (4) node[above right] {4};
\draw[mypath=.4,shorten <=-.15cm] (1) to[bend left=5] (2);
\path (x) node[below] {$\mathrm{d}Q=0$};
\draw[mypath=.4,shorten <=-.2cm,shorten >=-.2cm] (3) to[bend right=15] (4);
\path (x) node[above right] {$\mathrm{d}Q=0$};
\draw[mypath=.5] (2) -- (3);
\draw[->] (x)++(-.5,0) -- + (.3,0) node[midway,above] {$\Delta Q_h$};
\draw[mypath=.5] (4) -- (1);
\draw[<-] (x)++(.5,0) -- + (-.3,0) node[midway,above] {$\Delta Q_c$};
\draw[dashed] (2) -- (1,0) node[below] {$V_2$}
              (1) -- (2.5,0) node[below] {$V_1$};
\foreach \i in {1,...,4} \filldraw[fill=white] (\i) circle (1pt);
\end{tikzpicture}
\end{document}

enter image description here

  • I'm sorry, it completely escaped my mind to attach my code. What would you recommend I use to learn this package? – H98 May 17 at 9:41
  • 1
    @H98 Short answer: The manual (pgfmanual.pdf). Still short answer: Read this question. – user156344 May 17 at 9:43
2

With some physics input.

\documentclass[tikz,border=3.14mm]{standalone}
\usetikzlibrary{decorations.markings}
% from https://tex.stackexchange.com/a/313023/121799
\newcommand{\diff}{\mathop{}\!\mathrm{d}}
% http://tex.stackexchange.com/a/253108/4427
\newcommand{\dbar}{{\mkern2mu\mathchar'26\mkern-11mu \mathrm{d}}}
\newcommand{\idiff}{\mathop{}\!\dbar}
\begin{document}
\begin{tikzpicture}[annotate/.style 2 args={postaction={decorate,decoration={markings,
mark=at position 0 with {\node[circle,inner sep=1.5pt,draw,fill=white,#1]{};},
mark=at position 0.5 with {\arrow[>=stealth,line width=1.5pt]{>};
\node at (0,0.4) {#2};}}}}]
 \draw[stealth-stealth] (0,5) node[below left]{$p$} |- (5,0) node[below left]{$V$};
 \begin{scope}[thick]
  \draw[annotate={label=below right:1,alias=1}{$\dbar Q=0$}] plot[variable=\x,domain=4:1.5] (\x,{5/(\x+3)});
  \draw[annotate={label=below left:2,alias=2}{}] (1.5,5/4.5) -- (1.5,15/4.5);
  \draw[annotate={label=above left:3,alias=3}{$\dbar Q=0$}] plot[variable=\x,domain=1.5:4] (\x,{15/(\x+3)});
  \draw[annotate={label=above right:4,alias=4}{}] (4,15/7) -- (1);  
 \end{scope} 
 \path (2) -- (3) coordinate[pos=0.5] (23) (1) -- (4) coordinate[pos=0.5] (14);
 \draw[stealth-] ([xshift=-2mm]23) -- ++ (-1,0) node[midway,above]{$\Delta Q_h$};
 \draw[-stealth] ([xshift=2mm]14) -- ++ (1,0) node[midway,above]{$\Delta Q_c$};
 \draw[dashed] (1) -- (1|-0,0) node[below] {$V_1$};
 \draw[dashed] (2) -- (2|-0,0) node[below] {$V_2$};
\end{tikzpicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.