Instant Download Physics with Excel and Python: Using the Same Data Structure Volume I: Basics, Exercises and Tasks Dieter Mergel PDF All Chapters
Instant Download Physics with Excel and Python: Using the Same Data Structure Volume I: Basics, Exercises and Tasks Dieter Mergel PDF All Chapters
com
https://ebookmeta.com/product/physics-with-excel-and-python-
using-the-same-data-structure-volume-i-basics-exercises-and-
tasks-dieter-mergel/
OR CLICK BUTTON
DOWNLOAD NOW
Based on the German language edition: Physik mit Excel und Visual Basic by Dieter Mergel,
© 2017 2017. Published by Springer-Spectrum. All Rights Reserved, and extended with Python solutions.
© Springer Nature Switzerland AG 2022
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of
the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology
now known or hereafter developed.
The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication
does not imply, even in the absence of a specific statement, that such names are exempt from the relevant
protective laws and regulations and therefore free for general use.
The publisher, the authors and the editors are safe to assume that the advice and information in this book
are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or
the editors give a warranty, expressed or implied, with respect to the material contained herein or for any
errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.
This Springer imprint is published by the registered company Springer Nature Switzerland AG
The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland
Preface
1 Dieter Mergel, Physik mit Excel und Visual Basic Grundlagen, Beispiele und Aufgaben, Springer
Spektrum (2017), https://doi.org/10.1007/978-3-642-37857-7.
2 Dieter Mergel, Physik lernen mit Excel und Visual Basic, Anwendungen auf Teilchen, Wellen,
v
vi Preface
classes at the university and may also be a good start for students who later choose
to specialize in computational physics.
Our approach is intended to make the student fit for a computer-oriented world,
be it for spreadsheet calculations in business, scientific computing in research, or
mathematics and physics teaching in high school. We take into account that not all
students have the same attitude towards programming; some have to be encouraged
to venture into a new world, whereas others have to be cautioned not to rush into
blind programming.
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 A Two-Track Didactical Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 What Can You Expect? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 What Do You Need? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 Tim, Alac, and Mag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.5 Didactic Concept . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.6 Subject Matter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.7 Getting Started with Excel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.7.1 Start Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.7.2 Spreadsheet Presentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.8 Getting Started with Python . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.9 Skills to Be Trained . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2 Data Structures, Excel and Python Basics . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.1 Introduction: Named Ranges in Excel, Arrays in Numpy . . . . . . . 15
2.2 Characteristics of a Parabola . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
2.2.1 Different Definitions of a Parabola . . . . . . . . . . . . . . . . . . . . 17
2.2.2 Data Structure and Nomenclature . . . . . . . . . . . . . . . . . . . . . 19
2.3 Basic Exercise in Spreadsheet Calculation . . . . . . . . . . . . . . . . . . . . . 19
2.3.1 Cell Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.3.2 Graphical Representation of a Function . . . . . . . . . . . . . . . 22
2.3.3 Smart Legends in Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.3.4 Scroll Bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.3.5 Summary: Cell References and Name Manager . . . . . . . 26
2.3.6 What Have We Learned so Far, and How
to Proceed Further? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.3.7 Python Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
2.4 Python and NumPy Basics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.4.1 Basic Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
2.4.2 Data Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.4.3 Python Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
2.4.4 Numpy Constructions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
vii
viii Contents
9.6.2
Data Structure and Nomenclature . . . . . . . . . . . . . . . . . . . . . 393
9.6.3
Spreadsheet Calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
9.6.4
Python, Internally and Externally Consistent Error
of the Combined Result . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
9.7 Propagation of Standard Deviations . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
9.7.1 Rules for Propagation of Standard Deviations . . . . . . . . . 397
9.7.2 Data Structure and Nomenclature . . . . . . . . . . . . . . . . . . . . . 402
9.7.3 Spreadsheet Calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
9.7.4 Python Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
9.8 Propagation of Confidence Intervals . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
9.8.1 From Variance to Confidence . . . . . . . . . . . . . . . . . . . . . . . . . 407
9.8.2 Sum and Product of Two Measurands . . . . . . . . . . . . . . . . . 408
9.9 Mass of a Thin Film on a Glass Substrate . . . . . . . . . . . . . . . . . . . . . 409
9.9.1 Instructions for Use for Accurate Measurements
and Their Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 410
9.9.2 Data Structure and Nomenclature . . . . . . . . . . . . . . . . . . . . . 413
9.9.3 Spreadsheet Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 413
9.9.4 Python Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
9.10 Questions and Tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
10 Fitting Trend Curves to Data Points . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
10.1 Introduction: Linear and Nonlinear Regression . . . . . . . . . . . . . . . . . 419
10.1.1 Straight Line Through Data Points by Sight . . . . . . . . . . . 419
10.1.2 Multilinear Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
10.1.3 Nonlinear Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
10.1.4 Coefficient of Determination R2 . . . . . . . . . . . . . . . . . . . . . . . 422
10.1.5 C-spec Error with Iterative t Adaptation . . . . . . . . . . . . . . . 423
10.2 Linear Trend Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
10.2.1 Creating Data Points and Evaluating Them . . . . . . . . . . . . 424
10.2.2 Data Structure and Nomenclature . . . . . . . . . . . . . . . . . . . . . 426
10.2.3 Spreadsheet Calculation with Linest . . . . . . . . . . . . . . . . . . . 426
10.2.4 Python Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429
10.3 Fitting a Polynomial Trend Line to Data Points
with Multilinear Regression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
10.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
10.3.2 Data Structure and Nomenclature . . . . . . . . . . . . . . . . . . . . . 435
10.3.3 Spreadsheet Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
10.3.4 Python Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
10.4 Exponential Trend Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
10.4.1 Exponential and Logarithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
10.4.2 Exponential or Polynomial? . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
10.4.3 Data Structure and Nomenclature . . . . . . . . . . . . . . . . . . . . . 445
10.4.4 Python Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
10.4.5 Spreadsheet Solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
Contents xv
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
Other documents randomly have
different content
étaient outrés. Je demeurais impassible. J’eus néanmoins une petite
grimace, quand la kellnerin me réclama quatre marks soixante-quinze pour
une chère aussi dérisoire. J’ignore si tous les clients furent écorchés dans les
mêmes proportions, mais je constatai qu’ils n’avaient eu rien de plus à
manger que moi-même. Et j’imaginai la musique qu’on aurait menée en
France, en 1916, si l’on avait servi des dîners de ce genre aux voyageurs
conscients et organisés.
Quelques jours plus tôt, dans la Frankfùrter Zeitùng, à la rubrique des
tribunaux, j’avais lu une histoire assez stupéfiante. Il s’agissait d’un habile
commerçant qui avait inventé un ersatz extraordinaire, un produit spécial
destiné à remplacer à la fois l’huile et le vinaigre nécessaires à la salade.
Hélas! des acheteurs se plaignirent de la qualité du produit. On l’analysa, et
les experts fournirent les résultats suivants:
Eau pure = 99,7%
matières solides = 0,3 %
matières grasses = 0,00%
L’inventeur fut récompensé par deux mois de prison et le tribunal lui
infligea mille marks d’amende. La Frankfùrter Zeitùng est un journal
sérieux. Elle ne publie pas des farces à la Cami, et G. de Pawlowsky, si
fécond en «dernières nouveautés», ne figurerait pas au nombre de ses
rédacteurs. Mais que présagez-vous d’un pays où l’on peut mettre en vente
un produit comme celui-là et où les buffets de gare présentent aux civils des
repas aussi magnifiques? M’accusera-t-on de partialité, si j’insinue que ce
pays-là ne possède peut-être pas de quoi manger à sa faim? On est tellement
persuadé chez nous que les gazettes et le gouvernement nous ont gorgés de
mensonges, que l’on finit par douter de tout, sous prétexte que la famine,
annoncée peut-être avec trop d’éclat, n’a pas anéanti les Boches en six
semaines. Pourtant, si la famine souhaitée ne s’est pas produite, la faim a
fait son œuvre lente et sûre. Seulement, en France, nous avons mal posé la
question.
Longtemps, le peuple français a cru qu’il suffirait d’empêcher
l’introduction du blé chez les Allemands pour empêcher la guerre de traîner
en longueur.
—Faute de pain, disait-on, l’Allemagne sera contrainte de demander
grâce.
De là naquit cette idée d’épuiser l’ennemi en lui supprimant le blé. De là
aussi, plus tard, vint quelque désolation quand des territoires russes et
roumains, riches en céréales, tombèrent aux mains de ceux que le blocus
devait ruiner rapidement. Certes, la Russie et la Roumanie furent une
aubaine rare pour la Prusse, nul ne songe à le nier. Toutefois, il ne faut rien
exagérer, et le problème est ailleurs. A la vérité, le manque de pain n’a pas
tant fait souffrir le peuple allemand que certains journaux ont bien voulu
l’affirmer. Ceux qui avaient voyagé outre-Rhin, avant la guerre, savaient
déjà que l’Allemand n’est pas un amateur de pain. On a souvent cité ce trait
à quoi se reconnaissait un Français hors de chez lui, dans un hôtel ou sur un
paquebot: c’est qu’il consommait une prodigieuse quantité de pain. Le pain
est notre nourriture nationale. Nous gémirions d’en être privés ou de n’en
pas avoir à notre guise. Il n’en va pas de même de l’Allemand. Son aliment
essentiel, à lui, c’est la pomme de terre, la kartoffel.
Nous aussi, Français, nous aimons la pomme de terre, mais d’une autre
façon. Il nous fatiguerait d’en manger tous les jours et à tous les repas. Elle
est pour nous un légume quelconque, au même titre que le petit pois ou la
tomate. Elle va même quelquefois jusqu’à devenir un légume choisi, et
souvent rien ne nous semble supérieur au «bifteck-frites» des familles. Pour
l’Allemand au contraire, la pomme de terre est une chose substantielle que
l’on ne traite pas en fantaisie. On la mange ordinairement au naturel, en
robe de chambre: pellkartofell, pomme de terre en peau, que l’on mange
avec tout, avec le canard au jus, avec les œufs sur le plat et avec la saucisse
fumée. Sur le plus grand nombre des tables boches, elles apparaissent en
même temps que les hors-d’œuvre pour ne disparaître qu’à la fin du dessert.
Cette coutume ne date pas de la guerre. Tout au plus a-t-elle été
systématiquement préconisée par les autorités civiles et militaires afin de
parer quand même à la pénurie de pain, dont je ne dis pas que l’Allemand
fasse fi. Chez nous, on poussait le paysan à cultiver du blé, du blé, et du blé.
Là-bas, c’est la culture de la pomme de terre qui était ordonnée. Les
gazettes boches débordaient de lamentations, en 1916, parce que la gelée
avait réduit des deux tiers la récolte tant attendue des kartoffeln. On nous
rationna. Alors je compris le rôle du pain et de la pomme de terre dans la
grande guerre.
Un matin, j’ai lu dans la Frankfùrter Zeitùng, sous la signature de Kory
Towski, les vers suivants:
La pomme de terre d’empire.
Je suis la pomme de terre d’empire,
Le sauveur du peuple allemand,
Et, si l’épée allemande est victorieuse
Et si le Français ne conquiert pas le Rhin,
Je suis la pomme de terre d’empire,
J’y suis pour ma part.
Ces vers apportent une preuve. Les expressions qu’on y relève attestent
ce caractère d’importance de la kartoffel allemande. L’auteur l’appelle: die
Reichskartoffel, la patate d’empire, comme on dit une terre ou une loi
d’empire. Elle est nettement sacrée comme le salut de l’Allemagne à quoi
doit aller la reconnaissance nationale après la victoire, s’il y a victoire; et le
mot Heil, salut, se hausse à une nuance religieuse. Mais ce petit poème, de
style d’ailleurs très médiocre, n’est que de peu de prix auprès de cet autre,
que j’ai trouvé la même année, dans le même journal[F]. Celui-ci est signé
Emil Claar, et il est écrit en vers libres. Il est encore plus ébouriffant que le
premier. Écoutez:
A la pomme de terre.
Infatigablement jaillie du sombre flux de la terre,
Perle de la maison bourgeoise allemande,
Aprement évoquée, vivement conjurée,
Apaisante nounou d’un festin modéré,
O pomme de terre!
ACHEVÉ D’IMPRIMER
EN DÉCEMBRE 1924
PAR F. PAILLART A
ABBEVILLE (SOMME).
BIBLIOTHÈQUE DU HÉRISSON
Anthologie des Écrivains Morts à la Guerre (1914-1918)
Ouvrage complet en quatre volumes de 800 p. chacun, format 15 × 21
Exemplaires ordinaires 100 fr. les 4 volumes
Exemplaires sur Madagascar (nᵒˢ 1 à xxv) 1120 fr. —
Exemplaires sur Lafuma pur fil (nᵒˢ 1 à 250) 336 fr. —
Format in-8º couronne (12 × 19)
ROMANS & CONTES
BALKIS
Personne.
En marge de la Bible.
PIERRE BILLOTEY
Le Pharmacien spirite.
Raz-Boboul.
SUZANNE DE CALLIAS
Jerry.
NONCE CASANOVA
La Libertine.
Messaline.
RENÉE DUNAN
Baâl.
RAYMOND ESCHOLIER
Le Sel de la Terre.
MAURICE D’HARTOY
L’Homme Bleu.
RENÉ-MARIE HERMANT
Kniazii.
En détresse.
La Femme aux hommes.
Fakir.
JONCQUEL ET VARLET
Les Titans du Ciel.
L’Agonie de la Terre.
MAGALI-BOISNARD
Mâadith.
L’Enfant taciturne.
GEORGES MAUREVERT
Le Grand Plagiat.
MARCEL MILLET
La Lanterne chinoise.
ALICE ORIENT
La Tunique verte.
GASTON PICARD
Les Surprises des Sens.
THIERRY SANDRE
Mienne.
Le Purgatoire.
P.-J. TOULET
Béhanzigue.
THÉO VARLET
La Bella Venere.
Le Dernier Satyre.
Le Démon dans l’âme.
VARLET ET BLANDIN
La Belle Valence.
WILLY ET MENALKAS
L’Ersatz d’Amour.
Le Naufragé.
POÉSIE
JOACHIM DU BELLAY
La Amours de Faustine.
FAGUS
La Danse Macabre.
La Guirlande à l’Épousée.
Frère Tranquille.
ANDRÉ FONTAINAS
Récifs au Soleil.
LUCIEN JACQUES
La Pâque dans la grange.
TRISTAN KLINGSOR
Humoresques.
LOYS LABÈQUE
Le Miroir mystique.
ALPHONSE MÉTÉRIÉ
Le Livre des Sœurs.
Le Cahier Noir.
MUSÉE
Héro et Léandre.
HENRY MUSTIÈRE
La Nouvelle Franciade.
JEAN ROYÈRE
Poésies.
CH. DE SAINT-CYR
Le Livre d’Iseult.
JEAN SECOND
Le Livre des Baisers.
THEO VARLET
Aux Libres Jardins.
THÉATRE
HENRY STRENTZ
Théâtre de Hans Pipp.
Nouveau Théâtre de Hans Pipp.
LITTÉRATURE
ATHÉNÉE
Le Chapitre Treize.
FAGUS
Essai sur Shakespeare.
LÉON BOCQUET
Les Destinées Mauvaises.
ART
LE FAUCONNIER
Album, préface de J. Romains.
NOTES:
[A] Feldgraù = gris de campagne. Les Allemands appellent ainsi leurs soldats à
cause de la couleur de leur uniforme. Et les nôtres sont maintenant des Himmelblaù
(bleu de ciel) après avoir été des Rothosen (pantalons rouges).
[B] Major = Chef de bataillon, commandant.
[C] Oberst = Colonel.
[D] Les Allemands nomment ainsi: «tenant lieu d’officier», les sous-officiers à qui
ils accordent la patte d’épaule de lieutenant pour la durée de la guerre, mais qu’ils ne
considèrent pas comme de véritables officiers.
[E] Frankfùrter Zeitùng, 27 juillet 1916.
[F] Frankfùrter Zeitùng, 28 octobre 1916.
*** END OF THE PROJECT GUTENBERG EBOOK LE
PURGATOIRE ***
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must, at
no additional cost, fee or expense to the user, provide a copy, a
means of exporting a copy, or a means of obtaining a copy upon
request, of the work in its original “Plain Vanilla ASCII” or other
form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive from
the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.