maxima-detailed-tutorial-by-Edwin-Woollett

advertisement
 Edwin L. (Ted) Woollett
 Professor Emeritus, Physics & Astron.,
CSULB
 Ph.D. - Kansas State Univ, 1965
 Computational Physics
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. If there proves to be a sufficient demand for pdf files in
10 pt typeface (and/or postscript files), I will try to add that alternative.
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.
On reading these pdf files: If you are using the free Adobe Reader, you may get
irritating panels (depending on your version) at file launch with a message such as
"Reading untagged document...this document must be processed for reading...". You
can click the "cancel" box and hopefully avoid the "temporary tagging" process which
is a waste of time usually. (Don't check the little box which says "do not show this dialog
again", since then the program just starts the temporary tagging process without that
panel with the cancel box!!)
The free Adobe pdf reader has grown to be a massive program, with all kinds of bells
and whistles the average user doesn't need, and also the typeface seems poor on the
screen.
Perhaps a better pdf reader alternative (for the Windows xp user) is the relatively new
Sumatra free and open source pdf reader which is a small and fast program with better
looking typeface on my screen. You can read a review here. Or you can just go directly to
the download page. The best view is achieved by using the menus items: View, continuous;
Zoom, fit width. Make it your default pdf viewer for much faster work when clicking on
a pdf file.
COPYING AND DISTRIBUTION POLICY FOR CHAPTER PDF FILES.
NON-PROFIT PRINTING AND DISTRIBUTION OF THE CHAPTER PDF FILES IS
PERMITTED.
You may make copies of the chapter pdf files and distribute them to others as long as
you charge no more than the costs of printing. These notes (with some modifications)
will be published in book form eventually via Lulu.com in an arrangement which will
continue to allow unlimited free download of the pdf files as well as the option of
ordering a low cost paperbound version of these notes.
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
3. --mbe1toc.txt : Ch. 1 Detailed Table of Contents, August 11, 2009
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
What is Maxima?, 1 page,
Introduction to the wxMaxima Interface, 5 pages,
Introduction to the Xmaxima Interface, 5 pages,
Creating and Using a Startup File, 3 pages,
Maxima Expressions, Numbers, Operators, Constants, and Reserved Words, 2 pages,
Input and Output Examples, 1 page,
Maxima Power Tools at Work, 20 pages,
User Defined Maxima Functions, 8 pages,
History of Maxima, 1 page
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, Two Dimensional Plots and Least Squares Fits
1. --mbe2plotfit.pdf : July 13, 2009, Maxima 5.18.1, 25 pages
2. --mbe2toc.txt : Detailed Table of Contents, July, 13, 2009
3. --mbe2code.txt : Code input text file: July, 13, 2009, Maxima 5.18.1
4. --coffee.dat : Coffee Cooling Data File: July, 13, 2009, Maxima 5.18.1
Chapter 2 Topics
Introduction to plot2d,
First Steps with plot2d,
Parametric Plots,
Line Width and Color Controls,
Discrete Data Plots: Point Size, Color, and Type Control,
More gnuplot_preamble Options,
Using qplot for Quick Plots of One or More Functions,
Least Squares Fit to Experimental Data,
Maxima and Least Squares Fits: lsquares_estimates,
Syntax of lsquares_estimates,
Coffee Cooling Model,
Experiment Data: file_search, printfile, read_nested_list, and makelist,
Least Squares Fit of Coffee Cooling Data
Chapter 3: Ordinary Differential Equation Tools
1. --mbe3ode1.pdf : July 19, 2009, Maxima 5.18.1, 44 pages
2. --mbe3toc.txt : Detailed Table of Contents, July, 19, 2009
3. --mbe3code.txt : Code input text file: July, 19, 2009, Maxima 5.18.1
Chapter 3 Topics
Solution of One First Order Ordinary Differential Equation (ODE),
Exact Solution with ode2 and ic1,
Exact Solution with desolve,
Numerical Solution and Plot with plotdf,
Numerical Solution with Fourth Order Runge-Kutta: rk,
Solution of One Second Order or Two First Order ODE's,
Exact Solution with ode2, ic2, and eliminate,
Exact Solution with desolve, atvalue, and eliminate,
Numerical Solution and Plot with plotdf,
Numerical Solution with Fourth Order Runge-Kutta: rk,
Ex.1: Fall in Gravity with Air Friction: Terminal Velocity,
Ex.2: One Nonlinear First Order ODE,
Ex.3: One First Order ODE Which is Not Linear in Y',
Ex.4: Linear Oscillator with Damping,
Ex.5: Underdamped Linear Oscillator with Sinusoidal Driving Force,
Ex.6: Regular and Chaotic Motion of a Driven Damped Planar Pendulum
Using contrib_ode for ODE's
Chapter 4: Solving Equations
1. --mbe4solve.pdf : Jan. 29, 2009, Maxima 5.17.1, 48 pages
2. --mymnewton.mac : Jan. 29, 2009, Maxima 5.17.1
3. --mbe4solve.txt : cut and paste code: April 9, 2008, Maxima 5.14
Chapter 4 sections:
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,
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. --qdraw.mac : A Graphics Interface to draw2d: Jan. 29, 2009, Maxima 5.17.1
3. --qdrawsyntax.txt : Summary of Syntax: Dec 8, 2008, Maxima 5.16.
This updated syntax descripton begins with many details of the use of qdraw
for plotting sets of data. An earlier version was missing the use of the pts(..)
option pj(lw) used for joining data set points with straight lines.
4. --qdrawcode.txt : Copy and Paste Code: Jan. 29, 2009, Maxima 5.17.1
5. --mbe5batch.mac : Use batch(mbe5batch) to see all graphics examples: Jan. 29, 2009,
Maxima 5.17.1
6. --doplot1.mac : Vertical Lines Example: Jan. 29, 2009, Maxima 5.17.1
7. --doplot2.mac : Eighteen Triangles Example: Jan. 29, 2009, Maxima 5.17.1
8. --fit1.dat : Data File: June 16, 2008, Maxima 5.15
9. --fit2.dat : Data File: June 16, 2008, Maxima 5.15
Chapter 5 Sections:
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(..),
16. Geometric Figures: arrowhead(..),
17. Labels with Greek Letters,
18. Even More with more(...),
19. Programming Homework Exercises,
20. Acknowledgements.
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. --vcalc.mac : A Maxima package for Vector Calculus: July 19, 2008, Maxima 5.15
3. --vcalcdem.mac : Batch File Illustrating vcalc.mac: July 19, 2008, Maxima 5.15
4. --calc1code.txt : Copy and Paste Code: July 21, 2008, Maxima 5.15
5. --cylinder.mac : Cylindrical Coordinates: July 19, 2008, Maxima 5.15
6. --sphere.mac : Spherical Polar Coordinates: July 19, 2008, Maxima 5.15
Chapter 6 Sections:
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 : Apr. 29, 2009, Maxima 5.18.1, 35 pages
2. --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
1. --mbe8nint.pdf : Apr. 29, 2009, Maxima 5.18.1, 20 pages
2. --mbe8code.txt : Copy and Paste Code: Apr. 29, 2009, Maxima 5.18.1
Chapter 8 Topics:
1. Basic Tools: Examples of Use of quad_qags, romberg, quad_qagi,
2. Sharper Tools: Examples of the use of quad_qag, quad_qawo, quad_qaws,
quad_qawc, and quad_qawf,
3. 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 : Apr. 29, 2009, Maxima 5.18.1, 31 pages
2. --mbe9code.txt : Copy and Paste Code: Apr. 29, 2009, Maxima 5.18.1
3. --fdf.mac : Apr. 29, 2009, Maxima 5.18.1
4. --qbromberg.mac : Apr. 29, 2009, Maxima 5.18.1
5. --quad_de.mac : Apr. 29, 2009, Maxima 5.18.1
6. --quad_ts.mac : Apr. 29, 2009, Maxima 5.18.1
7. --quad_gs.mac : Apr. 29, 2009, Maxima 5.18.1
Chapter 9 Topics:
1. The Use of Bigfloat Numbers in Maxima,
1.1 Bigfloat Numbers Using bfloat, fpprec, and fpprintprec.
1.2 Using print and printf with Bigfloats,
1.3 Adding Bigfloats having Differing Precision,
1.4 Polynomial Roots Using bfallroots,
1.5 Bigfloat Number Gaps and Binary Arithmetic,
1.6 Effect of Floating Point Precision on Function Evaluation,
2. Arbitrary Precision Quadrature with Maxima,
2.1 Using bromberg for Arbitrary Precision Quadrature,
2.2 A Double Exponential Quadrature Method for a <= x < inf,
2.3 The tanh-sinh Quadrature Method for a <= x <= b,
2.4 The Gauss-Legendre Quadrature Method for a <= x <= b
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 : Apr. 29, 2009, Maxima 5.18.1, 38 pages
2. --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
4. --mbe11toc.txt : Table of Contents: 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.
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 is now living in San Luis Obispo, on the Central Coast of California, and is
developing a series of tutorial/lecture notes which describe in detail how one can use the
freely available computer algebra system Maxima (Macsyma) to explore computational
physics problems. These notes will be posted here in pdf form , together with text
(machine readable) source code.
His contact email address is now: woollett@charter.net
CSULB PHYSICS DEPT. HOME
Download