Edwin L. (Ted) Woollett Professor Emeritus, Physics & Astron., CSULB Ph.D. - Kansas State Univ, 1965 Computational Physics

Go to Maxima by Example.

```

```

Computational Physics with R and Maxima

```
```

Chapter 1, Numerical Differentiation, Quadrature, and Roots

A brief introduction to both R and Maxima is followed by examination of built-in and package tools for these three areas, with examples of use, and the design of homemade functions designed to employ the simplest numerical methods for these three areas of numerical work.
1. --cp1.pdf : Ch. 1, Mar. 4, 2014, Maxima 5.28.0, R 3.0.1, 70 pages
2. --cp1.tex : Ch. 1 Latex code file
3. --cp1code.R : R code for Ch. 1, Mar. 4, 2014, R 3.0.1
4. --cp1code.mac : Maxima code for Ch. 1 , Mar. 4, 2014, Maxima 5.28.0
5. --cpnewton.mac : Maxima code for Ch. 1, Mar. 4, 2014, Maxima 5.28.0

Chapter 1 Topics

1. Introduction to R and Maxima
2. Numerical Derivative Functions in R
3. Testing Simple Numerical Derivative Algorithms with R and Maxima
4. Quadrature Functions in R and Maxima
5. Testing Trapezoidal and Simpson's Rule Algorithms with R and Maxima
6. Dealing with Unbounded Integrals and End Point Singularities
7. Root Finding Functions in R and Maxima
8. Simple Divide and Conquer Strategy
9. Testing Newton-Raphson and Secant Methods with R and Maxima
10. Testing Bigfloat Newton-Raphson with Maxima
11. Margins and Outer Margin Area in R Plots
12. Drawing Circles Using R

Example 1: Semiclassical Quantization of Molecular Vibrations

Examples of "bottom-up" programming in both R and Maxima for a physics problem which makes use of both quadrature and root finding.

1. --example1.pdf : Example 1, Oct. 30, 2013, Maxima 5.28.0, R 3.0.1, 17 pages
2. --example1.tex : Example 1 Latex code file
3. --example1.R : R code for Example 1, Oct. 29, 2013, R 3.0.1
4. --example1.mac : Maxima code for Example 1 , Oct. 29, 2013, Maxima 5.28.0

Project 1: Classical Scattering in a Central Potential

Scattering theory notation, and plots of the effective potential, scattering trajectories, scattering angles, and differential scattering cross sections for the Rutherford potential (repulsive and attractive) and for the Lennard-Jones potential. Includes a brief introduction to Maxima's rk() function and R's ode() function, which are used for the scattering trajectory plots.

1. --project1.pdf : Project 1, Mar. 3, 2014, Maxima 5.31.2, R 3.0.2, 56 pages
2. --project1.tex : Project 1 Latex code file
3. --cmass.R : R code for center of mass diagram, Mar. 3,2014, R 3.0.2
4. --coord.R : R code for coordinate diagram, Mar. 3, 2014, R 3.0.2
5. --k1util.mac : Maxima utility functions, Mar. 3, 2014, Maxima 5.31.2
6. --lennard_jones.mac : Mar. 3, 2014, Maxima 5.31.2
7. --lennard_jones.R : Mar. 3, 2014, R 3.0.2
8. --rutherford_attract.mac : Mar. 3, 2014, Maxima 5.31.2
9. --rutherford_attract.R : Mar. 3, 2014, R 3.0.2
10. --rutherford_repulse.mac : Mar. 3, 2014, Maxima 5.31.2
11. --rutherford_repulse.R : Mar. 3, 2014, R 3.0.2
12. --scatt.R :R code for scattering angle diagram, Mar. 3, 2014, R 3.0.2
13. --sho1.R :R code for integration of simple harmonic oscillator, Mar. 3, 2014, R 3.0.2

Chapter 2, Initial Value Problems

A variety of initial value problems are solved using both R and Maxima. Homemade codes for the Euler method and the classical fourth order Runge-Kutta method are demonstrated with numerous examples. The standard Maxima methods rk and rkf45 are discussed, and the R deSolve package ode method is extensively discussed with many examples. Finally, methods for solving initial value problems in which the derivatives are discontinuous and in which the dependent variables are discontinuous are discussed.
1. --cp2.pdf : Ch. 2, April 23, 2014, Maxima 5.31.0, R 3.0.2, 71 pages
2. --cp2.tex : Ch. 2 Latex code file
3. --k2util.mac : Maxima utility functions for Ch. 2, April 23, 2014
4. --myode.mac : Maxima code for Ch. 2 , April 23, 2014, Maxima 5.31
5. --myode.R : R code for Ch. 2, April 23, 2014, R 3.0.2
6. --myrkf45.mac : Maxima code for Ch. 2 , April 23, 2014, Maxima 5.31

Chapter 2 Topics

1. The Euler Method, Truncation Errors, Round-off Errors, Instability
2. 4th Order Runge-Kutta Code for R and Maxima
3. The Maxima Methods rk and rkf45
4. The R package deSolve and Use of ode
5. Solving O.D.E.'s with External Forcing Data
6. Integrating O.D.E.'s with Discontinuous Derivatives
7. Integrating O.D.E.'s with Discontinuous Dependent Variables Using R
1. Events Specified with a data.frame
2. Intravenous Drug Injection Model
3. Using an Event Function at Specified Times
4. Using an Event Function when a Root Condition is Satisfied
5. Use of a Switching Parameter as a Dependent Variable

Example 2: Surfaces of Section for the Henon-Heiles Potential -- updated June 3, 2014

Examples of "bottom-up" programming in both R and Maxima for the trajectories and surfaces of section for a classical particle orbiting in the Henon-Heiles potential. This potential was first studied as a mathematical model to describe the chaotic motion of a test star in an axisymmetric galactic mean gravitational field. The June 3 update includes new code rk41 designed to land on the final point, providing improved surface of section behavior.

1. --example2.pdf : Example 2, June 3, 2014, Maxima 5.31, R 3.0.2, 25 pages
2. --example2.tex : Example 2 Latex code file, June 3, 2014
3. --example2.R : R code for Example 2, June 3, 2014, R 3.0.2
4. --example2.mac : Maxima code for Example 2 , June 3, 2014, Maxima 5.31
5. --hhplota.R : R code for Example 2 , May 20, 2014, R 3.0.2
6. --example2.zip : zip file contains all files for Example 2 , June 3, 2014

Project 2: Structure of a White Dwarf Star --NEW--7/23/2014

A pedagogical discussion of the differential equations for the mass profile m(r) and the mass density profile rho(r), assuming the cold degenerate relativistic electron gas provides the internal pressure, and the non-degenerate heavy nuclei provide the gravitational attraction. Both R and Maxima code are used in parallel treatments to draw plots (for a given central density) of m(r), rho(r), kinetic energy profile k(r), gravitational energy profile u(r), and to explore the total energy (including rest mass energy) as a function of central mass density and the stellar mass, and to plot the stellar radius as a function of stellar mass.

1. --project2.pdf : Project 2, July 23, 2014, Maxima 5.31.2, R 3.0.2, 27 pages
2. --project2.tex : Project 2 Latex code file, July 23, 2014
3. --project2.R : R code for Project 2, July 23, 2014, R 3.0.2
4. --project2.mac : Maxima code for Project 2 , July 23, 2014, Maxima 5.31
5. --project2.zip : zip file contains all files for Project 2, July 23, 2014

R (link to project page) is a freely available, open source, and powerful numerical interpreter with some similarities with the commercial Matlab platform. Although primarily used (at present) for statistics and data science, R is increasingly being used for numerical programming in the physical sciences. Combining the unique numerical abilities of R with the powerful symbolic abilities of Maxima provides a strong alternative to Mathematica, Maple, etc.

```

```

Maxima by Example

```
```

Maxima (link to project page) is a freely available and powerful computer algebra system (CAS) which is an open source cousin of the commercial Macsyma CAS. Maxima has powerful symbolic, numerical, and graphical capabilities, and you can download as many copies as you need without the hassle of license negotiations with Mathematica or Maple. Maxima is being steadily improved by an energetic development team of volunteers. An email "mailing list" provides an effective and friendly means of getting and providing advice on the practical use of Maxima with your research or project.

Maxima by Example is a series of tutorial notes which include many examples of the power of Maxima. Designed for the new user, we include some "nuts and bolts" suggestions for working with the Maxima software, especially for the Windows user. The posted files use 12 point type, which makes for easier reading at the computer screen, but costs more to print.

Reading these notes on your computer makes more sense than printing them out, although you may want to print out the first page which has the table of contents. It is easier to keep a live set of notes up to date than a book.

NON-PROFIT PRINTING AND DISTRIBUTION OF THE CHAPTER PDF FILES IS PERMITTED.

Notepad++ is my Windows editor of choice for editing Maxima, html, and tex files. The Sourceforge download page is here.

Chapter 1, Introduction to Maxima

Chapter 1 has been completely restructured and rewritten in order to provide a better introduction to this series of notes. Note that the name of the file has been changed to mbe1intro.pdf. The Latex file mbe1intro.tex contains the complete latex source code, and can be used by Maxima users to construct their own personal notes or class handouts.
1. --mbe1intro.pdf : Introduction to Maxima, August 11, 2009, Maxima 5.19.0, 57 pages
2. --mbe1intro.tex : Latex code for Ch. 1, August 11, 2009, Maxima 5.19.0
4. --mbe1code.txt : Ch.1 Code input text file: August 11, 2009, Maxima 5.19.0
5. --mbe1util.mac : Ch. 1 Maxima Utility Functions: August 11, 2009, Maxima 5.19.0

Chapter 1 Topics

1. What is Maxima?
2. Introduction to the wxMaxima Interface
3. Introduction to the Xmaxima Interface
4. Creating and Using a Startup File
5. Maxima Expressions, Numbers, Operators, Constants, and Reserved Words
6. Input and Output Examples
7. Maxima Power Tools at Work
8. User Defined Maxima Functions
9. History of Maxima
The text file mbe1util.mac is free software: you can redistribute it and/or modify it under the terms of the GNU GENERAL PUBLIC LICENSE as published by the Free Software Foundation.

Chapter 2, Plots, Files, Read, Write, and Fit

Chapter 2 has been revised to include a large section on working with files from within Maxima. The new software file mfiles.mac includes many useful file manipulation functions. The small file mfiles1.lisp is loaded in by mfiles.mac.

Since Jan. 19, 2012, all updates reflect the necessity of using the complete file path (in ver. 5.26.0 thru 5.31) for all of the "file name slots" in the file manipulation functions defined in mfiles.mac. To save typing, one can define (in your maxima-init.mac file) a function mkp (make path) which makes use of a global parameter bpath which is a string which provides the base of the path to your work folder. One can then use mkp("myfile1.txt") instead of "c:/work2/myfile1.txt" as an argument to a file name slot. This is discussed at length in the introduction to the File section of chapter two.

1. --mbe2plotfit.pdf : Jan. 6, 2014, Maxima 5.31.2, 40 pages
2. --mbe2plotfit.tex : Jan. 6, 2014, Latex code file
4. --mbe2code.txt : Code file: Jan. 6, 2014, Maxima 5.31.2
5. --qplot.mac : Maxima code for quick plots, Oct. 3, 2011, Maxima 5.25.1
6. --mfiles.mac : Maxima code for file work, Jan. 19, 2012, Maxima 5.28.0
7. --mfiles1.lisp : Lisp code loaded by mfiles.mac, Oct. 3, 2011, Maxima 5.25.1
8. --coffee.dat : Coffee cooling tab separated data file: July, 13, 2009

Chapter 2 Topics

Introduction to plot2d

1. First Steps with plot2d
2. Parametric Plots
3. Line Width and Color Controls
4. Discrete Data Plots: Point Size, Color, and Type Control
5. Plot of a Discontinuous Function
6. Using qplot for Quick Plots of One or More Functions
7. Multiple Plots Using the Embedded Option

Working with Files Using the Package mfiles.mac

1. file_search, probe_file, ls, and dir
2. ftype, file_length, file_info
3. print_file, print_lines
4. rename_file, delete_file, copy_file, file_convert, ftext_replace
6. Search File with search_file
7. Search Multiple files with search_mfiles

Least Squares Fit to Experimental Data

1. Syntax of lsquares_estimates
2. Coffee Cooling Model
3. Experiment Data for Coffee Cooling
4. Least Squares Fit of Coffee Cooling Data

The new function read_data is designed to work correctly with unix, mac, and windows type text files. read_data uses the new function read_line which is a replacement for the current Maxima function readline.

The new function print_file correctly reads unix, mac, and windows files and is a replacement for the current Maxima function printfile.

Chapter 3: Ordinary Differential Equation Tools

1. --mbe3ode1.pdf : Sept. 16, 2010, Maxima 5.18.1, 44 pages
2. --mbe3ode1.tex : Sept. 16, 2010, Latex code file
4. --mbe3code.txt : Code input text file: July, 19, 2009, Maxima 5.18.1

Chapter 3 Topics

1. Solution of One First Order Ordinary Differential Equation (ODE)
2. Exact Solution with ode2 and ic1
3. Exact Solution with desolve
4. Numerical Solution and Plot with plotdf
5. Numerical Solution with Fourth Order Runge-Kutta: rk
6. Solution of One Second Order or Two First Order ODE's
7. Exact Solution with ode2, ic2, and eliminate
8. Exact Solution with desolve, atvalue, and eliminate
9. Numerical Solution and Plot with plotdf
10. Numerical Solution with Fourth Order Runge-Kutta: rk
11. Ex.1: Fall in Gravity with Air Friction: Terminal Velocity
12. Ex.2: One Nonlinear First Order ODE
13. Ex.3: One First Order ODE Which is Not Linear in Y'
14. Ex.4: Linear Oscillator with Damping
15. Ex.5: Underdamped Linear Oscillator with Sinusoidal Driving Force
16. Ex.6: Regular and Chaotic Motion of a Driven Damped Planar Pendulum
17. Using contrib_ode for ODE's

Chapter 4: Solving Equations

1. --mbe4solve.pdf : Jan. 29, 2009, Maxima 5.17.1, 48 pages
2. --mbe4solve.tex : Jan. 29, 2009, Latex code file
3. --mymnewton.mac : Jan. 29, 2009, Maxima 5.17.1
4. --mbe4solve.txt : cut and paste code: April 9, 2008, Maxima 5.14

Chapter 4 Topics

1. One Equation or Expression: Symbolic Solution or Roots (solve)
2. One Equation Numerical Solutions: allroots, realroots, find_root
3. Two or More Equations: Symbolic and Numerical Solutions (linsolve, linsolve_by_lu
4. eliminate, newton, mnewton, implicit_plot, draw package implicit)

Chapter 4 provides numerous examples of using Maxima tools to solve equations. Extra attention has been given to matrix methods for sets of linear equations, using linsolve_by_lu. The chapter ends with an interactive work session implementing a homemade "mymnewton" which is followed by creation of a homemade mymnewton function which has at its core a linsolve_by_lu matrix based function. Readers can download the text file "mymnewton.mac" and experiment with the code and experiment with adapting the code for their own uses.

Many of the examples in Chapter 4 are related to common questions sent in to the "Maxima Mailing List".

Chapter 5: 2D Plots and Graphics using qdraw

Chapter 5 presents many examples which use qdraw.mac, an interface to Maxima's draw2d function. qdraw(...) provides much quicker access to many features of draw2d, with default plot properties of interest to users from the physical sciences and engineering.

1. --mbe5qdraw.pdf : Jan. 29, 2009, Maxima 5.17.1, 52 pages
2. --mbe5qdraw.tex : Jan. 29, 2009, Latex code file
3. --qdraw.mac : A Graphics Interface to draw2d: Jan. 29, 2009, Maxima 5.17.1
4. --qdrawsyntax.txt : Summary of Syntax: Dec 8, 2008, Maxima 5.16
5. --qdrawcode.txt : Copy and Paste Code: Jan. 29, 2009, Maxima 5.17.1
6. --mbe5batch.mac : Use batch(mbe5batch) to see all graphics examples: Jan. 29, 2009, Maxima 5.17.1
7. --doplot1.mac : Vertical Lines Example: Jan. 29, 2009, Maxima 5.17.1
8. --doplot2.mac : Eighteen Triangles Example: Jan. 29, 2009, Maxima 5.17.1
9. --fit1.dat : Data File: June 16, 2008, Maxima 5.15
10. --fit2.dat : Data File: June 16, 2008, Maxima 5.15

Chapter 5 Topics

1. Quick Plots for Explicit Functions: ex(...)
2. Quick Plots for Implicit Functions: imp(...)
3. Contour Plots with contour(...)
4. Density Plots with qdensity(...)
5. Explicit Plots with Greater Control: ex1(...)
6. Explicit Plots with ex1(...) and Log Scaled Axes
7. Data Plots with Error Bars: pts(...) and errorbars(...)
8. Implicit Plots with Greater Control: imp1(...)
9. Parametric Plots with para(...)
10. Polar Plots with polar(...)
11. Geometric Figures: line(...)
12. Geometric Figures: rect(...)
13. Geometric Figures: poly(...)
14. Geometric Figures: circle(...) and ellipse(...)
15. Geometric Figures: vector(..)
17. Labels with Greek Letters
18. Even More with more(...)
19. Programming Homework Exercises

The text file qdraw.mac is free software: you can redistribute it and/or modify it under the terms of the GNU GENERAL PUBLIC LICENSE, Version 2, June 1991, as published by the Free Software Foundation. For more information see the license information at the top of the file.

Chapter 6: Differential Calculus

1. --mbe6calc1.pdf : July 21, 2008, Maxima 5.15, 57 pages
2. --mbe6calc1.tex : July 21, 2008, Latex code file
3. --vcalc.mac : A Maxima package for Vector Calculus: July 19, 2008, Maxima 5.15
4. --vcalcdem.mac : Batch File Illustrating vcalc.mac: July 19, 2008, Maxima 5.15
5. --calc1code.txt : Copy and Paste Code: July 21, 2008, Maxima 5.15
6. --cylinder.mac : Cylindrical Coordinates: July 19, 2008, Maxima 5.15
7. --sphere.mac : Spherical Polar Coordinates: July 19, 2008, Maxima 5.15

Chapter 6 Topics

1. Differentiation of Explicit Functions: diff(..) and Total Differential
2. Critical and Inflection Points of a Curve Defined by an Explicit Function
3. Tangent and Normal of a Point of a Curve Defined by an Explicit Function
4. Maxima and Minima of a Function of Two Variables
5. Tangent and Normal of a Point of a Curve Defined by an Implicit Function
6. Limit Examples using Maxima's limit(..) Function
7. Taylor Series Expansions using taylor(..)
8. Vector Calculus Calculations and Derivations using vcalc.mac
9. Maxima Derivation of Vector Calculus Formulas in Cylindrical Coordinates
10. Maxima Derivation of Vector Calculus Formulas in Spherical Polar Coordinates

The text file vcalc.mac is free software: you can redistribute it and/or modify it under the terms of the GNU GENERAL PUBLIC LICENSE, Version 2, June 1991, as published by the Free Software Foundation. For more information see the license information at the top of the file.

Chapter 7: Symbolic Integration

1. --mbe7sint.pdf : Sept. 16,2010, Maxima 5.18.1, 35 pages
2. --mbe7sint.tex : Sept. 16,2010, Latex code file
3. --mbe7code.txt : Copy and Paste Code: Apr. 29, 2009, Maxima 5.18.1

Chapter 7 Topics

1. Examples of Use of integrate
2. Piecewise Defined Functions
3. Area Between Curves Examples
4. Arc Length of an Ellipse
5. Double Integrals : Area and Moment of Inertia of an Elliptical Laminate
6. Triple Integrals: Volume and Moment of Inertia of a Solid Ellipsoid
7. Derivative of a Definite Integral with respect to a Parameter
8. Integration by Parts
9. Change of Variables

Chapter 8: Numerical Integration

The newly revised chapter 8 includes new package functions nint, quad, mdefint, and ndefint for 1d and 2d numerical integration, available after loading the file nint.mac.

The new package loaded by apnint.mac (nint.mac should be loaded first) makes available two functions for arbitrary precision quadrature in 1 dimension, apnint and apquad.

For routine 1d numerical integration (quadrature), you can simply use the syntax:

`    nint (expr,x,x1,x2)  `
where expr can be either real or complex. The new function nint will first try the Maxima function integrate (if feasible), and if not successful, will use the Maxima quadpack functions. You can force Maxima to just use the quadpack functions with the syntax:
`    quad (expr,x,x1,x2),`
again with expr being either real or complex.
You can also force Maxima to try integrate (if nint avoids integrate for a given integrand-domain) by using the syntax:
`    mdefint (expr,x,x1,x2) `
`    ndefint (expr,x,x1,x2) `
for a numerical answer calculated from the symbolic integrate answer using bigfloat methods with 32 digit precision.

The 2d syntax is similar to Mathematica's:

`    nint(f,[x,x1,x2],[y,y1,y2]) `
is an approximate numerical value of
`    integrate( integrate (f,y,y1,y2), x,x1,x2). `

A number of optional arguments can be used to control or request the quadpack method to be used.

Arbitrary precision quadrature using apnint has the syntax
`    apnint(expr,x,x1,x2,rp,wp), `
in which rp is the requested precision of the answer, and wp is the working precision. The function apnint first tries using integrate, if feasible, and if not successful, uses one of two numerical methods we discuss in Ch.9.

The function apquad has the same syntax:

`    apquad(expr,x,x1,x2,rp,wp), `
and avoids integrate, forcing use of one of two possible numerical methods.

In both of these arbitrary precision cases, if the domain is non-finite, then x1 should be finite and x2 should be the symbol inf.

1. --mbe8nint.zip : Dec. 14, 2013 zip code of all Ch. 8 files
2. --mbe8nint.tar.gz : Dec. 14, 2013 tar.gz code of all Ch. 8 files
3. --mbe8nint.pdf : 11/16/2012, Maxima 5.28.0, 35 page pdf file
4. --mbe8nint.tex : 11/16/2012, Maxima 5.28.0, Latex code file
5. --mbe8code.txt : Copy and Paste Code: 11/16/2012, Maxima 5.28.0
6. --nint.mac Dec. 14, 2013, Maxima 5.28.0
7. --nint.lisp Oct. 31,2012, Maxima 5.28.0
8. --mydefint.mac Oct. 31,2012, Maxima 5.28.0
9. --quad1d.mac Oct. 31,2012, Maxima 5.28.0
10. --quad2d.mac Oct. 31,2012, Maxima 5.28.0
11. --quad_util.mac Oct. 31,2012, Maxima 5.28.0
12. --nint_test.mac Oct. 31,2012, Maxima 5.28.0
13. --apnint.mac Dec. 14, 2013, Maxima 5.28.0
15. --tsquad.mac Dec. 14, 2013, Maxima 5.28.0

Chapter 8 Topics

3. Using the Wolfram Alpha Web Site for Integrals
6. Numerical Integration Decision Trees

Chapter 9: Bigfloats and Arbitrary Precision Quadrature

A valuable feature of a computer algebra system is the ability to easily do arithmetic to "arbitrary" precision. This chapter presents three powerful methods of arbitrary precision quadrature, including examples and test integrals.

1. --mbe9bfloat.pdf : Feb. 3, 2011, Maxima 5.18.1 and 23.2, 33 pages
2. --mbe9bfloat.tex : Feb. 3, 2011, Latex code file
3. --mbe9code.txt : Copy and Paste Code: Feb. 3, 2011, Maxima 5.18.1,5.23.2
4. --fdf.mac : Apr. 29, 2009, Maxima 5.18.1
5. --qbromberg.mac : Apr. 29, 2009, Maxima 5.18.1
6. --quad_de.mac : Apr. 29, 2009, Maxima 5.18.1
7. --quad_ts.mac : Apr. 29, 2009, Maxima 5.18.1
8. --quad_gs.mac : Apr. 29, 2009, Maxima 5.18.1

Chapter 9 Topics:

1. The Use of Bigfloat Numbers in Maxima,
2. Bigfloat Numbers Using bfloat, fpprec, and fpprintprec.
3. Using print and printf with Bigfloats,
4. Adding Bigfloats having Differing Precision,
5. Polynomial Roots Using bfallroots,
6. Bigfloat Number Gaps and Binary Arithmetic,
7. Effect of Floating Point Precision on Function Evaluation,
8. Arbitrary Precision Quadrature with Maxima,
9. Using bromberg for Arbitrary Precision Quadrature,
10. A Double Exponential Quadrature Method for a <= x < inf,
11. The tanh-sinh Quadrature Method for a <= x <= b,
12. The Gauss-Legendre Quadrature Method for a <= x <= b

The section on the use of bfallroots was updated Feb. 10, 2011, and uses Maxima 5.23.2. The necessity of using fpprec and ratepsilon settings which "match" is explored with a detailed example. The author is grateful to Michel Talon for feedback about the behavior of bfallroots.

The text files fdf.mac, qbromberg.mac, quad_de.mac, quad_ts.mac, and quad_gs.mac are free software: you can redistribute them and/or modify them under the terms of the GNU GENERAL PUBLIC LICENSE, Version 2, June 1991, as published by the Free Software Foundation. For more information see the license information at the top of the files.

Chapter 10: Fourier Series, Fourier and Laplace Transforms.

1. --mbe10fltrans.pdf : Sept. 16, 2010, Maxima 5.18.1, 38 pages
2. --mbe10fltrans.tex : Sept. 16, 2010, Latex code file
3. --mbe10code.txt : Copy and Paste Code: Apr. 29, 2009, Maxima 5.18.1

Chapter 10 Topics:

1. Fourier Series Expansion Examples,
2. Fourier Integral Transform Pair Examples,
3. Dirac Delta (Unit Impulse) Function Examples,
4. Laplace Transform Integral Examples,
5. Inverse Laplace Transform Examples and Residues

Chapter 11: Fast Fourier Transform Tools. Chapter 11 and the software file qfft.mac have been revised and greatly simplified to allow use of the new simplified Maxima package fft.lisp, effective with Maxima ver. 5.19.0, August 2009. The latex code file is made available for the convenience of instructors who would like to incorporate parts of Ch. 11 in their class notes and handouts.

1. --mbe11fft.pdf : Ch. 11, Fast Fourier Transform Tools, Aug. 13, 2009, Maxima 5.19.0, 28 pages
2. --mbe11fft.tex : Latex Source Code, Aug. 13, 2009, Maxima 5.19.0
3. --mbe11code.txt : Copy and Paste Code: Aug. 13, 2009, Maxima 5.19.0
5. --qfft.mac : Aug. 13, 2009, Maxima 5.19.0

Chapter 11 Topics:

1. FFT Spectrum of a Monochromatic Signal,
2. FFT Spectrum of a Sum of Two Monochromatic Signals,
3. FFT Spectrum of a Rectangular Wave,
4. FFT Spectrum Sidebands of a Tone Burst Before and After Filtering,
5. Cleaning a Noisy Signal using FFT Methods,
6. Basic Ideas of the Fast Fourier Transform,
7. Derivation of the Discrete Fourier Transform

The text file qfft.mac is free software: you can redistribute it and/or modify it under the terms of the GNU GENERAL PUBLIC LICENSE, Version 2, June 1991, as published by the Free Software Foundation. For more information see the license information at the top of the file.

Chapter 12: Dirac Algebra and Quantum Electrodynamics, Version 2

A Version 2 Maxima Dirac algebra package is demonstrated using examples from Quantum Electrodynamics. The file dirac2.mac loads the rest of the Dirac package files: simplifying-new.lisp, dgcon2.mac, dgtrace2.mac, dgeval2.mac, and dgmatrix2.mac. The file dgfunctions2.txt has an alphabetical list of the package functions. Eleven batch files carry out typical calculations.

Separate sections of Ch. 12 are devoted to a review of high energy physics notation (which agrees with Peskin and Schroeder), trace and contraction theorems, to a review of covariant polarization 4-vectors for physical (external) photons, and to the use of simplifying-new.lisp.

A 22 page introduction to typical uses, with examples given in an interactive session context, has been created to allow easier and quicker access to the syntax and abilities of the package.

The Dirac package code has been rewritten and the code greatly simplified. The more complicated examples now run about 35% faster. A suite of test files has been added, and is available as either a zip file or a tar.gz file.

The author is indebted to Maxima developer Barton Willis for his suggestion to use the recursive simplification lisp code simplifying.lisp, and for his advice in exploiting the power of that code.

The following Windows zip file contains all Chapter 12 files (except the test suite), including the pdf.
--mbe12dirac2.zip : 4-15-11, Maxima 5.23.2, 488 KB

The following tar.gz file contains all Ch. 12 files (except the test suite), including the pdf file.
--mbe12dirac2.tar.gz : 11-2-2012, Maxima 5.23.2, 479 KB
1. --mbe12dirac2.pdf : Ch. 12, Dirac Algebra and Quantum Electrodynamics, 4-15-11, Maxima 5.23.2, 83 pages,
2. --mbe12dirac2.tex : Ch. 12 Latex code file
3. --simplifying-new.lisp : Recursive simplification code, 4-15-11, Maxima 5.23.2
4. --dirac2.mac : The Dirac package driver, 4-15-11, Maxima 5.23.2
5. --dgcon2.mac : Symbolic contraction code: 4-15-11, Maxima 5.23.2
6. --dgtrace2.mac : Symbolic trace code, 4-15-11, Maxima 5.23.2
7. --dgeval2.mac : Frame dependent code, 4-15-11, Maxima 5.23.2
8. --dgmatrix2.mac : Explicit Dirac spinors and matrices, 4-15-11, Maxima 5.23.2
9. --dgfunctions2.txt : Alphabetical list of the Dirac package functions, 4-15-11, Maxima 5.23.2
10. --bhabha1.mac : High energy electron-positron scattering, 4-15-11, Maxima 5.23.2
11. --bhabha2.mac : Arbitrary energy electron-positron scattering, 4-15-11, Maxima 5.23.2
12. --compton0.mac : Photon plus scalar charged particle scattering, 4-15-11, Maxima 5.23.2
13. --compton1.mac : Photon plus lepton scattering, 4-15-11, Maxima 5.23.2
14. --moller0.mac : Scalar plus scalar charged particle scattering, 4-15-11, Maxima 5.23.2
15. --moller1.mac : High energy limit of electron-electron scattering, 4-15-11, Maxima 5.23.2
16. --moller2.mac : Arbitrary energy electron-electron scattering, 4-15-11, Maxima 5.23.2
17. --moller3.mac : Use of explicit matrix trace methods and symbolic trace methods for the squared polarized amplitudes for arbitrary energy electron-electron scattering, 4-15-11, Maxima 5.23.2
18. --MSQcomp.mac : a function definition loaded by moller3.mac, 4-15-11, Maxima 5.23.2
19. --pair1.mac : Unpolarized two photon annihilation of an electron-positron pair, 4-15-11, Maxima 5.23.2
20. --pair2.mac : Polarized two photon annihilation of an electron-positron pair, 4-15-11, Maxima 5.23.2
21. --photon1.mac : Sum identities for photon polarization 3-vectors, 4-15-11, Maxima 5.23.2
22. --dgtest2.zip : test suite zip file, 4-15-11, Maxima 5.23.2
23. --dgtest2.tar.gz : test suite tar.gz file 11-2-2012, Maxima 5.23.2

A file which is not in the zip or tar.gz files is a lisp file written by Leo Butler which allows Windows users to avoid a bug in using the Maxima function timedate. See Sec. 12.3 for a discussion of the use of --new-timedate.lisp.

Three independent methods of calculation are provided by the Dirac package.

1. The symbolic methods are available for the calculation of either unpolarized differential cross sections or polarized differential cross sections.The symbolic methods allow unpolarized differential cross sections to be first expressed in an arbitrary frame in terms of the Mandelstam variables s, t, and u.
2. An alternative path (but frame dependent) to either unpolarized or polarized differential cross sections is the use of explicit Dirac matrices (we use the same conventions as Peskin and Schroeder) and explicit matrix trace and contractions on Lorentz indices.
3. The third path is the use of explcit Dirac spinors and matrices to first calculate all possible polarized amplitudes (ie.,for various helicity choices) and then the sum of the squares reproduces the unpolarized results.

The Dirac package files are free software: you can redistribute them and/or modify them under the terms of the GNU GENERAL PUBLIC LICENSE, Version 2, June 1991, as published by the Free Software Foundation. For more information see the license information at the top of the file.

Quark Gluon Hard Scattering Processes
A simple tree level QCD hard scattering calculation. The batch file includes references and a copy of the batch file run. The version 2 Dirac package (dirac2.mac) needs to be loaded, and in addition the file qcd1.mac needs to be loaded as well. The latter file contains explicit matrix definitions of the eight SU(3) group 3 x 3 color matrices T[a], a = 1,2,..,8, and also calculates the antisymmetric gauge group structure contants f[a,b,c], and the symmetric structure constants d[a,b,c] for use in calculations.
1. --qcd1.mac Color matrices and structure constants
2. --qq-qq1.mac Quark-quark scattering via gluon exchange, April 30, 2011, Maxima 5.24.0

A Clebsch-Gordan Coefficient Package for Maxima

Contains (not very efficient) Maxima code for Wigner vector coupling coefficients (Clebsch-Gordan coefficients)
cj (j1,j2,j3,m1,m2,m3) and the simply related Wigner 3j coefficients threej (j1,j2,j3,m1,m2,m3), both for explicit integer and half-integer arguments only.

--clebsch.mac : Oct. 22, 2010, Maxima 5.21.1

The text file clebsch.mac is free software: you can redistribute it and/or modify it under the terms of the GNU GENERAL PUBLIC LICENSE, Version 2, June 1991, as published by the Free Software Foundation. For more information see the license information at the top of the file.

A Simple Maxima Lagrangian Mechanics Package

--lag1.mac : Oct. 26, 2010, Maxima 5.22.1. This is a batch file which contains some simple examples of deriving the second order equations of motion for a system described by a Lagrangian function of generalized coordinates and velocities and for which no constraint equations are needed.

The results from the batch file run are in a comment at the end of lag1.mac.

--lag2.mac : Oct. 26, 2010, Maxima 5.22.1. This Maxima code file contains code which is automatically loaded in by lag1.mac.

The text files lag1.mac and lag2.mac are free software: you can redistribute them and/or modify them under the terms of the GNU GENERAL PUBLIC LICENSE, Version 2, June 1991, as published by the Free Software Foundation. For more information see the license information at the top of the file.

Symbolic Pauli Matrix Commutator Expansions

--pauli1.mac : Nov. 29, 2010, Maxima 5.22.1. This code file loads commutators.mac and uses tellsimpafter methods to complete the symbolic expansion of Pauli matrices. Also included is code for comparing explicit matrix calculations of commutators with the symbolic results. Note that the code uses the convention that sig[k], for k = 1,2,3, (lower case first letter) represents the symbolic Pauli matrix, and Sig[k], for k = 1,2,3, (upper case first letter) represents the explicit Pauli matrix.

At the end of this file are examples of use.

--pauli2.mac : Nov. 29, 2010, Maxima 5.22.1. This code file loads commutators.mac and uses defrule methods to complete the symbolic expansion of Pauli matrices.

At the end of this file are examples of use.

--commutators.mac : Nov. 29, 2010, Maxima 5.22.1. This Maxima code file, written by Maxima coordinator Robert Dodier, first creates a new property 'bilinear', which can then be used in declare(comm,bilinear) declarations. The file then uses defrule methods to create rules for the extraction of scalars, numbers, and factors of %i to be removed from 'comm' arguments and rules for the basic product rule expansion of a commutator of two operators or matrices.

At the end of this file are examples of use.

The text files commutators.mac, pauli1.mac, and pauli2.mac are free software: you can redistribute them and/or modify them under the terms of the GNU GENERAL PUBLIC LICENSE as published by the Free Software Foundation.

Ted Woollett was active in teaching and research for 35 years (beginning in 1966) as a faculty member in the Physics and Astronomy Department at California State University, Long Beach. His research included peer reviewed work in theoretical plasma physics, non-equilibrium thermodynamics, theoretical xray spectra, high energy nuclear physics, and physics & society issues.

Over the course of his service in teaching, Ted created a freshman physics course "Man and Energy" which dealt with the physics side of societal issues related to energy use and the environment. This popular course offered during the 1970's used a different text each semester the course was taught, and even included one semester devoted to physics of the health implications of radiation.

Physics and astronomy courses taught to undergraduates and graduate students included Elementary Particle Physics Phenomenology, Special Relativity, General Relativity, Introduction to Astrophysics, Computational Physics, Plasma Physics, Statistical Physics, Thermodynamics, Electricity and Magnetism, Quantum Mechanics, Classical Mechanics, and Mathematical Methods of Physics.

Ted and Kathleen are now living in San Luis Obispo, on the Central Coast of California.
Monthly social "highlights" are the Morro Bay AAUW dine-out group and the Unitarian-Universalist bookclub,
"The Litwits".

His contact email address is now: woollett@charter.net

CSULB PHYSICS DEPT. HOME