- •Credits
- •About the Author
- •About the Reviewers
- •www.PacktPub.com
- •Preface
- •Getting started
- •More advanced graphics
- •Summary
- •Start Sage
- •Installing Sage
- •Starting Sage
- •Prerequisites
- •Installation
- •Summary
- •Command history
- •Working with code
- •Arithmetic operators
- •Strings
- •Functions
- •Functions with keyword arguments
- •Objects
- •Summary
- •Python 2 and Python 3
- •Running scripts
- •Strings
- •List comprehensions
- •Storing data in a dictionary
- •Summary
- •Vectors and vector spaces
- •Creating a vector space
- •Vector operators and methods
- •Decomposing matrices
- •Summary
- •Using graphics primitives
- •Summary
- •Substitutions
- •Finding roots
- •Derivatives
- •Integrals
- •Series and summations
- •Summary
- •Computing gradients
- •Constrained optimization
- •Probability
- •Summary
- •Making our tanks move
- •Unit testing
- •Summary
- •Introducing Python decorators
- •Making interactive graphics
- •Summary
- •Index
Sage
Beginner's Guide
Unlock the full potential of Sage for simplifying and automating mathematical computing
Craig Finch
BIRMINGHAM - MUMBAI
Sage
Beginner's Guide
Copyright © 2011 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: May 2011
Production Reference: 1250411
Published by Packt Publishing Ltd. 32 Lincoln Road
Olton
Birmingham, B27 6PA, UK.
ISBN 978-1-849514-46-0
www.packtpub.com
Cover Image by Ed Maclean (edmaclean@gmail.com)
Credits
Author |
Project Coordinator |
Craig Finch |
Joel Goveya |
Reviewers |
Proofreaders |
Dr. David Kirkby |
Aaron Nash |
Minh Nguyen |
Mario Cecere |
Acquisition Editor |
Graphics |
Usha Iyer |
Nilesh Mohite |
Development Editor |
Production Coordinator |
Hyacintha D'Souza |
Adline Swetha Jesuthas |
Technical Editor |
Cover Work |
Ajay Shanker |
Adline Swetha Jesuthas |
Indexers |
|
Tejal Daruwale |
|
Rekha Nair |
|
About the Author
Craig Finch is a Ph. D. Candidate in the Modeling and Simulation program at the University of Central Florida (UCF). He earned a Bachelor of Science degree from the University
of Illinois at Urbana-Champaign and a Master of Science degree from UCF, both in electrical engineering. Craig worked as a design engineer for TriQuint Semiconductor, and currently works as a research assistant in the Hybrid Systems Lab at the UCF NanoScience Technology Center. Craig's professional goal is to develop tools for computational science and engineering and use them to solve difficult problems. In particular, he is interested in developing tools to help biologists study living systems. Craig is committed to using,
developing, and promoting open-source software. He provides documentation and "how-to" examples on his blog at http://www.shocksolution.com.
I would like to thank my advisers, Dr. J. Hickman and Dr. Tom Clarke, for giving me the opportunity to pursue my doctorate. I would also like to thank my parents for buying the Apple IIGS computer that started it all.
About the Reviewers
Dr. David Kirkbyis a chartered engineer living in Essex, England. David has a B.Sc. in Electrical and Electronic Engineering, an M.Sc. in Microwaves and OptoElectronics, and a Ph.D. in Medical Physics. Despite David's Ph.D. being in Medical Physics, it was primarily an engineering project, measuring the optical properties of human tissue, with a mixture of Monte Carlo modeling, radio frequency design, and laser optics. David was awarded his Ph.D. in 1999 from University College London.
Although not a mathematician, Dr. Kirkby has made extensive use of mathematical software. Most of his experience has been with MathematicaTM from Wolfram Research, although he has used both MATLABTM and SimulinkTM too.
David is the author of a number of open-source projects, including software for modeling transmission lines using finite difference (http://atlc.sourceforge.net/), design of Yagi-Uda antennas (http://www.g8wrb.org/yagi/) which can use a genetic algorithm for optimization, as well as software for data collection and analysis from electronic test equipment. David once wrote a web-based interface to MathematicaTM (http://witm. sourceforge.net/) which allows MathematicaTM to be used from a personal computer, PDA or smartphone.
Soon after the Sage project was started by Professor William Stein, Dr. Kirkby joined the development of Sage. He primarily worked on the successful port of Sage to the Solaris and OpenSolaris operating systems and encourages other developers to write portable code, conforming to POSIX standard, avoiding GNUisms.
Professionally, David's skill sets include computer modeling, radio frequency design, analogue circuit design, electromagnetic compatibility and optics—both free space and integrated. David has also been a Solaris system administrator for the University of Washington where the Sage project is based.
When not working on writing software, David enjoys playing chess, gardening, and spending time with his wife Lin and dog Smudge.
Readers wishing to contact Dr. Kirkby can do so via his website http://www.drkirkby. co.uk/ where details of his consulting services may be found.
MinhNguyenhasbeenacontributortotheSageprojectsinceDecember2007.Overthe years,hehasworkedonvariousaspectsofSagerangingfromthestandarddocumentationand modulessuchascryptography,numbertheory,andgraphtheorytotheSagebuildsystem.He regularlymaintainstheSagewebsiteandworksonbookprojectsthataimtoprovidein-depth documentationonusingSagetostudycryptographyandmathematics.Moreofhisrantings canbefoundathttp://mvngu.wordpress.com.