## With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

No credit card required ## Book Description

Unlock the full potential of Sage for simplifying and automating mathematical computing

• The best way to learn Sage which is a open source alternative to Magma, Maple, Mathematica, and Matlab
• Learn to use symbolic and numerical computation to simplify your work and produce publication-quality graphics
• Numerically solve systems of equations, find roots, and analyze data from experiments or simulations
• Save time on algebra by automatically simplifying symbolic expressions, performing calculus operations, and manipulating vectors and matrices
• Use the Python programming language to write and debug code more quickly than traditional compiled languages like C++ or Fortran
• Key features of Sage are explained using practical examples from engineering, science, and applied mathematics

In Detail

Your work demands results, and you don't have time for tedious, repetitive mathematical tasks. Sage is a free, open-source software package that automates symbolic and numerical calculations with the power of the Python programming language, so you can focus on the analytical and creative aspects of your work or studies.

Sage Beginner's Guide shows you how to do calculations with Sage. Each concept is illustrated with a complete example that you can use as a starting point for your own work. You will learn how to use many of the functions that are built in to Sage, and how to use Python to write sophisticated programs that utilize the power of Sage.

This book starts by showing you how to download and install Sage, and introduces the command-line interface and the graphical notebook interface. It also includes an introduction to Python so you can start programming in Sage. Every major concept is illustrated with a practical example.

After learning the fundamentals of variables and functions in Sage, you will learn how to symbolically simplify expressions, solve equations, perform integrals and derivatives, and manipulate vectors and matrices. You will learn how Sage can produce numerous kinds of plots and graphics. The book will demonstrate numerical methods in Sage, and explain how to use object-oriented programming to improve your code.

Sage Beginner's Guide will give you the tools you need to unlock the full potential of Sage for simplifying and automating mathematical computing.

Effectively use Sage to eliminate tedious algebra, speed up numerical calculations, implement algorithms and data structures, and illustrate your work with publication-quality plots and graphics

1. Sage
1. Sage
2. Credits
5. www.PacktPub.com
1. Support files, eBooks, discount offers and more
6. Preface
1. What this book covers
2. What you need for this book
3. Who this book is for
4. Conventions
5. Time for action - heading
7. Customer support
7. 1. What Can You Do with Sage?
1. Getting started
2. Using Sage as a powerful calculator
4. A practical example: analysing experimental data
5. Time for action - fitting the standard curve
6. Time for action - plotting experimental data
7. Time for action - fitting a growth model
8. Summary
8. 2. Installing Sage
1. Before you begin
2. Installing a binary version of Sage on Windows
3. Installing a binary version of Sage on OS X
4. Installing a binary version of Sage on GNU/Linux
5. Building Sage from source
6. Summary
9. 3. Getting Started with Sage
1. How to get help with Sage
2. Starting Sage from the command line
3. Using the interactive shell
4. Time for action - doing calculations on the command line
5. Using the notebook interface
6. Time for action - doing calculations with the notebook interface
7. Displaying results of calculations
8. Operators and variables
1. Arithmetic operators
2. Pop quiz - working with operators
3. Numerical types
4. Pop quiz - understanding types
5. Strings
9. Time for action - using strings
10. Callable symbolic expressions
11. Time for action - defining callable symbolic expressions
12. Functions
13. Time for action - calling functions
1. What just happened?
2. Have a go hero - make some more plots
3. Built-in functions
14. Time for action - defining and using your own functions
15. Time for action - defining a function with keyword arguments
16. Objects
17. Time for action - working with objects
18. Summary
10. 4. Introducing Python and Sage
1. Python 2 and Python 3
2. Writing code for Sage
3. Sequence types: lists, tuples, and strings
4. Time for action - creating lists
5. Time for action - accessing items in a list
6. Time for action - returning multiple values from a function
7. Time for action - working with strings
8. For loops
9. Time for action - iterating over lists
10. Time for action - computing a solution to the diffusion equation
11. Time for action - using a list comprehension
12. While loops and text file I/O
13. Time for action - saving data in a text file
14. Time for action - reading data from a text file
15. If statements and conditional expressions
16. Storing data in a dictionary
17. Time for action - defining and accessing dictionaries
18. Lambda forms
19. Time for action - using lambda to create an anonymous function
20. Summary
11. 5. Vectors, Matrices, and Linear Algebra
1. Vectors and vector spaces
2. Time for action - working with vectors
3. Time for action - manipulating elements of vectors
4. Matrices and matrix spaces
5. Time for action - solving a system of linear equations
6. Time for action - accessing elements and parts of a matrix
7. Time for action - manipulating matrices
8. Time for action - matrix algebra
9. Time for action - trying other matrix methods
10. Time for action - computing eigenvalues and eigenvectors
11. Time for action - computing the QR factorization
12. Time for action - computing the singular value decomposition
13. An introduction to NumPy
14. Time for action - creating NumPy arrays
15. Time for action - working with NumPy arrays
16. Time for action - creating matrices in NumPy
17. Summary
12. 6. Plotting with Sage
1. Confusion alert: Sage plots and matplotlib
2. Plotting in two dimensions
3. Time for action - plotting symbolic expressions
4. Time for action - plotting a function with a pole
5. Time for action - plotting a parametric function
6. Time for action - making a polar plot
7. Time for action - plotting a vector field
8. Time for action - making a scatter plot
9. Time for action - plotting a list
10. Time for action - plotting with graphics primitives
11. Using matplotlib
12. Time for action - plotting functions with matplotlib
13. Time for action - getting the matplotlib figure object
14. Time for action - improving polar plots
15. Time for action - making a bar chart
16. Time for action - making a pie chart
17. Time for action - plotting a histogram
18. Plotting in three dimensions
19. Time for action - make an interactive 3D plot
20. Time for action - parametric plots in 3D
21. Time for action - making some contour plots
22. Summary
13. 7. Making Symbolic Mathematics Easy
1. Using the notebook interface
2. Defining symbolic expressions
3. Time for action - defining callable symbolic expressions
4. Time for action - defining relational expressions
5. Time for action - relational expressions with assumptions
6. Manipulating expressions
7. Time for action - manipulating expressions
8. Time for action - working with rational functions
9. Time for action - substituting symbols in expressions
10. Time for action - expanding and factoring polynomials
11. Time for action - manipulating trigonometric expressions
12. Time for action - simplifying expressions
13. Solving equations and finding roots
14. Time for action - solving equations
15. Time for action - finding roots
16. Differential and integral calculus
17. Time for action - calculating limits
18. Time for action - calculating derivatives
19. Time for action - calculating integrals
20. Series and summations
21. Time for action - computing sums of series
22. Time for action - finding Taylor series
23. Laplace transforms
24. Time for action - computing Laplace transforms
25. Solving ordinary differential equations
26. Time for action - solving an ordinary differential equation
27. Summary
14. 8. Solving Problems Numerically
1. Sage and NumPy
2. Solving equations and finding roots numerically
3. Time for action - finding roots of a polynomial
4. Finding minima and maxima of functions
5. Time for action - minimizing a function of one variable
6. Time for action - minimizing a function of several variables
7. Numerical approximation of derivatives
8. Time for action - approximating derivatives with differences
9. Time for action - computing gradients
10. Numerical integration
11. Time for action - numerical integration
12. Time for action - numerical integration with NumPy
13. Discrete Fourier transforms
14. Time for action - computing discrete Fourier transforms
15. Time for action - plotting window functions
16. Solving ordinary differential equations
17. Time for action - solving a first-order ODE
18. Time for action - solving a higher-order ODE
19. Time for action - alternative method of solving a system of ODEs
20. Numerical optimization
21. Time for action - linear programming
22. Time for action - least squares fitting
23. Time for action - a constrained optimization problem
24. Probability
25. Time for action - accessing probability distribution functions
26. Summary
15. 9. Learning Advanced Python Programming
1. How to write good software
2. Object-oriented programming
3. Time for action - defining a class that represents a tank
4. Time for action - making the tanks move
5. Time for action - creating your first module
6. Time for action - creating a vehicle base class
7. Time for action - creating a combat simulation package
8. Potential pitfalls when working with classes and instances
9. Time for action - using class and instance attributes
10. Time for action - more about class and instance attributes
11. Time for action - creating empty classes and functions
12. Handling errors gracefully
13. Time for action - raising and handling exceptions
14. Time for action - creating custom exception types
15. Unit testing
16. Time for action - creating unit tests for the Tank class
17. Summary
16. 10. Where to go from here
1. Typesetting equations with LaTeX
2. Time for action - PDF output from the notebook interface
3. Time for action - working with LaTeX markup in the notebook interface
4. Time for action - putting it all together
5. Speeding up execution
6. Time for action - detecting collisions between spheres
7. Time for action - detecting collisions: command-line version
8. Time for action - faster collision detection
9. Time for action - using NumPy
10. Time for action - optimizing collision detection with Cython
11. Calling Sage from Python
12. Time for action - calling Sage from a Python script
13. Introducing Python decorators
14. Time for action - introducing the Python decorator
15. Making interactive graphics
16. Time for action - making interactive controls
17. Time for action - an interactive example
18. Summary