Limit search to available items
Record 35 of 114
Previous Record Next Record
Book Cover
E-book
Author Moruzzi, Giovanni.

Title Essential Python for the physicist / Giovanni Moruzzi
Published Cham : Springer, 2020

Copies

Description 1 online resource (304 pages)
Contents Intro -- Preface -- Contents -- 1 Python Basics and the Interactive Mode -- 1.1 Using the Command Line -- 1.2 Installing Python -- 1.2.1 General -- 1.2.2 Downloading Python for Windows -- 1.2.3 Downloading Python for macOS -- 1.3 Using Python in Interactive Mode -- 1.4 Variables -- 1.4.1 Variable Types -- 1.4.2 Variable-Type Conversion -- 1.5 Arithmetic Operators -- 1.6 Assignment Operators -- 1.7 Comparison and Logical Operators -- 1.8 Python Packages and the import Statement -- 1.9 Conditional Statements -- 1.10 Lists and Tuples -- 1.11 List Methods
1.12 Lists and the = Assignment Operator -- 1.12.1 Copying Lists -- 1.12.2 Copying the Elements of Lists and Tuples -- 1.13 Slicing Lists and Strings -- 1.14 Dictionaries -- 1.15 The print() Function and Formatting -- 1.15.1 Old Style -- 1.15.2 New Style -- 1.15.3 Format Types and Flags -- 1.16 Loops -- 1.16.1 The for Loop -- 1.16.2 The while Loop -- 1.16.3 Breaking a Loop -- 1.16.4 The continue Statement -- 1.17 Operations with Matrices and Vectors -- 1.17.1 Lists and Arrays -- 1.17.2 Slicing out Rows and Columns from a Matrix -- 1.17.3 Arrays and Matrix Arithmetics
1.17.4 Further Matrix Operations -- 1.18 Exiting Interactive Mode -- 1.19 Exercises -- 2 Python Scripts -- 2.1 Scripts -- 2.1.1 Running Scripts on a Terminal -- 2.1.2 Running Scripts on Spyder3 -- 2.1.3 A First Script -- 2.2 Functions -- 2.2.1 General -- 2.2.2 Local and Global Variables -- 2.3 Reading and Writing Files -- 2.4 Calling External Commands from Python Scripts -- 2.5 Exercises -- 3 Plotting with Matplotlib -- 3.1 Pyplot -- 3.2 Plotting Lists of Numbers -- 3.3 Plotting Functions -- 3.4 Multiple Figures -- 3.5 Logarithmic Axis Scales -- 3.6 Plotting Field Lines -- 3.7 Pyplot Animation
3.8 Exercises -- 4 Numerical Solution of Equations -- 4.1 Introduction -- 4.2 Systems of Linear Equations -- 4.3 Nonlinear Equations -- 4.3.1 Common Methods for the Numerical Solution -- 4.3.2 Bisection Method -- 4.3.3 The Secant Method -- 4.4 Root Finding with the scipy.optimize Package -- 4.5 Algebraic Equations -- 4.6 Systems of Nonlinear Equations -- 4.6.1 Equations Involving only Unknowns -- 4.6.2 Equations Involving Unknowns and Parameters -- 4.7 Integration of Functions -- 4.7.1 Introduction -- 4.7.2 Rectangular and Trapezoidal Rules -- 4.7.3 The Simpson Rule
4.7.4 The scipy.integrate.simps Function -- 4.8 Exercises -- Reference -- 5 Numerical Solution of Ordinary Differential Equations (ODE) -- 5.1 Introduction -- 5.2 Euler and Runge-Kutta Methods -- 5.3 The scipy.integrate.odeint Function -- 5.4 Large-Amplitude Pendulum -- 5.5 The Shooting Method -- 5.5.1 The Finite Square Well -- 5.5.2 The Shooting Method -- 5.5.3 The Harmonic Oscillator -- 5.6 Exercises -- Reference -- 6 Tkinter Graphics -- 6.1 Tkinter -- 6.2 The Root Window and Tkinter Color Management -- 6.3 Drawing Geometric Shapes on the Canvas -- 6.4 Plotting a Function with Tkinter
Summary This book introduces the reader with little or no previous computer-programming experience to the Python programming language of interest for a physicist or a natural-sciences student. The book starts with basic interactive Python in order to acquire an introductory familiarity with the language, than tackle Python scripts (programs) of increasing complexity, that the reader is invited to run on her/his computer. All program listings are discussed in detail, and the reader is invited to experiment on what happens if some code lines are modified. The reader is introduced to Matplotlib graphics for the generation of figures representing data and function plots and, for instance, field lines. Animated function plots are also considered. A chapter is dedicated to the numerical solution of algebraic and transcendental equations, the basic mathematical principles are discussed and the available Python tools for the solution are presented. A further chapter is dedicated to the numerical solution of ordinary differential equations. This is of vital importance for the physicist, since differential equations are at the base of both classical physics (Newtons equations) and quantum mechanics (Schroedingers equation). The shooting method for the numerical solution of ordinary differential equations with boundary conditions at two boundaries is also presented. Python programs for the solution of two quantum-mechanics problems are discussed as examples. Two chapters are dedicated to Tkinter graphics, which gives the user more freedom than Matplotlib, and to Tkinter animation. Programs displaying the animation of physical problems involving the solution of ordinary differential equations (for which in most cases there is no algebraic solution) in real time are presented and discussed. Finally, 3D animation is presented with Vpython
Notes 6.4.1 Plotting a Hyperbola
Includes index
Print version record
Subject Python (Computer program language)
Physics -- Data processing
Computer programming -- software development.
Mathematical theory of computation.
Graphics programming.
Mathematical physics.
Computers -- Programming -- General.
Computers -- Programming -- Algorithms.
Computers -- Computer Graphics.
Science -- Mathematical Physics.
Physics -- Data processing
Python (Computer program language)
Form Electronic book
ISBN 9783030450274
3030450279