-
Notifications
You must be signed in to change notification settings - Fork 0
/
old_snippets.tex
1913 lines (1522 loc) · 113 KB
/
old_snippets.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%
%%%% OLD SNIPPETS
%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\iffalse
\newpage
\nonoaddchap{Introduction}
\label{sec:intro}
% %\setlength{\beforeepigraphskip}{0pt}
% %\setlength{\afterepigraphskip}{0pt}
\epigraph{The loss implied in such an acquisition can be estimated only by those who have been compelled to unlearn a science that they might at length begin to learn it.}{J. C. Maxwell \cites*{maxwell1878}}
Until some decades ago, the 18th-century physical notions typically taught in introductory Bachelor physics courses were enough to prepare an engineer for future specializations and jobs. Students who wanted to venture into modern theories, such as Relativity, were required to \textbf{re-learn} some of the most important physical notions -- \emph{Energy}, mass, time, entropy above all -- which in these theories are quite different from the 18th-century ones. But at that time the modern theories still mostly had only theoretical, not practical, importance. So the re-learning efforts of the curious students could perhaps be justified.
%% \mynotew{add about re-learning necessary for continuum mechanics}
\smallskip
% \marginpar{\footnotesize%
% {\color{mpcolor}\enquote{\emph{The achieved performances of atomic clocks and time
% transfer techniques imply that the definition of time scales
% and the clock comparison procedures must be considered
% within the framework of General Relativity}}\sourceatright{\cites{petitetal2005}}}
% }
\marginpar{%
\color{mpcolor}\footnotesize%
\enquote{\emph{Numerous relativistic issues and effects play roles in the global positioning system, on which millions of drivers, hikers, sailors, and pilots depend to find out where they are. The GPS system is, in effect, a realization of Einstein's view of space and time. Indeed, the system cannot function properly without taking account of fundamental relativistic principles.}}\sourceatright{\cites{ashby2002}}
}
%
That situation has changed today. Modern theories and modern physical notions are an essential part of many everyday technologies, like nuclear reactors and the \furl{https://www.gps.gov}{Global Positioning System} (see the entertaining discussion in \cites[Project~A]{tayloretal2000}, and also \cites{petitetal2005,fliegeletal1996,ashby2002,muelleretal2008}). Modern theories and modern physical notions are required for the development of new technological possibilities, from \furl{https://www.ibm.com/topics/quantum-computing}{quantum computers} to solar sails, such as NASA's \furl{https://www.nasa.gov/mission/acs3/}{Advanced Composite Solar Sail System}. An engineering student (including communication, computer, and data engineering) may likely end up in a job that requires an understanding of modern physical notions. The diffusion of \furl{https://www.ibm.com/topics/large-language-models}{large language models} will moreover lead to a future demand for engineers who actually \textbf{understand} those physical notions, not little monkeys who have been trained to mechanically manipulate some equations while throwing some technobabble around. Automated large language models are faster, cheaper, and more precise in doing this kind of monkey activities. So why should one hire a human to do the same?
While moving from the older to the newer notions often requires re-learning efforts and conceptual re-orientations, the move in the opposite direction is less demanding. The modern physical notions are more encompassing than their 18th-century parents. Their understanding leads to an understanding of their older counterparts as approximate and special cases. Students, moreover, have often been hearing quite early about the new notions from mass media; for instance about the equivalence of mass and energy, or about the discrepancy in time reckoning by different observers. Owing to this early exposure, students sometimes ask very intelligent and deep questions -- for instance \enquote{\emph{should the mass of the body be included in its internal energy?}} -- when exposed to the old notions.
\medskip
It is therefore high time that introductory Bachelor physics courses be based on modern physical notions. Students should not be required to waste time and mental effort to learn something that they must unlearn and re-learn, only because of the inertia of academia and teachers.
Some teachers say \enquote{it would be too difficult for students to understand modern ideas, because they are too familiar with the old ones. This is why we need to teach the old and slightly incorrect ideas first, and correct them later}. I think that this kind of reasoning is scientifically unacceptable and leads to a vicious circle. Students are unfamiliar with new notions only because they were raised by a generation who was taught old ones. New notions become familiar only after a couple of generations learn them at an early stage. This is obvious if you consider that notions like \enquote{energy}, \enquote{electromagnetic field}, \enquote{vector} are very familiar today, but were absolutely \emph{un}familiar a century or so ago. If we had always taught what's familiar, then we would still be teaching about the \emph{air, earth, water, fire} elements, and that the Sun revolves around the Earth. Arguments in favour of teaching old notions are for the most part just pretexts for laziness.
\medskip
The present lecture notes are an experiment and attempt to introduce classical mechanics and thermodynamics from modern physical notions and viewpoints. The core equations remain the same, but the students should have a broader conception of their meaning and of the symbols that appear in them.
\iffalse % replies from NASA/JPL, 2024-04-12
"Yes, NASA/JPL include relativistic effects when we plan or calculate trajectories for Earth, Moon, and beyond. The same PPN (parameterized post-Newtonian) metric is used to calculate and plan spacecraft dynamics. For example, if we don’t include the relativistic effect, GPS orbits will be not as good as what we have now. 😊" Ryan Park, Group Supervisor of JPL's Solar System Dynamics Group
"Further to what Ryan said, we use the same dynamical models for navigating in cis-lunar or geocentric space as we do for interplanetary missions: the physics doesn’t change between the two regimes, and the same software is use for navigating in both regimes.
It seems the professor has already found the key document by Moyer, which I would have referenced myself. In fact, I used the relativistic expressions in Moyer’s earlier internal JPL document when I coded up the dynamical models used in our Small Body software, back in the early ‘90s, and the same Moyer expressions were used in JPL navigation software for a couple decades before that (back at least to the ‘70s)." Paul Chodas, JPL's director for the Center of Near Earth Object Studies.
\fi
% ** 6
% *** Importance of physics, necessity of maths: numbers (precision) and formulae (compact relations)
% *** Different languages (show examples) and points of view. What's chosen here
% *** Arena for physics (one point of view): space, time, "stuff"
%
\printpagenotes*
\fi
%% old parts of the book
\iffalse
\printpagenotes*
\clearpage
\nonochapter{Conservation of matter}
\label{ncha:cons_matter}
\epigraph{\emph{%
\enquote{What you do in this world is a matter of no consequence,} returned my companion, bitterly. \enquote{The question is, what can you make people believe that you have done?\textellipsis}%
}}{Sherlock Holmes (A. C. Doyle) \cites*{doyle1887}}
\nonosection{Formulation and generalities}
\label{nsec:cons_matter_formulation}
Choose an arbitrary sequence of closed control surfaces between coordinate times $\yti$ and $\ytf$, enclosing a sequence of control volumes. Denote by $\yN(t)$ and $\yJ(t)$ the amount of matter in the control volume and the influx through the control surface at time $t$. Then the law of \textbf{conservation of matter} is expressed by either of the equations
\begin{definition}{Conservation of matter}
\begin{equation}
\label{neq:cons_matter}
\begin{gathered}
\underbracket[0pt]{\yN(\ytf) - \yN(\yti) - \int_{\yti}^{\ytf}\!\!\yJ(t)\,\di t = 0}_{\mathclap{\text{\color{grey}integral form}}}
\qquad%\text{\footnotesize\color{grey}or}
\qquad
\underbracket[0pt]{\frac{\di\yN(t)}{\di t} - \yJ(t) = 0}_{\mathclap{\text{\color{grey}differential form}}}
\end{gathered}
\end{equation}
\end{definition}
Conservation of matter is a law that we intuitively take for granted and use continuously in our life. The very notion of \enquote*{object} -- including living objects -- is possible thanks to this fundamental regularity of nature: we can speak of objects because they exist for some time and we can follow them as they move in space. % This is possible because the integrated flux through a small surface of the \enquote{stuff} that makes the object equals the amount that disappeared in a nearby small region: we can then say that the \enquote{stuff} has moved.
% In fact even the notion of \emph{velocity} of an object is actually built from the notions of flux and of volume content, but it would make little sense if the flux didn't equal the rate of change of the volume content.
% \begin{extra}{Velocity from flux and volume content}\label{nextra:velocity_matter}
% Suppose we have a coordinate system $(t,x,y,z)$. Consider a small spatial region of cuboid shape delimited by two surfaces having $x$ constant, two having $y$ constant, and two having $z$ constant. The instantaneous velocity component $v_{x}$ is defined as the ratio of:
% \begin{enumerate*}[label=(\alph*)]
% \item the flux $\yJ_{x}$ through any of the two $x$-constant surfaces, crossing in the positive-$x$ orientation, divided by surface area $A$, and
% \item the volume content $\yN$ in the cuboid region, divided by the region's volume $V$:
% \end{enumerate*}
% \begin{equation*}
% v_{x} \defd \frac{\yJ_{x}/A}{\yN/V}
% \end{equation*}
% And analogously for the other two velocity components. This relation is valid as a first approximation for enough small velocities and weak gravitational fields (Newtonian approximation).
% \end{extra}
\nonosubsection{Balances of matter}
\label{nsec:matter_balances}
The law of \emph{conservation} of matter holds, as far as we know, for all kinds of matter \emph{considered together}. \marginpar{\vspace{-\baselineskip}\footnotesize\flushleftright\color{mpcolor}%
\emph{\enquote{All these operators conserve $B-L$, so in any superunified theory we expect $B-L$ to be conserved\textellipsis}}}%
\sourceatright{\cites{wilczeketal1979}%
}%
More specifically, it seems to hold in extreme physical conditions if we count baryonic and anti-leptonic matter as \enquote*{positive} and leptonic and anti-baryonic matter as negative.
When we consider different kinds of matter, such as different chemical elements, individual conservation laws still hold and can be applied in many common and important physical situations.
For some kinds of matter, conservation does not hold, however; for example in the previously mentioned {phenomena involving radioactive decay and nuclear energy}. For these kinds of matter we can still apply a \emph{balance} law, with a non-zero supply or sink.
\nonosection{Examples of constitutive relations}
\label{nsec:matter_constitutive}
\nonosubsection{Relation between matter and \masse}
\label{nsec:const_matter_mass}
The most common constitutive relation used together with conservation of matter is the one relating a constant amount of \masse\ $\yM$ to a particular amount of matter $\yN$:
\begin{definition}{Molar mass}
\begin{equation}
\label{neq:molar_mass}
\yM = \yrho\, \yN
\end{equation}
where the proportionality constant $\yrho=\yM/\yN$ is called \textbf{molar-mass constant}, and depends on the kind of matter considered.
\end{definition}
For instance, in many physical phenomena involving water we assume the constitutive relation above, with a
of \furl{https://webbook.nist.gov/cgi/inchi/InChI\%3D1S/H2O/h1H2}{water molar-mass constant} of approximately $\yrho_{\mathrm{H_2O}}=\qty{0.0180}{kg/mol}$. If a volume contains $\yN=\qty{20}{mol}$ of water, we usually attribute to it a \masse\ of
\begin{equation*}
\begin{split}
\yM &= \yrho_{\mathrm{H_2O}}\, \yN
\\
&=\qty{0.0180}{kg/mol} \times \qty{20}{mol}
\\
&= \qty{0.36}{kg}\,.
\end{split}
\end{equation*}
The exact value of the molar-mass constant depends not only on the substance but also on the context and application: the substance may actually consist of a mixture of different kinds of matter. \enquote*{Air} for example is a mixture of different chemical elements, and their proportion in the mixture may depend on physical conditions such as temperature, and on geographical position.
\marginpar{\vspace{0\baselineskip}\centering%
\includegraphics[width=\linewidth]{images/water_isotopes.jpg}%
\\[\jot]\footnotesize\flushleftright\color{mpcolor}%
There are several different isotopes of water, with different masses (image from \furl{https://www.usgs.gov/media/images/water-isotopes-diagram}{U.S. Geological Survey})%
}%
\enquote*{Water} is a mixture of different \furl{https://www.britannica.com/science/isotope}{isotopes} (molecules differing in the number of neutrons), and again the mixture proportions may vary with physical conditions.
The constant relating \masse\ and amount of matter is the same for volume contents and for fluxes. So to a matter flux $\yJ$ we can associate a \masse\ flux $\yrho\yJ$. For instance, if through a surface there's a flux of $\yJ=\qty{30}{mol/s}$ of water, then we associate to it a mass flux of
$$\yrho_{\mathrm{H_2O}}\,\yJ = \qty{0.0180}{kg/mol} \times \qty{30}{mol/s} = \qty{0.54}{kg/s}\,.$$
\smallskip
Using this constitutive relation we can re-express the conservation of matter in terms of mass. Suppose that for a given kind of matter the proportionality constant is $\yrho$; then conservation of matter implies
\begin{equation*}
\begin{gathered}
\yrho\yN(\ytf) - \yrho\yN(\yti) - \int_{\yti}^{\ytf}\!\!\yrho\yJ(t)\,\di t = 0
\qquad%\text{\footnotesize\color{grey}or}
\qquad
\frac{\di\yrho\yN(t)}{\di t} - \yrho\yJ(t) = 0
\end{gathered}
\end{equation*}
This is the \enquote*{law of conservation of mass}. Keep in mind that this is not a universal law: it's only an approximate law, only valid as long as the constitutive relation between matter and \masse\ is acceptable.
Phenomena for which this constitutive equation is no longer valid appear for example in particle physics, nuclear physics, and astrophysics.
\begin{exercise}
At a particular time, a party balloon contains \qty{0.012}{kg} of Helium. A minute later, the same balloon contains \qty{0.010}{kg} of helium. Assume conservation of Helium, as well as a constitutive relation between amount and mass with \furl{https://webbook.nist.gov/cgi/inchi/InChI\%3D1S/He}{Helium molar-mass constant} $\yrho_{\mathrm{He}} = \qty{4e-3}{kg/mol}$.
\begin{enumerate}[exerc]
\item How much is the \emph{integrated efflux} of Helium, \textbf{in moles}, through the balloon's surface during the one-minute lapse of time?
\item Assume that the efflux of Helium was constant in time during the one-minute time lapse. How much was the efflux of Helium, in moles/second?
\end{enumerate}
\end{exercise}
\marginpar{\vspace{-11\baselineskip}\centering%
\includegraphics[height=7em]{images/helium_balloons.jpg}%
}
\nonosubsection{Relation between matter and momentum}
\label{nsec:const_matter_momentum}
Closely related to the previous constitutive relation is the one {relating an amount of matter and an amount of momentum}, briefly discussed before. Let us examine this constitutive relation more thoroughly.
Fix a coordinate system $(t,x,y,z)$. At a given point in space, take a small rectangular control surface of area $A$, with sides parallel to the coordinate axes $y$ and $z$. See side picture below. The surface must \emph{not} be moving in that coordinate system. Through this surface, in the positive-$x$ direction, there's a flux of matter that we denote $J_{x}$.
Construct two more surfaces of area $A$ through the same point in a analogous way: one parallel to the $zx$ axes and one to the $xy$ axes. The matter fluxes through them are $J_{y}$ and $J_{z}$.
Finally take a control volume of cuboid shape that fits the three surfaces. This cuboid has volume $V$, and contains an amount of matter $\yN$ and an amount of momentum $\yP$. Recall the {association between the matter flux} through the first surface and the velocity component $v_{x} \equiv \frac{J_{x}/A}{\yN/V}$, and similarly for the other two surfaces.
% Take a small control volume of cuboid shape, with side surfaces \emph{not moving} in the coordinate system $(t,x,y,z)$, and parallel to the $yz$-, $zx$-, and $xy$-coordinates. The cuboid has volume $V$ and each side surface has area $A$.
%
% The control volume contains an amount of matter $\yN$. The flux across the side parallel to $yz$, in the positive-$x$ direction, is $\yJ_{x}$; and similarly for the other two directions. Remember from \sect\,\ref{nsec:fluxes_velocities} that we can consider the matter in the control volume as moving with velocity
% \begin{equation*}
% \yv = (v_{x}, v_{y}, v_{z}) = \frac{V}{A\,\yN}\, (\yJ_{x}, \yJ_{y}, \yJ_{z})
% \end{equation*}
%
% Then this control volume also contains an amount of momentum
% \marginpar{%
% \footnotesize\flushleftright{\color{mpcolor}%
% This is the famous relation that old textbooks take as the \emph{definition} of momentum.}}%
% \begin{equation*}
% \yP = \yM\yv \equiv \yrho\,\yN\,\yv \equiv \yrho\, \frac{V}{A}\,
% \begin{bmatrix}
% J_{x}\\J_{y}\\J_{z}
% \end{bmatrix}
% \end{equation*}
% The relation \enquote{$\yP=\yM\yv$} is the traditional one; but we see that it is completely equivalent to a relation between momentum and \emph{flux} of matter.
Assume that the constitutive relation between matter and mass, previously discussed, is valid, and associates a \masse\ $\yM=\yrho\yN$ to the amount of matter $\yN$.
\marginpar{\vspace{\baselineskip}\centering%
\includegraphics[width=\linewidth]{images/Px_Jx2.pdf}%
% \\[\jot]\footnotesize\flushleftright{\color{mpcolor}%
% }%
}%
\begin{definition}{Newtonian constitutive relation for momentum}
The \textbf{Newtonian relation for the momentum of matter} is a constitutive relation saying that the flux and velocity of matter and the volume content of momentum are proportional:
\begin{equation}
\label{neq:matter_momentum_Newton}
\yP = \yM\yv = \yrho\, \frac{V}{A}\,
\begin{bmatrix}
J_{x}\\J_{y}\\J_{z}
\end{bmatrix}
% \qquad\text{with}\qquad
% \yM=\yrho\yN
\end{equation}
\end{definition}
This relation is only valid for very small areas and volumes (we should really take a limit), so small that the flux of matter or the volume content of momentum wouldn't change if we choose a surface and a volume in slightly different positions.
\bigskip
An analogous constitutive relation also exists between \emph{flux} of momentum and flux and volume content of matter. Its most general formulation involves many mathematical terms, so let's consider a simplified situation instead.
\begin{definition}{Convective flux of momentum (special case)}
Through the $yz$-surface above there's a flux of momentum
\begin{equation}
\label{neq:matterflux_force_Newton}
\yF_{\text{conv}} = \yrho J_{x}\,\yv \equiv
\yrho\, \frac{V}{A}\,\frac{J_{x}}{\yN}\,
\begin{bmatrix}
J_{x}\\J_{y}\\J_{z}
\end{bmatrix}
% \qquad\text{\color{midgrey}(also equivalent to\enspace$\yF=\yM\yv\,\yJ_{x}/\yN$)}
\end{equation}
called a \textbf{convective flux}. Analogous relations hold for the surfaces parallel to the $zx$ and $xy$ coordinates.
\end{definition}
\begin{warning}
Usually there are additional, non-convective flows of momentum (forces) associated with matter, as we shall see later.
\end{warning}
These constitutive relations are only approximate and become incorrect when the speeds involved are close to the speed of light or the energy concentrations are so high to create strong gravitational fields (high spacetime curvature), or when some kind of electromagnetic phenomena are also involved.
In particular, according to the Newtonian constitutive relation, \emph{momentum and velocity of matter are always parallel}, because they are two vectors that differ by a multiplicative scalar. In general this is not exactly true: momentum can have a different direction from velocity. In General Relativity one must often take this fact into account.
\begin{extra}{More symmetric relation between mass \amp\ momentum and matter}
When we work with \emph{densities}, which express the amounts of a quantity per unit volume or per unit surface, the relation between \masse\ \amp\ momentum on one side, and matter \amp\ its flux on the other, becomes more explicit and symmetric. We have
\begin{equation*}
\ym = \rho\yn \qquad \yp = \rho\yj
\end{equation*}
where $\ym$ and $\yp$ are the mass and momentum densities, and $\yn$ and $\yj$ are the matter and matter-flux densities.
\end{extra}
\smallskip
\begin{exercise}
The side picture illustrates the section of a river. The river has an approximately \emph{steady flow} of water; this means that if we choose a static control volume anywhere in the river, such as the one in the depicted section, the amount of water $\yN$ therein is \emph{constant in time}.
Assume that
\begin{enumerate*}[label=(\alph*)]
\item water satisfies conservation of matter;
\item the amount of water in the illustrated volume is $\yN=\qty{4e5}{mol}$;
\item water only flows across the imaginary vertical surfaces that delimit the river section on the front and back of the picture, cutting across the river.
\end{enumerate*}
\begin{enumerate}[exerc]
\item What can you say about the two fluxes across the two imaginary vertical surfaces, each considered as crossed from right to left in the picture? Can you find their numerical values?
\item You are told that the illustrated volume of water has total momentum $P=\qty{21600}{N\,s}$, directed from left to right perpendicularly to the imaginary vertical surfaces. Assuming the Newtonian constitutive relation for momentum, and the molar-mass constant $\yrho_{\mathrm{H_2O}}=\qty{0.0180}{kg/mol}$, can you find the values of the fluxes from the previous question?
\end{enumerate}
\end{exercise}
\marginpar{\vspace{-19\baselineskip}\centering%
\includegraphics[width=\linewidth]{images/riverbed3.png}%
\\[\jot]\footnotesize\flushleftright\color{mpcolor}%
(Illustration by \furl{https://dribbble.com/squarefountain}{Cathryn Briggs})%
}%
\nonosubsection{Gas pressure}
\label{nsec:matter_const_thermodynamics}
In the previous section we saw a constitutive relation between matter and \emph{flux} of momentum, which we called \enquote*{convective flux}. It is a flux that's always present whenever there's matter in motion.
In some circumstances, matter gives rise to a flux of momentum even when it is not in (visible) motion. In such cases it is said to be in a \furl{https://www.britannica.com/science/gas-state-of-matter}{\emph{gaseous} state}. The most cogent example is the air around us, which has a continuous flux of momentum, of approximately \qty[print-unity-mantissa=false]{1e5}{N} on every square-metre of surface, called \furl{https://www.britannica.com/science/atmospheric-pressure}{\emph{atmospheric pressure}}. This flux is always {\emph{compressive}} and occurs through any surface: any imaginary surface within the body of air itself, and any real surface between air and any other object.
\smallskip
For some kinds of matter in a gaseous state, the magnitude of their compressive flux of momentum $\yF_{\text{press}}$ can be approximated by the formula:
% \marginpar{\vspace{3\baselineskip}\centering%
% \includegraphics[width=\linewidth]{images/idealgas_mug.jpg}%
% % \\[\jot]\footnotesize\flushleftright{\color{mpcolor}%
% % The famous \enquote{$pV=NRT$} formula}%
% }%
\begin{definition}{Ideal-gas law}
\begin{equation*}
\frac{F_{\text{press}}}{A} = R\,\yT\,\frac{\yN}{V}
\end{equation*}
called the \textbf{ideal-gas law}, where $A$ is the area through which the momentum flux occurs, $V$ is the volume of a small region adjacent to the area, $\yN$ is the amount of matter in that volume, $\yT$ is its temperature, and $$R = \qty{8.31446261815324}{N\,m/(K\,mol)}\qquad\text{(exactly)}$$ is the \furl{https://www.britannica.com/science/universal-gas-constant}{molar gas constant}. The ratio $\yF_{\text{press}}/A$ of force and area is called \emph{pressure}.
\end{definition}
\marginpar{\vspace{-13\baselineskip}\centering%
\includegraphics[width=\linewidth]{images/barometer.jpg}%
\\[\jot]\footnotesize\flushleftright\color{mpcolor}%
A barometer for measuring atmospheric pressure (image from \furl{https://education.nationalgeographic.org/resource/atmospheric-pressure/}{National Geographic})%
}%
This law is very important in thermodynamics and chemistry, even if it's only an approximation.
\nonosubsection{Radioactive decay}
\label{nsec:matter_const_radioactive}
For radioactive substances, for which conservation of mass does not hold, we still have a balance law where the {supply}, which we can denote with the symbol $-\ya$, has a specific constitutive equation:
\begin{definition}{Matter supply in radioactive decay}
\begin{equation*}
-\ya(t) = -\lambda\,\yN(t)
\end{equation*}
where $\lambda$ is positive and called the \textbf{decay constant} of that particular substance. The supply with changed sign, $-\ya$, is usually called \furl{https://goldbook.iupac.org/terms/view/A00114}{\textbf{activity}}.
If there is no influx of matter, $\yJ(t)=0$, the balance law for the substance then takes the form
\begin{equation*}
\frac{\di\yN(t)}{\di t} = -\lambda\,\yN(t)
\end{equation*}
called the \furl{https://www.britannica.com/science/radioactivity/Rates-of-radioactive-transitions\#ref496415}{\emph{law of radioactive decay}}.
\end{definition}
\marginpar{\vspace{-13\baselineskip}\centering%
\includegraphics[width=0.75\linewidth]{images/radioactive.png}%
\\[\jot]\footnotesize\flushleftright\color{mpcolor}%
When we see this symbol we know that there's matter that's only balanced, not conserved -- which involves danger%
}%
\nonosection{Examples of applications}
\label{nsec:matter_applic}
\nonosubsection{Rigid-body and particle mechanics}
\label{nsec:cons_matter_particle}
In many applications we set up our description of the physical phenomenon of interest in such a way that the law of conservation of matter is automatically satisfied. This is achieved by choosing a sequence of closed control surfaces for which the flux of matter is zero, and therefore the amount of matter in the control volumes is constant. This procedure is often carried without many comments -- to the point of being almost forgotten at times.
We saw an example of this procedure in the {numerical evolution of the motion of a falling object}.
\marginpar{\centering%
\includegraphics[align=t,width=\linewidth]{images/timesteps.png}%
\\[2\jot]\footnotesize\color{mpcolor}%
Snippet of formula~\eqref{eq:timestep_momentum_position}%
}%
Take again a look at the timesteps in formula~\eqref{eq:timestep_momentum_position}: you see that at each timestep we calculate the velocity $\yv$ of matter from the momentum $\yP$, simply dividing by the mass $\yM$. \emph{This mass is assumed to be constant, not changing with time}. But this mass is proportional to the amount of matter: $\yM = \yrho \yN$. We are therefore assuming that the amount of matter $\yN$ doesn't change with time: $\di\yN(t)/\di t = 0$. This assumption is indeed guaranteed by the balance of matter~\eqref{neq:cons_matter}, by choosing a sequence of control surfaces that have no net flux of matter through them: $\yJ(t)=0$; in other words, they tightly wrap and follow the moving object.
\nonosubsection{Chemistry}
\label{nsec:cons_matter_chemistry}
One of the main assumptions in chemistry is the \enquote*{permanence of atoms}. This assumption imposes important restrictions in the \furl{https://doi.org/10.1351/goldbook.S06026}{stoichiometry} of chemical reactions, that is, in determining the amounts of products that can appear from given amounts of reactants.
\marginpar{\centering%
\includegraphics[align=t,width=\linewidth]{images/match_reaction.jpg}%
% \\[2\jot]\footnotesize{\color{mpcolor}%
% A match burning}%
}%
For instance, the \furl{https://chem.washington.edu/lecture-demos/match-head-reaction}{match-head reaction}
\begin{equation*}
3\,\mathrm{P_{4}} + 10\,\mathrm{K\,Cl\,O_{3}}
\to 3\,\mathrm{P_{4}O_{10}} + 10\,\mathrm{K\,Cl}
% \mathrm{CH_{3}CHO} \to \mathrm{CH_{4}} + \mathrm{CO}
\end{equation*}
expresses that if 30 moles of oxygen (O) atoms appear among the reactants, they must also appear among the products; same for the 12 moles of \furl{https://pubchem.ncbi.nlm.nih.gov/element/Phosphorus}{phosphorus (P) atoms}, the 10 moles of \furl{https://pubchem.ncbi.nlm.nih.gov/element/Potassium}{potassium (K) atoms}, and so on.
This assumption is simply the statement of conservation of matter, \emph{separately} for each chemical element: since the reaction doesn't let any other matter go in or out, the flux $\yJ$ for each chemical element must be zero. Therefore the amount $\yN$ of each chemical element must be constant: $\di\yN(t)/\di t = \yJ = 0$.
This assumption is often called \enquote*{conservation of mass}, but, as previously explained, \autoref{nsec:cons_matter_formulation}{\enquote{mass} is in this case only a proxy for matter}. The assumption of the permanence of atoms is only approximate and no longer valid in phenomena for which nuclear physics or particle physics become relevant.
\nonosubsection{Climate}
\label{nsec:cons_matter_climate}
The laws of conservation and balances of matter turn out to be very useful also in problems related to climate.
On the Earth's surface and atmosphere we can assume a law of conservation of matter for each of the \furl{https://www.britannica.com/science/isotope/The-discovery-of-isotopes\#ref496311}{stable isotopes} of the chemical elements, for instance the \furl{https://education.jlab.org/itselemental/ele006.html}{two stable carbon isotopes} and the \furl{https://education.jlab.org/itselemental/ele008.html}{three stable oxygen isotopes}. We can therefore follow these isotopes as they flow between different physical systems, like the atmosphere, the oceans, and the biosphere, especially plants -- in practice we are using huge control volumes.
For the radioactive isotopes, the \autoref{sec:matter_const_radioactive}{law of radioactive decay} applies, and from it we can deduce the age of different materials and objects like ice or wood.
% %
% \marginpar{\centering%
% \includegraphics[align=t,width=\linewidth]{images/carbon_cycle.jpg}%
% \\[2\jot]\footnotesize\flushleftright{\color{mpcolor}%
% The fluxes of carbon across the \enquote*{control volumes} of atmosphere, oceans, and other environments (image from \furl{https://gml.noaa.gov/outreach/isotopes/}{Global Monitoring Laboratory})}%
% }%
This is how we are able to say that human usage of fossil fuel is an important factor in the increase of carbon dioxide ($\mathrm{CO_{2}}$) in the atmosphere during the past 200 years or so. Take a look at the more detailed explanations given by the \furl{https://gml.noaa.gov/outreach/isotopes/}{Global Monitoring Laboratory}.
%
\marginpar{\vspace{2\baselineskip}\centering%
\includegraphics[width=\linewidth]{images/ice_core.png}%
\\\footnotesize\color{mpcolor}\url{https://xkcd.com/2902}%
}%
\begin{exercise}
Measuring the relative amounts of carbon within an air pocket near the surface of a block of ice, you find that one mole of air contains \qty[print-unity-mantissa=false]{1e-12}{mol} of the radioactive isotope \nuclide[14]{C}. Making an analogous measurement for an air pocket deeper in the ice, you find instead a relative abundance of \qty{2e-13}{mol} of \nuclide[14]{C}. How old is the deeper section of ice?
Find out the ice's age $t_{\text{ice}}$ by numerically evolving the balance equation
$$\frac{\di\yN(t)}{\di t} = -\lambda\,\yN(t)$$
with $\lambda=\qty{0.000122}{yr^{-1}}$, until you reach the amount $\yN(t_{\text{ice}})= \qty{2e-13}{mol}$.
Use the procedure of \autoref{sec:numeric_simulation}{\eqn~\eqref{eq:finite_diff}}, starting from time $\yti=\qty{0}{yr}$ and $\yN(\yti)=\qty[print-unity-mantissa=false]{1e-12}{mol}$, and assuming that the flow $\yJ(t)$ of \nuclide[14]{C} is zero. You can use a timestep $\Dt = (1/365)\:\unit{yr}$.
\end{exercise}
\nonosubsection{Fluid dynamics}
\label{nsec:fluid_dyn_areavel}
The law of conservation of matter in its explicit form is at the heart of fluid-dynamic problems. Consider the flow of a fluid (liquid or gas) for instance through a pipe or through a jet engine. When we say that a flow is \textbf{steady} we mean that the volume contents and the fluxes taken for whatever control volumes and surfaces do not change in time (though they may change in space). This condition can be viewed as a constitutive relation.
%
\marginpar{\vspace{-\baselineskip}\centering%
\includegraphics[height=15em]{images/pipesection.pdf}%
}%
Consider a control volume, for instance the one indicated in \textcolor{cyan}{light blue} in the side picture. The amount of fluid $\yN$ in this volume is constant in time: $\frac{\di\yN(t)}{\di t}=0$. By the law of conservation of matter, the total influx must then be zero:
\begin{equation*}
{\color{grey}\underbrace{\color{black}\frac{\di\yN(t)}{\di t}}_{\color{grey}{}=0}\color{black}} - \yJ(t) = 0
\qquad\Longrightarrow\qquad
\yJ(t) = 0
\end{equation*}
and it is given by the influxes through three surfaces: the side surface, the one at the top, and the one at the bottom. The influx through the side surface is zero. Let us denote the influx through the top surface by $\yJ_{1}$, and the influx through the bottom surface by $\yJ_{2}$. We must therefore have
\begin{equation*}
0 = \yJ(t) = \yJ_{1}(t) + \yJ_{2}(t)
\qquad\Longrightarrow\qquad
\yJ_{1}(t) = -\yJ_{2}(t)
\end{equation*}
%
\marginpar{\centering%
\includegraphics[align=t,width=\linewidth]{images/jet1.png}%
\\[\jot]\footnotesize\color{mpcolor}%
(image from \furl{https://www.jet-x.org/a8.html}{JetX})%
}%
that is, the influx through the top surface must equal the efflux through the bottom one.
This is a very powerful deduction: consider that it is valid even if the flow of the fluid is turbulent, and it is valid in more general situations such as at different sections of a jet engine.
\medskip
If the surfaces are small enough, we can also use the {connection between flux and velocity}:
\begin{equation*}
v_{1} = \frac{\yJ_{1}/A_{1}}{\yN/V}
\qquad
v_{2} = \frac{-\yJ_{2}/A_{2}}{\yN/V}
\end{equation*}
where $A_{1}, A_{2}$ are the areas of the top and bottom surfaces, and $v_{1}, v_{2}$ the \emph{downward} velocities through them (hence the minus sign for the bottom surface). From $\yJ_{1} = -\yJ_{2}$ we then find this important relationship:
\begin{equation*}
v_{1}\,A_{1} = v_{2}\,A_{2}
\end{equation*}
that is, if the area through which the flux occur decreases, then the velocity of the fluid through it increases, and vice versa.
%
\marginpar{\vspace{-7\baselineskip}\centering%
\includegraphics[width=0.5\linewidth]{images/tap_water.jpg}%
\\[\jot]\footnotesize\flushleftright\color{mpcolor}%
The thickness and velocity variations of tap water are a consequence of the law of conservation of matter%
}%
This is what we often observe in running water from our taps.
\bigskip
%%%***venturi tube
\printpagenotes*
\clearpage
\nonochapter{Balance of energy}
\label{ncha:bal_energy}
\printpagenotes*
\clearpage
\nonochapter{Balance of momentum}
\label{ncha:bal_momentum}
\epigraph{\emph{%
I hold in fact
\begin{enumerate}[label=(\arabic*),wide,itemindent=2em]
\item That small portions of space \emph{are} in fact of a nature analogous to little hills on a surface which is on the average flat; namely, that the ordinary laws of geometry are not valid in them.
\item That this property of being curved or distorted is continually being passed on from one portion of space to another after the manner of a wave.
\item That this variation of the curvature of space is what really happens in that phenomenon which we call the \emph{motion of matter}, whether ponderable or etherial.
\item That in the physical world nothing else takes place but this variation, subject (possibly) to the law of continuity.
\end{enumerate}
}}{W. K. Clifford \cites*{clifford1876}}
\printpagenotes*
\clearpage
\nonochapter{Balance of angular momentum}
\label{ncha:bal_ang_momentum}
% \printpagenotes*
% \clearpage
% \nonochapter{Conservation of electric charge and magnetic flux}
% \label{ncha:cons_charge_magneticflux}
%
% \printpagenotes*
% \clearpage
% \nonochapter{Balance of entropy}
% \label{ncha:bal_entropy}
\smallskip
\printpagenotes*
\clearpage
\nonochapter{Densities and flux-densities}
\label{ncha:density_fluxdensity}
How do we mathematically represent the seven main quantities? We said that, for each, we can ask \emph{how much in this region?} and \emph{how much through this surface during this time?} We must therefore use mathematical objects that allow us to answer these two questions. These objects are the \emph{density} and the \emph{flux vector}. The idea behind them is quite simple.
%Let us take the quantity \emph{matter} as an example.
\begin{definition}{Density}
Take a point in spacetime with coordinates $(\yti,\yxi,\yyi,\yzi)$. At the instant $\yti$, imagine a very small cuboid centred at $(\yxi,\yyi,\yzi)$, with sides aligned with the coordinate axes $x,y,z$ and of lengths $\Dx$, $\Dy$, $\Dz$. Then we have
\begin{equation}
\label{neq:density_expl}
\text{\small amount of quantity in cuboid} =
n(\yti,\yxi,\yyi,\yzi)\, \Dx\, \Dy\, \Dz \ .
\end{equation}
where $n(\yti,\yxi,\yyi,\yzi)$ is the \textbf{density} at the spacetime point $(\yti,\yxi,\yyi,\yzi)$.
\end{definition}
The density tells us how much quantity there's in a unit of volume. As the notation suggests, it is a function of the coordinates, that is, of time and spatial position. This functional dependence reflects the fact that we can have a larger amount of a quantity concentrated in some regions at some times, than in other regions or at other times.
In order to calculate the total amount of the quantity in an arbitrary 3D region, we simply divide it into very small cuboids similar to the one above. For each cuboid we calculate the respective amount; this amount will generally be different from cuboid to cuboid, because the value of the density $n(t,x,y,z)$ will be different at each cuboid's centre. Then we sum up all these amounts.
\begin{extra}{Isn't this an integral?}
You probably recognize this procedure as the description of integration. Indeed we can write:
\begin{equation}
\label{neq:density_integral}
\text{\small total amount of quantity in 3D region} =
\iiint\limits_{\mathclap{\text{3D region}}}n(t,x,y,z)\, \di x\, \di y\, \di z \ .
\end{equation}
\end{extra}
Clearly we must know the value of the density $n$ at all points within the region, in order to calculate the total amount. Note that if the quantity is absent in some subregion, then $n(\dotso)=0$ there.
\medskip
\begin{warning}[Do not confuse flux with movement]
Flux
\end{warning}
For the flux of the quantity through a surface we consider three different cases:
\begin{definition}{$x$-Flux}
Take again a point in spacetime with coordinates $(\yti,\yxi,\yyi,\yzi)$. Keeping $\yxi$ fixed, imagine a very small rectangular surface centred at $(\yxi,\yyi,\yzi)$, with sides aligned with the coordinate axes $y,z$ and of lengths $\Dy$, $\Dz$. Imagine that this surface exists for a lapse of time $\Dt$ around the time $\yti$. Then we have
\begin{equation}
\label{neq:xflux_expl}
\left.\parbox[c]{10em}{\small amount of quantity\\ through rectangle $\Dy\,\Dz$\\ towards positive $x$\\during time lapse }\right\} =
j_{x}(\yti,\yxi,\yyi,\yzi)\, \Dt\, \Dy\, \Dz \ .
\end{equation}
where $j_{x}(\yti,\yxi,\yyi,\yzi)$ is the \textbf{$x$-flux} at the spacetime point $(\yti,\yxi,\yyi,\yzi)$.
\end{definition}
The $x$-flux tells us how much quantity is flowing in a unit of time through a unit of surface parallel to $y,z$. Also the $x$-flux is a function of the coordinates, because the flux could be larger through some surfaces at some times, than through other surfaces at other times. If the quantity is flowing in the negative $x$ direction, then $j_{x}$ will be negative; and clearly if no quantity is flowing through the small rectangle, then $j_{x}=0$.
In an analogous way we define a $y$-flux and a $z$-flux:
\begin{definition}{$y$-Flux}
\begin{equation}
\label{neq:yflux_expl}
\left.\parbox[c]{10em}{\small amount of quantity\\ through rectangle $\Dz\,\Dy$\\ towards positive $y$\\during time lapse }\right\} =
j_{y}(\yti,\yxi,\yyi,\yzi)\, \Dt\, \Dz\, \Dy \ .
\end{equation}
\end{definition}
\begin{definition}{$z$-Flux}
\begin{equation}
\label{neq:zflux_expl}
\left.\parbox[c]{10em}{\small amount of quantity\\ through rectangle $\Dx\,\Dy$\\ towards positive $z$\\during time lapse }\right\} =
j_{z}(\yti,\yxi,\yyi,\yzi)\, \Dt\, \Dx\, \Dy \ .
\end{equation}
\end{definition}
The three fluxes can be grouped into the \textbf{flux vector}
\begin{equation}
\label{neq:flux_vector}
\bm{j}(t,x,y,z) \defd
\bigl(j_{x}(t,x,y,z),\ j_{y}(t,x,y,z),\ j_{z}(t,x,y,z)\bigr)
\end{equation}
In order to calculate the total amount of the quantity through an arbitrary sequence of 2D surfaces during a time lapse, we simply divide the total time into very brief time lapses, and for each of these we approximate the surface with very small rectangles aligned along the three axes. For each such lapse and rectangle we calculate the respective flux amount, using $j_{x}$, $j_{y}$, or $j_{z}$ depending on the orientation of the rectangle. Then we sum up all these amounts.
\begin{extra}
This is also the description of an integration, which can be written
\begin{multline}
\label{neq:flux_integral}
\text{\small total amount of quantity through sequence of surfaces} = {}\\
\begin{multlined}[b][0.9\linewidth]
\iiint j_{x}(t,x,y,z)\, \di t\, \di y\, \di z +{}
\\\iiint j_{y}(t,x,y,z)\, \di t\, \di z\, \di y +{}
\\\iiint j_{z}(t,x,y,z)\, \di t\, \di x\, \di y
\end{multlined}
\end{multline}
We shall not have to calculate density integrals~\eqref{neq:density_integral} and flux integrals~\eqref{neq:flux_integral} in these notes. In concrete physics problems these integrals are often difficult to calculate, and require advanced mathematical techniques and specialized software. But if you'll ever end up working in fields like computational fluid dynamics, atmospheric or ocean modelling, or numerical relativity, then you shall probably encounter them again.
\end{extra}
\medskip
The definitions above of density and flux are appropriate if the quantity in question is a scalar. For vector quantities like momentum and angular momentum, the density is a vector, and each of the three fluxes is a vector as well.
% For instance, for matter we could have $\yN(\yti)=\qty{3.5}{mol}$, and for energy we could have $\yJ=\qty{-600}{J}$. For momentum and angular momentum, each of the three amounts is instead a vector, of appropriate physical dimensions, that can have any magnitude and direction or components. For instance, for momentum we could have $\bm{N}_{2} = (-3.4,0,+5)\,\unit{kg\cdot m/s}$.
%% ***
% The flux tells us how much quantity is flowing through a unit of surface in a unit of time. Density and flux can change from spacetime point to spacetime point. We shall discuss them more in detail for each quantity later on. One important aspect to keep in mind is that \emph{the density and flux of each quantity depend on the coordinate system}.
\nonosection{Balance laws expressed with derivatives}
\label{nsec:balance_derivative}
In \chap\,\ref{ncha:density_fluxdensity} we saw that each of the main seven quantities is represented by a density and by a flux vector, which allow us to calculate the amount of quantity within a 3D region at a particular time, an flowing through a 2D surface during an time interval. These amounts are exactly what $\yN(\yti)$, $\yN(\ytf)$, $\yJ$ express. Therefore, a conservation or balance law must also give some relationship between density and flux vector.
The way to find such relationship is intuitive and mathematically simple, if only a bit lengthy. The idea is to formulate the balance law for a very simple case, the same simple set-up that we used in \chap\,\ref{ncha:density_fluxdensity} to introduce density and flux.
Take a point in spacetime with coordinates $(t,x,y,z)$. We apply the conservation law~\eqref{eq:conserved} to the following situation:
\begin{itemize}
\item[$\yN(\yti)$:] Choose an initial time $\yti=t-\Dth$, slightly before $t$, and a cuboid region centred at $(x,y,)$ with sides $\Dx$, $\Dy$, $\Dz$. The total amount of the quantity within this region is given, adapting formula~\eqref{neq:density_expl}, by
\begin{equation}
\label{neq:C1dens}
\yN(\yti) = n\bigl(t-\Dth, x,y,z\bigr)\,\Dx\,\Dy\,\Dz \ .
\end{equation}
\item[$\yN(\ytf)$:] Choose a final time $\ytf = t+\Dth$, slightly after $t$, and a cuboid region centred at $(x,y,)$ with sides $\Dx$, $\Dy$, $\Dz$. The total amount of the quantity within this region is given, adapting formula~\eqref{neq:density_expl}, by
\begin{equation}
\label{neq:C2dens}
\yN(\ytf) = n\bigl(t+\Dth, x,y,z\bigr)\,\Dx\,\Dy\,\Dz \ .
\end{equation}
\item[$\yJ$:] We calculate the flux separately through the six rectangular surfaces bounding the small cuboid region:
\begin{itemize}
\item[$\yJ_{x}$:] First choose a rectangular surface centred slightly to one side of the point $(x,y,z)$: at $(x-\Dxh, y, z)$, with sides parallel to $y,z$ and lengths $\Dy, \Dz$. We keep this surface constant for the small duration $\Dt$. The $x$-flux through this rectangle, towards positive $x$, during $\Dt$, is according to formula~\eqref{neq:xflux_expl}
\begin{equation*}
\label{neq:Fxfluxn}
\yJ_{x}^{\text{in}} = j_{x}\bigl(t, x-\Dxh, y, z\bigr)\,\Dt\,\Dy\,\Dz \ .
\end{equation*}
Now choose the rectangular surface parallel to the previous one, but on the other side of the point $(x,y,z)$, centred at $(x+\Dxh, y, z)$. The $x$-flux through this rectangle, towards positive $x$, during $\Dt$, is
\begin{equation*}
\label{neq:Fxfluxp}
\yJ_{x}^{\text{out}} = j_{x}\bigl(t, x+\Dxh, y, z\bigr)\,\Dt\,\Dy\,\Dz \ .
\end{equation*}
Note that the flux $\yJ_{x}^{\text{in}}$ points to the interior of the 3D region, towards its centre $(x,y,z)$; whereas $\yJ_{x}^{\text{out}}$ points to the exterior, away from the centre. The total flux into the region is therefore given by their difference:
\begin{equation}
\label{neq:Fxflux}
\begin{split}
\yJ_{x} &= \yJ_{x}^{\text{in}} - \yJ_{x}^{\text{out}}
\\&= \bigl[ j_{x}\bigl(t, x-\Dxh, y, z\bigr) - j_{x}\bigl(t, x+\Dxh, y, z\bigr)\bigr]
\,\Dt\,\Dy\,\Dz
\end{split}
\end{equation}
\item[$\yJ_{y}, \yJ_{z}$:] An analogous reasoning can be made to find the total flux through the other four surfaces, two parallel to $z,y$ and two to $x,y$. We find
\begin{align}
\label{neq:Fyflux}
\begin{split}
\yJ_{y} &= \yJ_{y}^{\text{in}} - \yJ_{y}^{\text{out}}
\\&= \bigl[ j_{y}\bigl(t, x, y-\Dyh, z\bigr) - j_{x}\bigl(t, x, y+\Dyh, z\bigr)\bigr]
\,\Dt\,\Dz\,\Dx
\end{split}
\\[3\jot]
\label{neq:Fzflux}
\begin{split}
\yJ_{z} &= \yJ_{z}^{\text{in}} - \yJ_{z}^{\text{out}}
\\&= \bigl[ j_{z}\bigl(t, x, y, z-\Dzh\bigr) - j_{x}\bigl(t, x, y, z+\Dzh\bigr)\bigr]
\,\Dt\,\Dx\,\Dy
\end{split}
\end{align}
\end{itemize}
The total flux into the region during the time interval $\Dt$ is finally the sum of the three above:
\begin{equation}
\label{neq:Fflux}
\yJ = \yJ_{x} + \yJ_{y} + \yJ_{z}
\end{equation}
\end{itemize}
Up to now we have only chosen arbitrary surfaces, regions, and a time interval. Now let's assume that the corresponding amounts and fluxes satisfy a balance law like~\eqref{eq:conserved}. Putting together the puzzle pieces we find
\begin{multline*}
\label{neq:balance_pieces}
\mathcolor{blue}{\yN(\ytf)} -\mathcolor{green}{\yN(\yti)} - \mathcolor{red}{\yJ} = 0 \qquad \Longrightarrow
\\[2\jot]
\left.\begin{aligned}
&\mathcolor{blue}{n\bigl(t+\Dth, x,y,z\bigr)\,\Dx\,\Dy\,\Dz}
- \mathcolor{green}{n\bigl(t-\Dth, x,y,z\bigr)\,\Dx\,\Dy\,\Dz}
\\[\jot]\quad&\color{red}-\bigl[ j_{x}\bigl(t, x-\Dxh, y, z\bigr) - j_{x}\bigl(t, x+\Dxh, y, z\bigr)\bigr]
\,\Dt\,\Dy\,\Dz
\\[\jot]\quad&\color{red}-\bigl[ j_{y}\bigl(t, x, y-\Dyh, z\bigr) - j_{x}\bigl(t, x, y+\Dyh, z\bigr)\bigr]
\,\Dt\,\Dz\,\Dx
\\[\jot]\quad&\color{red}-\bigl[ j_{z}\bigl(t, x, y, z-\Dzh\bigr) - j_{x}\bigl(t, x, y, z+\Dzh\bigr)\bigr]
\,\Dt\,\Dx\,\Dy
\end{aligned}\enspace\right\}=0
\end{multline*}
This expression is quite long, but it should be intuitively understandable if you try to identify the individual summed terms.
Now we take the last, long expression -- which is an equality -- and divide its left and right sides by $\Dt\,\Dx\,\Dy\,\Dz$. Note that many of the \enquote{$\incr$} factors simplify out. We arrive at this:
\begin{equation*}
\label{neq:balance_deriv_incr}
\left.\begin{aligned}
&\frac{n\bigl(t+\Dth, x,y,z\bigr)
-n\bigl(t+\Dth, x,y,z\bigr)}{\Dt}
\\[\jot]\quad&+\frac{j_{x}\bigl(t, x+\Dxh, y, z\bigr) - j_{x}\bigl(t, x-\Dxh, y, z\bigr)}{\Dx}
\\[\jot]\quad&+\frac{j_{y}\bigl(t, x, y+\Dyh, z\bigr) - j_{y}\bigl(t, x, y-\Dyh, z\bigr)}{\Dy}
\\[\jot]\quad&+\frac{j_{z}\bigl(t, x,y,z+\Dzh\bigr) - j_{z}\bigl(t, x,y,z-\Dzh\bigr)}{\Dz}
\end{aligned}\enspace\right\}=0 \ .
\end{equation*}
Still a long expression; but examine each fraction: we have a difference between a term calculated at some point, and one calculated at some point plus an increment \enquote{${}\incr$}; this difference is then divided by that increment. This is the definition of \emph{partial derivative}, that is, the derivative with respect to one variable, while keeping the other variables fixed. The short symbol for this is \enquote{$\frac{\de\dotso}{\de\dotso}$}, so we can simply write
\begin{definition}{Conservation law in derivative form}
\begin{equation}
\label{neq:balance_deriv}
\frac{\de n}{\de t}%(t,x,y,z)
+\frac{\de j_{x}}{\de x}%(t,x,y,z)
+\frac{\de j_{y}}{\de y}%(t,x,y,z)
+\frac{\de j_{z}}{\de z}%(t,x,y,z)
= 0
\end{equation}
\end{definition}
Let's make a simple check to see if this formula makes sense, in a simple one-dimensional case where we disregard the $y,z$ coordinates (let's say their fluxes are zero), so that the balance law becomes
\begin{equation*}
\frac{\de n}{\de t} + \frac{\de j_{x}}{\de x} = 0 \ .
\end{equation*}
\marginpar{\footnotesize%
\includegraphics[align=t,width=\linewidth]{images/ddxflux.pdf}
}
Suppose that the derivative of the $x$-flux is positive: $\frac{\de j_{x}}{\de x} > 0$. This means that the $x$-flux increases as we move from $x$ to $x+\Dx$, as shown in the side figure. The $x$-flux at $x$ is bringing some amount of quantity into the region of interest, the $x$-flux at $x+\Dx$ is taking a larger amount out of that region. Therefore, during the short time $\Dt$ in which this flux takes place, the total amount of quantity within the region will decrease. But the total amount is given by $n(t)$, which is therefore decreasing with time. This means that its time derivative is negative: $\frac{\de n}{\de t} < 0$. This agrees with balance law above: the sum of the two derivatives must be zero, so if one is positive, the other must be negative.
\medskip
Balance laws like~\eqref{neq:balance_deriv} are the basis of many important computational and simulation methods in a huge variety of physical applications: simulation of the ocean around an offshore oil platform, of wind in a wind farm, of air around an aeroplane's wing, of earthquakes, of electromagnetic-wave propagation, of oscillations in a suspension bridge, of percolation of fluids through terrain, of chemical reactions, of energy transfer\textellipsis The list could go on for pages!
The basic idea for using a balance law for a simulation is easy to understand. Take again the simpler one-dimensional formula without $y,z$ coordinates, and rewrite it remembering the basic meaning of the derivative:
\begin{equation*}
\frac{n(t+\Dt,x)-n(t,x)}{\Dt} + \frac{j_{x}(t, x+\Dxh)-j_{x}(t,x-\Dxh)}{\Dx} = 0
\end{equation*}
Suppose we know all quantities at time $t$; we can then find the density $n$ at time $t+\Dt$. Leave it on the left side and bring all other terms on the right side, multiplying them by $\Dt$:
\begin{equation*}
n(t+\Dt,x) =
\Dt\,\biggl[ n(t,x) - \frac{j_{x}(t, x+\Dxh)-j_{x}(t,x-\Dxh)}{\Dx} \biggr]
\end{equation*}
which is essentially \furl{https://mathworld.wolfram.com/EulerForwardMethod.html}{Euler's method}.
This formula can then be used iteratively to find the density $n$ at later times. As a simple simulation set-up, we consider a region of space of interest and divide it into cells of width $\Dx$. We also treat time in steps of $\Dt$. Then the iterative procedure goes as follows:
\begin{myframe}
\begin{enumerate}[label=\arabic*.,ref=\arabic*]
\item \emph{Initial values:} Assign the value of $n$ at each $x$-cell at the initial time.
\item\label{nitem:timestep} \emph{For-loop in $x$:} for each $x$-cell, calculate the value of $n$ at $t+\Dt$, using the formula above.
\item Increase time by $\Dt$.
\item Go to~\ref{nitem:timestep}.
\end{enumerate}
\end{myframe}
For example, suppose we have two $x$-cells of width $\Dx=1$: one centred at $x_{1}$ and the other at $x_{2} = x_{1}+1$. There are three boundaries: the leftmost at $x_{1}-\tfrac12$, one between the cells at $x_{1}+\tfrac12 \equiv x_{2}-\tfrac12$, and the rightmost at $x_{2}+\tfrac12$. Then we have the following steps:
{\small
\begin{enumerate}[label=\arabic*.]
\item Assign the values $n(\yti,x_{1}), n(\yti,x_{2})$ of $n$ at $x_{1}$ and $x_{2}$ at time $\yti$.
\item Assign the values $$j_{x}\bigl(\yti,x_{1}-\tfrac12\bigr)\ , \enspace j_{x}\bigl(\yti,x_{1}+\tfrac12\bigr)\ , \enspace j_{x}\bigl(\yti,x_{2}+\tfrac12\bigr)$$
of the fluxes at the three boundaries at time $\yti$.
\item Calculate the values of $n$ at $x_{1}$ and $x_{2}$ at time $\yti=\yti+\Dt$, for instance
$$ n(\yti,x_{1}) =
\Dt\,\biggl[ n(\yti,x_{1}) - \frac{j_{x}(\yti, x_{1}+\tfrac12)-j_{x}(\yti,x_{1}-\tfrac12)}{\Dx} \biggr] \ .$$
Note that we have all quantities required on the right side.
\item Assign the values $$j_{x}\bigl(\yti,x_{1}-\tfrac12\bigr)\ , \enspace j_{x}\bigl(\yti,x_{1}+\tfrac12\bigr)\ , \enspace j_{x}\bigl(\yti,x_{2}+\tfrac12\bigr)$$
of the fluxes at the three boundaries at time $\yti$.
\item Calculate the values of $n$ at $x_{1}$ and $x_{2}$ at time $\ytf=\yti+\Dt$, for instance
$$ n(\ytf,x_{1}) =
\Dt\,\biggl[ n(\yti,x_{1}) - \frac{j_{x}(\yti, x_{1}+\tfrac12)-j_{x}(\yti,x_{1}-\tfrac12)}{\Dx} \biggr] \ .$$
Note that we have again all quantities required on the right side.
\item And so on.
\end{enumerate}
}
This routine requires us \emph{to know the flux at each $x$-cell and at each time}. But we shall soon see that this requirement can be bypassed.
The rudimentary routine above is the basis from which more precise and complex simulation routines are developed.
\begin{exercise}
Write a script, in your preferred programming language, that implements the simulation routine above in an $x$-grid with four cells $x=1,\ \dotsc,\ x=4$. Take a grid size $\Dx=1$ and time step $\Dt=1$. We can imagine that the quantity in question is electric charge. Use the following initial values for $n(t,x)$ at $t=0$:
\begin{equation*}
n(t\mo0, x\mo1)=7\ ,\enspace
n(t\mo0, x\mo2)=0\ ,\enspace
n(t\mo0, x\mo3)=0\ ,\enspace
n(t\mo0, x\mo4)=7
\end{equation*}
and assume the flux is, at each time $t$:
\begin{multline*}
j_{x}(t, x\mo0.5)=0\ ,\\
j_{x}(t, x\mo1.5)=+2\ ,\enspace
j_{x}(t, x\mo2.5)=0\ ,\enspace
j_{x}(t, x\mo3.5)=-2\ ,\\
j_{x}(t, x\mo4.5)=0 \ .
\end{multline*}
Questions and tasks:
\begin{enumerate}[exerc]
\item Which time evolution for $n$ do you observe? Does it make sense, given the fluxes above?
\item Feel free to try out or generalize your script with:
\begin{itemize}[shift]
\item different initial values
\item different fluxes
\item an explicit formula for the flux, for instance
\begin{equation*}
j_{x}(t,x) = 8\,x^{3} - 60\,x^{2} + 118\,x - 45
\end{equation*}
\item time-dependent fluxes
\item more cells
\item two or three dimensions, including $y$- or $z$-fluxes
\end{itemize}
\end{enumerate}
\end{exercise}
\printpagenotes*
\clearpage
\nonochapter{Matter}
\label{ncha:matter}
Matter is probably the easiest quantity to grasp intuitively; it's what we can really call \enquote{stuff}. % It is called \furl{https://doi.org/10.1351/goldbook.C01039}{\emph{chemical substance}} in chemistry, and \emph{baryons} and \emph{leptons} in particle physics.
It is important to clearly distinguish matter from \emph{mass}: mass can be considered a property of matter, but the two are different: for example, the mass of some amount of matter may change, even if the amount of matter stays the same.
There are different kinds of matter, each of which satisfies a balance relation. The distinction into different kinds depends on the physical theory. In most everyday situations, the distinction corresponds to different \furl{https://doi.org/10.1351/goldbook.C01022}{chemical elements}, and each satisfies its own balance. These balances are the basis of \furl{https://doi.org/10.1351/goldbook.S06026}{stoichiometry}. If we observe phenomena like nuclear fission or fusion, however, we notice that the balances of chemical elements are not really satisfied. With such phenomena we make a different distinction of types of matter, for instance \emph{baryons} and \emph{leptons}, and each satisfies again its own balance. It is unclear whether these balances might be broken in other physical phenomena at smaller scales. In these notes we shall usually consider chemical elements as the different kinds of matter, making some exceptions in discussion of nuclear phenomena.
\nonosection{Electric charge and magnetic flux}
\label{nsec:charge_magnetic}
\nonosection{Magnetic flux}
\label{nsec:magneticflux}
\nonosection{Energy}
\label{nsec:energy}
\nonosection{Momentum}
\label{nsec:momentum}
\nonosection{Angular momentum}
\label{nsec:rotmomentum}
\nonosection{Entropy}
\label{nsec:entropy}
%
% ** 8
% *** Structure of physical laws:
% **** fundamental
% **** constitutive
% **** boundary & initial conditions
% *** Conservation and balance laws
% *** Seven wonders of the world: geometric meaning; maths translation
% *** Why different phenomena and how to make predictions: Constitutive equations
% *** Conservation of amount of matter
% **** examples
%
% ** 9
% *** Energy: characteristics
% **** coordinate-dependent
% **** mass is energy, energy is mass
% **** matter: necessity of separation between "bulk" (mass) and small changes (energies); examples
% *** Balance of energy
% **** energy is only balanced; cosmology
%
% ** 10
% *** Momentum: characteristics
% **** coordinate-dependent
% **** momentum is energy flow, and vice versa
% **** matter: necessity of separation between "bulk" (momentum) and small changes (heat); examples
% *** Balance of momentum
% *** Force is momentum current; examples (diSessa)
%
% ** 11
% *** Angular momentum
% *** Balance of angular momentum
% *** Interlude: Conservation of charge and of magnetic flux
% *** Balance of entropy; "second law"
%
% ** 12
% *** _Special constitutive equations of Newtonian mechanics:_
% *** Momentum \propto matter flux; difference in relativity
% *** Forms of energy beside the "bulk"
% **** kinetic
% **** potential gravitational
% **** internal; several types (including chemical, elastic, etc)
% *** TODO Check work and heat
%
% ** 13
% *** _Example systems and problems_
%
% ** 14
% *** Temperature
% *** Entropy flux is (energy flux)/(temperature)
%
% ** 15
% *** Constitutive equations for internal energy: ideal gas (with dV/dt term)
% *** _Example systems and problems_
%
% ** 16
% *** Other examples: GPS?
\iffalse
\marginpar{\footnotesize%
\includegraphics[align=t,width=\linewidth]{images/eg_languages.png}
\\[\jot]\color{mpcolor}\enquote{\emph{%
}}\sourceatright{\cites{}}
}
\fi
\printpagenotes*
\clearpage
\nonochapter{Thermodynamics}
\label{ncha:thermodynamics}
\nonosection{Notes on \enquote{quasi-static} processes}
\label{nsec:quasistatic}
In general, none of the statements "reversible${}\Rightarrow{}$quasi-static" or "quasi-static${}\Rightarrow{}$reversible"
is true.
A counterexample to the second implication are systems with internal state variables, which cannot be made non-dissipative, no matter how slowed-down they are. See the discussion and mathematical analysis in Astarita \sect\,2.5.
A counterexample to the first implication is a system of spins in a crystal lattice. It is possible to \emph{reversibly} bring the system form an equilibrium state to another with opposite temperature by reversing the external magnetic field \emph{as fast as possible} -- and therefore \emph{not} through a quasi-static process. In fact it is key here that the process be \emph{not}-quasi-static, but as fast as possible, because a slow change of the external magnetic field would lead to an irreversible process with dissipation. For more details see the discussion in Buchdahl, Lecture~20.
The point is that for some systems a \emph{fast} change can actually prevent the onset of dissipative phenomena, and so the process needs to be fast if we want it to be reversible. Adiabatic processes often also need to be fast (as a curious historical fact, Truesdell \amp\ Bharatha, Preface p.~xii, remark that \enquote{In introducing what we today call an `adiabatic process', Laplace called it `a sudden compression', in which he was followed by Carnot}).
In fact, clearly non-quasi-static phenomena like \emph{explosions} can in some circumstances be described by \emph{reversible} processes! This is possible if the explosion involves many shock waves, as explained by Oppenheim, chap.~1 p.~63:
\begin{quote}
If there is more than one shock, the losses in available energy are diminished, so that in the limit, with an infinite number of shocks, they become negligible, and the process acquires the character of a thermodynamically optimal, i.e., reversible, change of state. The study of explosion processes reveals that, indeed, they are associated not with one but with a multitude of shocks.
\end{quote}
For explosions see also the mathematical analysis by Dunwoody: \emph{Explosion and implosion in a mixture of chemically reacting ideal gases}, where again reversible-process equations are used.
A caveat about reversible and quasi-static associations is given by Ericksen (\sect\,1.2):
\begin{quote}
Some tend to associate nearly reversible processes with those taking place very slowly -- the "quasi-static" processes. This probably stems, at least in part, from experience with classical theories of heat conduction, viscosity, and so on. However, a ball made of silly putty behaves almost reversibly when bounced rapidly and various other high polymers have similar predilections. So, it seems prudent to be open-minded in considering what may be reversible processes for particular systems.
\end{quote}
He later discusses (\sect\,3.1) the case of bars subjected to dead loads, for which we can have reversible processes under sudden jumps in elongation. He concludes (p.~46) that \enquote{the sudden jump provides an example of a process that is reversible but not reasonably considered to be quasi-static}.
\medskip
But there's an important question that underlies our discussion: what do we actually mean by \enquote{quasi-static}? We need to specify a time scale, otherwise the term is undefined. For example, a geological process (say, tectonic motion) can be considered as quasi-static -- or even completely static -- on time scales of minutes or days; but it is not quasi-static on time scales of millions of years.
Whether a process is reversible or not, within any tolerance needed, is an experimental question. We can measure any relevant quantities, say pressure $p$ and exchanged heat $q$, under the process, and compare them with those, $p^*$ and $q^*$, determined by the equations for a reversible process. We may find for example that at all times
$$\biggl\lvert\frac{p - p^*}{p^*}\biggr\rvert < 0.001 \ ,
\quad
\biggl\lvert\frac{q - q^*}{q^*}\biggr\rvert < 0.001
$$
and conclude that the process is reversible, if relative discrepancies of $0.1\%$ or less are negligible in our concrete application.
But suppose that someone tells us \enquote{if you want the process to be reversible, you must make sure that it is quasi-static}. Alright, but how much is \enquote{quasi-static}? is it OK if the piston moves with a speed of 1~cm/s? or is that too much? How about 1~mm/s? -- In fact we may find that for some kind of fluid 1~cm/s is absolutely acceptable for the process to be reversible, whereas for another kind of fluid that speed would lead (at the same temperature) to an irreversible process.
You see how this imprecise situation can lead to circular definitions: "if the process is irreversible, then it means it isn't quasi-static" -- but then we are actually \emph{defining} "quasi-static" in terms of "reversible"! Any statement of the kind "reversible${}\Rightarrow{}$quasi-static" or "quasi-static${}\Rightarrow{}$reversible" then becomes not a matter of experimental verification, but of pure \emph{semantics}. At this point we can simply get rid of "quasi-static" terminology since it doesn't bring any new physics to the table. This circularity is admitted for example by Callen in discussing irreversible gas expansion (Problem 4.2-3 p.~99):
\begin{quote}
The fact that $dS > 0$ whereas $dQ = 0$ is inconsistent with the presumptive applicability of the relation $dQ = T\,dS$ to all quasi-static processes. We define (by somewhat circular logic!) the continuous free expansion process as being "essentially irreversible" and \emph{non-quasi-static}.
\end{quote}
A similar criticism can be read in Astarita, \sect\,2.9, p. 62, where he also provides a mathematical quantification of quasi-static, similar to the one given above for reversibility:
\begin{quote}