Exam summary
Exam summary
Purpose
Turns lecture material (slides, notes, worked examples) into a two-page, two-column A4 summary of the exam scope, plus practice and solution pages. The two pages fit one sheet, front and back: a crib sheet if allowed, a review sheet if not. LaTeX sets the pages; `check_answers.py` recomputes every solution number.
It adds no formula or problem type missing from your material and never invents past exam questions.
Input
- Required: lecture material and the exam scope. If missing, ask one thing: "Please send the exam scope and your lecture material."
- Helpful: what is allowed (sheet, sides, handwritten only, calculator), exam date, graded quizzes, property tables.
- Unknown allowance: ask once, then assume "one A4 sheet, both sides, printed" and say so in the header.
- Sign convention: from the material's first first-law equation, with its page. If sources disagree, ask.
- Property values without a source get `[source needed]`; other unknowns `[check needed]`.
- If your school or instructor gave you a template or crib-sheet rules, those come first.
Output
1. `summary.tex`, compiled `summary.pdf` (pages 1–2 summary, 3 problems, 4 solutions), `check_answers.py`.
2. In the chat, only "Points to check", 3–7 lines: assumed allowance, sign convention and page, what was left out, unsourced values, NG count, page count.
3. If nothing can run, give the files and commands, claim no PDF, and mark numbers "not yet checked".
Rules
1. Steps
1) Scope, allowance, and exam time go in two header lines.
2) List formulas, definitions, and example types from the material with sources ("wk 3 slides p. 12"). Nothing off the list goes in.
3) Fix the sign convention in one boxed line.
4) Lay out the summary (sections 2–5), then 6 problems and solutions (6–7).
5) Run `python check_answers.py` until it reports NG 0.
6) Compile twice and look at every page.
2. Page and type
- A4, 10 mm margins, two columns, 5 mm gap with a rule. One gray only.
- Body 11–12 pt, nothing below 8 pt. Spare room: larger type. Overflow: less content.
- Exactly 2 summary pages; `summary.tex` stops with an error otherwise. Handwritten-only sheets: 1.5 pages.
3. One formula per line
- `\fm{equation}{unit}{condition}`: unit at the right, conditions below, fractions at display size, no derivations.
- Conditions list all that apply: closed/open, process, ideal gas, constant specific heats.
- Before → after
- "W = ∫PdV" → "W_b = ∫P dV [kJ] · quasi-equilibrium only. Rigid tank: 0"
- "η = 1 − T_L/T_H" → "η_C = 1 − T_L/T_H [–] · reversible limit, same two reservoirs. T in K"
- "Q = mcΔT" → "Q = m c_v ΔT (const. v), m c_p ΔT (const. P) [kJ] · closed, ideal gas"
4. Signs, scope, mistakes
- One sign line: "Q into the system +, W by the system + ⇒ ΔU = Q − W". Everything follows it.
- Out-of-scope topics stay out, with one line saying so.
- Common mistakes: 6–8 lines, "wrong → right". Graded-quiz mistakes first.
5. Solution steps, definitions
- One line per lecture example: type (source): first equation → next. End with a sanity check (η < η_C < 1).
- Definitions: one line each, in the material's wording.
6. Practice problems
- Six, from the material's example types, weighted by weeks. Tag each "[wk 4 ex 1 type]".
- Change numbers only. An unused value is fine if the solution says "not used".
- Never call one a past exam. A real past question is marked "past exam (year)" and kept word for word.
- 30 mm of space per problem; solutions on their own page.
7. Solutions
- Given → find → assume → equations → work → answer. Unit conversions on their own line. Intermediate values 4–5 digits, answers 3 significant figures, negative answers with a direction.
- "V2 = √(20.0² + 2 × 80.4) = 23.7 m/s" → "80.4 kJ/kg = 80 400 J/kg, V2 = √(20.0² + 2 × 80 400) = 401 m/s"
8. The files
Both were run end to end on a hypothetical case: a thermodynamics midterm, weeks 1–6. For another course, change the text of `summary.tex` and the values in `check_answers.py`.
- `summary.tex`: `pdflatex summary.tex` twice; Overleaf's default compiler works. US Letter: `letterpaper`.
- `check_answers.py` recomputes each solution number and checks the .tex shows the same digits. This run: NG 0, 4 pages.
9. Final check
- 2 summary pages, nothing below 8 pt? Every formula with unit and conditions?
- Nothing outside the material, every problem tagged, no invented past exam?
- NG 0? No errors or Overfull boxes? Said whether you compiled or only wrote files?
Attachment 1 · summary.tex (LaTeX)
```latex
% summary.tex: p.1-2 summary (one A4 sheet, both sides), p.3 problems, p.4 solutions
% Compile: pdflatex summary.tex, twice (Overleaf default). Then: python check_answers.py
\documentclass[12pt,a4paper]{extarticle}
\usepackage[margin=10mm,bottom=14mm,footskip=7mm]{geometry}
\usepackage[T1]{fontenc}\usepackage{lmodern}
\usepackage{amsmath,multicol,xcolor,array,enumitem,tikz}
\definecolor{g}{gray}{0.35}
\setlength{\columnsep}{5mm}\setlength{\columnseprule}{0.3pt}\setlength{\parindent}{0pt}\setlength{\emergencystretch}{2em}
\setlist{leftmargin=1em,itemsep=1pt plus 1pt,topsep=2pt,parsep=0pt}
% Body 12pt, smallest 10pt. Overflow: cut content, not size.
\newcommand{\hd}[2]{\par\vspace{6pt plus 4pt}{\sffamily\bfseries #1}\hfill{\small\color{g}#2}\par\vspace{-2pt}\rule{\linewidth}{0.5pt}\par\vspace{1pt}}
% \fm{equation}{unit}{when it applies}
\newcommand{\fm}[3]{\par\vspace{1pt}\parbox{\linewidth}{\raggedright$\displaystyle #1$\hfill{\small[#2]}\par\hspace*{1em}{\small\color{g}#3}}\par\vspace{3pt plus 1pt}}
\newcommand{\src}[1]{\unskip\nobreak\hfil\penalty50\hskip1em\hbox{}\nobreak\hfill{\small\color{g}[#1]}{\parfillskip=0pt\par}}
\newcommand{\sol}[7]{\par\vspace{7pt}\begin{minipage}{\linewidth}{\sffamily\bfseries Problem #1}\par\vspace{1pt}%
\begin{tabular}{@{}>{\leavevmode\footnotesize\color{g}}p{18mm}@{}>{\raggedright\arraybackslash}p{\dimexpr\linewidth-18mm}@{}}%
Given\\ Find\\ Assume\\ Equations\\ Work\\ Answer&\textbf{\boldmath #7}\end{tabular}\end{minipage}\par}
\begin{document}
{\sffamily\bfseries\Large Thermodynamics Midterm Summary}\hfill Name\,\underline{\hspace{25mm}}\quad ID\,\underline{\hspace{20mm}}\par
{\small Scope: weeks 1--6 (first law, ideal-gas processes, cycles)\hfill Exam: Wed 21 Oct, 10:30, 75~min\\ Allowed: one A4 sheet, both sides, printed; scientific calculator}\par\vspace{3pt}
\fbox{Sign: $Q$ into the system $+$, $W$ by the system $+$ \enspace$\Rightarrow$\enspace $\Delta U = Q - W$ \quad{\small\color{g}(wk 1 slides p.\,8)}}
\begin{multicols}{2}\raggedcolumns\raggedright
\hd{1. First law, closed system}{wk 1}
\fm{Q - W = \Delta U + \Delta KE + \Delta PE}{kJ}{Fixed mass. At rest: $\Delta KE=\Delta PE=0$}
\fm{q - w = \Delta u}{kJ/kg}{Per unit mass, at rest}
\fm{W_b = \int_1^2 P\,dV}{kJ}{Quasi-equilibrium only. 1~kPa$\cdot$m³ = 1~kJ. Rigid tank: $W_b = 0$}
\fm{h = u + Pv}{kJ/kg}{Enthalpy, for open systems}
\fm{Q_\text{net} = W_\text{net}}{kJ}{Full cycle: $\Delta U = 0$}
\hd{2. First law, steady flow}{wk 2}
\fm{\dot Q - \dot W = \dot m\Bigl[h_2 - h_1 + \frac{V_2^2 - V_1^2}{2} + g(z_2 - z_1)\Bigr]}{kW}{One inlet, one outlet. $V^2/2$ is J/kg: divide by 1000}
\fm{\dot m = \rho V\!A = \frac{V\!A}{v}}{kg/s}{Mass balance: $\dot m_1 = \dot m_2$}
{\footnotesize\setlength{\tabcolsep}{3pt}\begin{tabular}{@{}ll@{}}
Device (set to 0) & What is left\\\hline
Nozzle/diffuser ($\dot Q,\dot W,\Delta PE$) & $h_1{+}\tfrac12V_1^2 = h_2{+}\tfrac12V_2^2$\\
Turbine/compressor ($\dot Q,\Delta KE,\Delta PE$) & $\dot W = \dot m(h_1 - h_2)$\\
Throttle ($\dot Q,\dot W,\Delta KE$) & $h_1 = h_2$\\
Heat exchanger ($\dot W$, outer $\dot Q$) & $\dot m_a\Delta h_a = -\dot m_b\Delta h_b$
\end{tabular}}\par
{\small Compressor, pump: $\dot W < 0$ (work in).}
\hd{3. Ideal gas}{wk 3}
\fm{Pv = RT,\quad PV = mRT}{kPa, m³/kg, K}{Absolute $P$, $T$ in K. $R = R_u/M$}
\fm{\Delta u = c_v\Delta T,\quad \Delta h = c_p\Delta T}{kJ/kg}{Constant $c_p$, $c_v$. Any process}
\fm{c_p - c_v = R,\quad k = \frac{c_p}{c_v}}{kJ/(kg$\cdot$K)}{Ideal gas}
Air, 300~K (wk 3 table): $R = 0.287$, $c_p = 1.005$, $c_v = 0.718$ \mbox{kJ/(kg$\cdot$K)}, $k = 1.4$
\hd{4. Ideal-gas processes, closed}{wk 4}
{\footnotesize\setlength{\tabcolsep}{3pt}\begin{tabular}{@{}lll@{}}
Process (constant) & $W_b$ [kJ] & $Q$ [kJ]\\\hline
Isochoric ($v$) & $0$ & $mc_v\Delta T$\\
Isobaric ($P$) & $P(V_2-V_1)=mR\Delta T$ & $mc_p\Delta T$\\
Isothermal ($T$) & $mRT\ln(V_2/V_1)$ & $= W_b$\\
Isentropic ($PV^k$) & $(P_2V_2-P_1V_1)/(1-k)$ & $0$\\
Polytropic ($PV^n$) & $(P_2V_2-P_1V_1)/(1-n)$ & $W_b+mc_v\Delta T$
\end{tabular}}\par
{\small All quasi-equilibrium. Isothermal: $V_2/V_1 = P_1/P_2$. Polytropic: $n \ne 1$. $PV = mRT$.}
\fm{\frac{T_2}{T_1} = \Bigl(\frac{P_2}{P_1}\Bigr)^{\frac{k-1}{k}} = \Bigl(\frac{V_1}{V_2}\Bigr)^{k-1}}{--}{Isentropic: adiabatic and reversible only. Polytropic: $n$ for $k$}
\hd{5. Engines, refrigerators}{wk 5}
\fm{\eta = \frac{W_\text{net}}{Q_H} = 1 - \frac{Q_L}{Q_H}}{--}{$Q_H$, $Q_L$ as positive magnitudes}
\fm{\eta_\text{C} = 1 - \frac{T_L}{T_H}}{--}{Reversible, same two reservoirs: upper limit. $T$ in K}
\fm{\text{COP}_R = \frac{Q_L}{W},\quad \text{COP}_{HP} = \frac{Q_H}{W} = \text{COP}_R + 1}{--}{Can be above 1}
\fm{\text{COP}_{R,\text{C}} = \frac{T_L}{T_H - T_L},\quad \text{COP}_{HP,\text{C}} = \frac{T_H}{T_H - T_L}}{--}{Reversible limits. $T$ in K}
Actual $<$ Carnot: possible (irreversible). $=$: reversible. $>$: impossible.\par\vspace{2pt}
Carnot cycle: isothermal and isentropic expansion, then isothermal and isentropic compression.
\hd{6. Air-standard cycles}{wk 6}
Cold-air standard: ideal-gas air, $c_p$, $c_v$ at 300~K, all reversible.
\fm{\eta_\text{Otto} = 1 - \frac{1}{r^{k-1}},\quad r = \frac{V_\text{max}}{V_\text{min}}}{--}{Heat in and out at const.\ $v$}
\fm{\eta_\text{Brayton} = 1 - \frac{1}{r_p^{(k-1)/k}},\quad r_p = \frac{P_2}{P_1}}{--}{Steady flow. Heat in and out at const.\ $P$}
\fm{T_3 = T_2 + \frac{q_\text{in}}{c_v}\ \text{(Otto)},\quad T_3 = T_2 + \frac{q_\text{in}}{c_p}\ \text{(Brayton)}}{K}{$q_\text{in}$ in kJ/kg}
\fm{\eta = 1 - \frac{q_\text{out}}{q_\text{in}} = 1 - \frac{T_4 - T_1}{T_3 - T_2}}{--}{Both cycles}
\fm{\frac{T_2}{T_1} = \frac{T_3}{T_4} = r^{k-1}\ \text{(Otto)},\quad r_p^{(k-1)/k}\ \text{(Brayton)}}{--}{1$\to$2 and 3$\to$4 both isentropic}
\begin{center}\begin{tikzpicture}[x=12mm,y=8mm,font=\small,thick,samples=30]
\foreach\s/\n in{0/Otto,3.3/Brayton}{\draw[thin,->](\s,0)--+(2.7,0)node[below]{$v$};\draw[thin,->](\s,0)--+(0,3.8)node[left]{$P$};\node[anchor=north east]at(\s+2.7,4){\n};}
\draw[domain=.84:2.1]plot(\x,{.6*(2.1/\x)^1.4})(.84,2.16)--(.84,3.7);
\draw[domain=.84:2.1]plot(\x,{3.7*(.84/\x)^1.4})(2.1,1.03)--(2.1,.6);
\path(2.1,.6)node[below right]{1}(.84,2.16)node[left]{2}(.84,3.7)node[left]{3}(2.1,1.1)node[right]{4};
\begin{scope}[xshift=39.6mm]
\draw[domain=.48:1.3]plot(\x,{.8*(1.3/\x)^1.4})(.48,3.2)--(.8,3.2);
\draw[domain=.8:2.15]plot(\x,{3.2*(.8/\x)^1.4})(2.15,.8)--(1.3,.8);
\path(1.3,.8)node[below]{1}(.48,3.2)node[left]{2}(.8,3.2)node[above right]{3}(2.15,.8)node[below]{4};
\end{scope}\end{tikzpicture}\end{center}
{\small Heat in 2$\to$3, out 4$\to$1. Diesel (wk 7) is out of scope.}
\hd{7. Steps by problem type}{example $\to$ equations}
\begin{itemize}
\item Rigid tank (wk 1 ex 1): $W_b = 0$ $\to$ $Q = mc_v\Delta T$
\item Piston, const.\ $P$ (wk 1 ex 2, wk 4 ex 1): $W_b = mR\Delta T$ $\to$ $Q = mc_p\Delta T$
\item Nozzle (wk 2 ex 1): $V_2 = \sqrt{V_1^2 + 2000\,c_p(T_1 - T_2)}$; 2000 as $c_p$ is in kJ
\item Turbine (wk 2 ex 2): $\dot W = \dot m c_p(T_1 - T_2)$
\item Isothermal compression (wk 4 ex 2): $W_b = mRT\ln(P_1/P_2)$ $\to$ $Q = W_b$
\item Polytropic expansion (wk 4 ex 3): $T_2 = T_1(P_2/P_1)^{(n-1)/n}$ $\to$ $W_b = mR(T_2 - T_1)/(1-n)$ $\to$ $Q = W_b + mc_v\Delta T$
\item Engine claim (wk 5 ex 1): $\eta$ vs.\ $\eta_\text{C}$
\item Refrigerator (wk 5 ex 2): COP$_R$ vs.\ COP$_{R,\text{C}}$
\item Otto (wk 6 ex 1): $\eta$ $\to$ $T_2 = T_1r^{k-1}$ $\to$ $T_3 = T_2 + q_\text{in}/c_v$ $\to$ $w_\text{net} = \eta\,q_\text{in}$
\item Brayton compressor (wk 6 ex 2): $T_2 = T_1r_p^{(k-1)/k}$ $\to$ $w = c_p(T_1 - T_2)$
\end{itemize}
Check: compression $W < 0$, expansion $W > 0$; adiabatic compression $T_2 > T_1$; $\eta < \eta_\text{C} < 1$; nozzle $V_2 > V_1$
\columnbreak
\hd{8. Common mistakes}{wrong $\to$ right}
\begin{itemize}
\item °C in $T_2/T_1$, $PV = mRT$, Carnot $\to$ use K. Only $\Delta T$ may stay {\small\color{g}(Quiz 1)}
\item Gauge pressure used as is $\to$ absolute = gauge + atmospheric {\small\color{g}(Quiz 1)}
\item $V^2/2$ [m²/s²] added to kJ/kg $\to$ divide by 1000. Problem 3 gives 23.7~m/s, not 401~m/s
\item $\Delta u = c_p\Delta T$ at const.\ $P$ $\to$ always $c_v\Delta T$; $c_p$ is for $\Delta h$
\item Adiabatic means constant $T$ $\to$ adiabatic means $Q = 0$; $T$ changes
\item Isothermal means $Q = 0$ $\to$ ideal gas: $\Delta U = 0$, so $Q = W_b$
\item $PV^k$ const for a real compressor $\to$ only if reversible and adiabatic
\item COP $> 1$ looks wrong $\to$ only $\eta$ must be $< 1$
\end{itemize}
\hd{9. Units, constants}{}
\begin{tabular}{@{}ll@{}}
1~kPa$\cdot$m³ = 1~kJ & 1~kJ/kg = 1000~m²/s²\\
1~kW = 1~kJ/s & 1~bar = 100~kPa\\
1~atm = 101.325~kPa & $g = 9.81$~m/s$^2$\\
$T$[K] = $T$[°C] + 273.15 & $\Delta T$[K] = $\Delta T$[°C]\\
$R_u = 8.314$~kJ/(kmol$\cdot$K) &
\end{tabular}\par
$k = 1.4$: $k-1 = 0.4$, $(k-1)/k = 0.2857$, $k/(k-1) = 3.5$. Isothermal work uses ln, not log.
\hd{10. Definitions}{wk 1, wk 5}
\begin{itemize}
\item Closed system: no mass crosses the boundary. Open (control volume): mass does.
\item Quasi-equilibrium: near equilibrium at every instant.
\item Properties ($P$, $T$, $v$, $u$, $h$) depend on the state; $Q$, $W$ on the path.
\item Kelvin--Planck: no cycle turns all the heat from one reservoir into work ($\eta < 1$).
\item Clausius: no device moves heat from cold to hot without work input.
\item Reversible: system and surroundings can both be restored. Irreversibilities: friction, finite-$\Delta T$ heat transfer, free expansion, mixing.
\end{itemize}
\end{multicols}
\clearpage
\ifnum\value{page}=3 \else\errmessage{The summary is not 2 pages. Cut content, not font size}\fi
{\sffamily\bfseries\Large Practice problems}\hfill{\small Solutions on the next page. Air values: section 3.}\par\vspace{4pt}
\begin{enumerate}[leftmargin=1.5em,itemsep=30mm]
\item 0.600~kg of air in a piston--cylinder at 200~kPa, 27~°C is heated at constant pressure to 227~°C. Find the boundary work and the heat transfer.\src{wk 4 ex 1 type}
\item 1.20~kg of air is compressed slowly at 300~K from 100~kPa to 600~kPa. Find the boundary work and the heat transfer, with signs.\src{wk 4 ex 2 type}
\item Air enters an adiabatic nozzle at 400~K, 20.0~m/s and leaves at 320~K. Find the exit velocity.\src{wk 2 ex 1 type}
\item Air at 100~kPa, 300~K is compressed reversibly and adiabatically with a pressure ratio of 8. Find the exit temperature and the work per unit mass.\src{wk 6 ex 2 type}
\item A refrigerator holds 4~°C in a 25~°C kitchen, removing 0.300~kW with 0.100~kW of power. Find its COP and the reversible COP. Is it possible?\src{wk 5 ex 2 type}
\item A cold-air-standard Otto cycle has $r = 9$. Compression starts at 95~kPa, 27~°C, and 750~kJ/kg of heat is added. Find $\eta$, $T$ at the end of compression, the maximum $T$, and the net work per kg.\src{wk 6 ex 1 type}
\end{enumerate}
\vfill{\small\color{g}Lecture example types with new numbers. None is a past exam question.}
\clearpage
{\sffamily\bfseries\Large Solutions}\hfill{\small Air values: section 3. Answers: 3 s.f., unit, direction}\par\vspace{2pt}
\begin{multicols}{2}\small
\sol{1}{$m = 0.600$~kg, $P = 200$~kPa const., $T_1 = 27$~°C, $T_2 = 227$~°C}{$W_b$, $Q$}
{Closed, quasi-equilibrium, ideal gas, constant $c_v$, at rest}
{$W_b = mR(T_2 - T_1)$, $\Delta U = mc_v(T_2 - T_1)$, $Q = \Delta U + W_b$}
{$\Delta T = 200$~K\newline $W_b = 0.600\times0.287\times200 = 34.44$~kJ\newline $\Delta U = 0.600\times0.718\times200 = 86.16$~kJ\newline $Q = 86.16 + 34.44 = 120.6$~kJ}
{$W_b = 34.4$~kJ, $Q = 121$~kJ (both $+$: work out, heat in)}
\sol{2}{$m = 1.20$~kg, $T = 300$~K const., $P_1 = 100$~kPa, $P_2 = 600$~kPa}{$W_b$, $Q$}
{Closed, quasi-equilibrium, ideal gas $\to$ $\Delta U = 0$}
{$W_b = mRT\ln(P_1/P_2)$, $Q = \Delta U + W_b = W_b$}
{$mRT = 1.20\times0.287\times300 = 103.32$~kJ\newline $\ln(100/600) = -1.7918$\newline $W_b = 103.32\times(-1.7918) = -185.1$~kJ}
{$W_b = -185$~kJ (work in), $Q = -185$~kJ (heat out)}
\sol{3}{$T_1 = 400$~K, $V_1 = 20.0$~m/s, $T_2 = 320$~K, adiabatic}{$V_2$}
{Steady, $\dot Q = \dot W = \Delta PE = 0$, constant $c_p$}
{$h_1 + V_1^2/2 = h_2 + V_2^2/2$ \ $\to$ \ $V_2 = \sqrt{V_1^2 + 2c_p(T_1 - T_2)}$}
{$c_p(T_1 - T_2) = 1.005\times80 = 80.4$~kJ/kg $= 80\,400$~J/kg\newline $V_2 = \sqrt{20.0^2 + 2\times80\,400} = \sqrt{161\,200} = 401.5$~m/s}
{$V_2 = 401$~m/s \ {\normalfont(without the 1000: 23.7~m/s)}}
\sol{4}{$P_1 = 100$~kPa, $T_1 = 300$~K, $P_2/P_1 = 8$, reversible adiabatic}{$T_2$, $w$}
{Steady, isentropic, $\Delta KE = \Delta PE = 0$, constant $c_p$}
{$T_2 = T_1(P_2/P_1)^{(k-1)/k}$, $w = h_1 - h_2 = c_p(T_1 - T_2)$}
{$8^{0.4/1.4} = 8^{0.2857} = 1.8114$\newline $T_2 = 300\times1.8114 = 543.4$~K\newline $w = 1.005\times(300 - 543.4) = -244.7$~kJ/kg}
{$T_2 = 543$~K, $w = -245$~kJ/kg (245~kJ/kg into the compressor)}
\sol{5}{$T_L = 4$~°C, $T_H = 25$~°C, $\dot Q_L = 0.300$~kW, $\dot W = 0.100$~kW}{COP$_R$, COP$_{R,\text{C}}$, possible?}
{Steady, fixed reservoir temperatures}
{$\text{COP}_R = \dot Q_L/\dot W$, $\text{COP}_{R,\text{C}} = T_L/(T_H - T_L)$, $T$~in~K}
{$\text{COP}_R = 0.300/0.100 = 3.00$\newline $T_L = 277.15$~K, $T_H = 298.15$~K, $T_H - T_L = 21.00$~K\newline $\text{COP}_{R,\text{C}} = 277.15/21.00 = 13.20$}
{$\text{COP}_R = 3.00$, $\text{COP}_{R,\text{C}} = 13.2$; $3.00 < 13.2$, so possible (irreversible)}
\sol{6}{$r = 9$, $T_1 = 27$~°C, $q_\text{in} = 750$~kJ/kg, $P_1 = 95$~kPa (not used here)}{$\eta$, $T_2$, $T_3$, $w_\text{net}$}
{Cold-air standard}
{$\eta = 1 - 1/r^{k-1}$, $T_2 = T_1 r^{k-1}$, $T_3 = T_2 + q_\text{in}/c_v$, $w_\text{net} = \eta\,q_\text{in}$}
{$9^{0.4} = 2.4082$, $\eta = 1 - 1/2.4082 = 0.5848$\newline $T_1 = 300.15$~K, $T_2 = 300.15\times2.4082 = 722.8$~K\newline $T_3 = 722.8 + 750/0.718 = 722.8 + 1044.6 = 1767.4$~K\newline $w_\text{net} = 0.5848\times750 = 438.6$~kJ/kg}
{$\eta = 58.5$~\%, $T_2 = 723$~K, $T_3 = 1.77\times10^3$~K, $w_\text{net} = 439$~kJ/kg}
\end{multicols}
\end{document}
```
Attachment 2 · check_answers.py (Python)
```python
check_answers.py: recomputes the solution numbers and checks that summary.tex shows the same digits.
Run: python check_answers.py (exit code 1 on any NG: fix the solution, run again)
import math
import sys
TEX = open("summary.tex", encoding="utf-8").read()
R, cp, cv, k = 0.287, 1.005, 0.718, 1.4 # air, as in section 3
W2 = 1.20 * R * 300 * math.log(100 / 600) # problem 2, isothermal
V2 = math.sqrt(20.0**2 + 2 * cp * 80 * 1000) # problem 3, nozzle: kJ/kg -> J/kg is x1000
T4 = 300 * 8 ** ((k - 1) / k) # problem 4, isentropic
eta = 1 - 1 / 9 ** (k - 1) # problem 6, Otto
T6 = 300.15 * 9 ** (k - 1)
CHECKS = [ # (label, value, decimals as written in the solution)
("1 W_b", 0.600 * R * 200, 2), ("1 dU", 0.600 * cv * 200, 2), ("1 answer Q", 0.600 * cp * 200, 0),
("2 W_b", W2, 1), ("3 V2", V2, 1), ("3 no x1000", math.sqrt(20.0**2 + 2 * cp * 80), 1),
("4 T2", T4, 1), ("4 w", cp * (300 - T4), 1), ("5 COP_R,C", 277.15 / 21.00, 2),
("6 eta", eta, 4), ("6 T2", T6, 1), ("6 T3", T6 + 750 / cv, 1), ("6 w_net", eta * 750, 1),
]
ng = 0
for name, v, nd in CHECKS:
s = f"{v:.{nd}f}"
ng += s not in TEX
print("OK" if s in TEX else "NG", f"{name:<14}", s)
print(f"NG {ng}" + ("" if ng else ": the solutions match the calculation"))
sys.exit(1 if ng else 0)
```
Connect ChatGPT or Claude and use this prompt now · More prompts