Is there a extension of tikz library that allows one to draw thermodynamic cycles easily? For example the picture you see in the link: http://en.wikipedia.org/wiki/Carnot_heat_engine#mediaviewer/File:Carnot_heat_engine_2.svg

If there is no library can someone suggest a easy way to go about this? Maybe provide an example? I have used LaTeX for a little over a year now but am just starting to draw in LaTeX with tikz.

  • 1
    Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – user31729 Sep 10 '14 at 0:45

This is one possibility where pic with 3 arguments, known as nodea, nodeb and nodec are designed here -- #1=color, #2=label and #3=internal node label.

enter image description here


nodea/.style args={#1#2#3}{
  code={\node[minimum height=2cm] (#3) {\color{#1}#2};
       \draw[thick] (#3.south west) -| (#3.north east)--(#3.north west);
nodeb/.style args={#1#2#3}{
  code={\node[minimum height=2cm] (#3) {\color{#1}#2};
       \draw[thick] (#3.south east) -| (#3.north west)--(#3.north east);
nodec/.style args={#1#2#3}{
  code={\node[draw,thick,shape=circle,inner sep=1cm] (#3) {\color{#1}#2};
    \pic at (0,0) {nodea={red}{$T_H$}{L}};
    \pic at (2,0) {nodec={black}{}{C}};
    \pic at (4,0) {nodeb={blue}{$T_C$}{R}};
 \draw[->,>=latex](C)--node[midway,above]{$\mathbf{Q_C}$} (R);
 \draw[->,>=latex](C)--node[midway,left]{$\mathbf{W}$} ++(0,-2cm);
  • Thank you so much! This is just the kind of example I needed to learn how to do the problem. – o0BlueBeast0o Sep 10 '14 at 2:20
  • 1
    Glad, it is an example you need. Welcome. – Jesse Sep 10 '14 at 2:56
  • +1: It seems you have learned fast the pic operation :) – Claudio Fiandrino Sep 10 '14 at 7:47
  • Yes, I have tried to use pic, following experts advices here – Jesse Sep 10 '14 at 8:27

This is a solution with PSTricks just for fun.


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.