Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Sage Beginner's Guide
  • Table Of Contents Toc
Sage Beginner's Guide

Sage Beginner's Guide

By : Craig Finch
3.9 (11)
close
close
Sage Beginner's Guide

Sage Beginner's Guide

3.9 (11)
By: Craig Finch

Overview of this book

This is a beginner's guide with clear step-by-step instructions, explanations, and advice. Each concept is illustrated with a complete example that you can use as a starting point for your own work. If you are an engineer, scientist, mathematician, or student, this book is for you. To get the most from Sage by using the Python programming language, we'll give you the basics of the language to get you started. For this, it will be helpful if you have some experience with basic programming concepts.
Table of Contents (17 chapters)
close
close
Sage Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1
Index

Time for action – computing a solution to the diffusion equation


It's time for a more involved example that illustrates the use of for loops and lists in numerical computing. The analytical solution to a partial differential equation often includes a summation of an infinite series. In this example, we are going to write a short program that computes a solution to the diffusion equation in one dimension on a finite interval of length l. The diffusion equation is defined by:

The diffusion equation can be used to model physical problems such as the diffusion of heat in a solid, or the diffusion of molecules through a gas or liquid. The value of v(x,t) can represent the temperature or concentration at a point x and time t. The value of v is fixed at each end of the interval:

The initial condition is that v is equal to an arbitrary function f(x):

The solution to this boundary value problem can be found in a textbook such as The Conduction of Heat in Solids by H. S. Carslaw and J. C. Jaeger:

This...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Sage Beginner's Guide
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon