Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
All published worksheets from http://sagenb.org
Image: ubuntu2004
ACCA
Using Sage for Mathematical Modeling
Dan Warner
WWW.SAGEMATH.ORG
This session will provide a hands-on introduction to the basic capabilities of Sage as a tool for Mathematical Modeling
This will cover the bulk of the Maple and Mathematica capabilities that are used in Calculus and other undergraduate mathematics courses.
The real world problem
I have two sons. Let's call them Alex and Bob. One day I overhear the following conversation.
Bob, the younger son, said, "Give me one of your Star Wars action figures, and then we'll each have the same number."
Alex replied, "No, you give me one of yours, and I'll have twice as many as you."
I wonder how many action figures each of the boys have, and more importantly, at \$10 each, how much have I spent on this collection.
Intersecting a circle with a straight line.
Assume that the circle has radius 2 and is centered at (1,1).
Assume that the straight line passes through the points (0,-1/4) and (1/3,0).
Use the computer to display this nonlinear example and its solutions.

A nonlinear example
The following example by Jason Grout uses Sage to solve a system of three non-linear equations with 4 unknowns.
We will treat the variable as a parameter with a value of 1.
Sage does Calculus


A Piece of Experimental MAthematics
Let's start with a result by Archimedes, namely that
.
Archimedes used a very geometric approach involving inscribed and circumscribed polygons.
But today we might simply ask Sage, or any other modern Computer Algebra System (CAS), to evaluate the integral
Since the integrand is positive on the interval (0,1), the inequality immediately follows.
However, this may not be completely satisfactory until we look at the antiderivative.
Of course this approach not only depends on modern Computer Algebra Systems. It also depends on the mathematical edifice of Trigonometry and Calculus that led to the wonderful relation
Illustrating Partial Derivatives
3-Dimensional Plots
Sage can draw 3d plots:
Sage can plot Yoda:
Dynamical Systems Modeling
A Simple Growth Model
Rumor Model
Suppose that we have a somewhat isolated college town with a population of size, . At time a small number of people in the town learn of a rumor.
Let denote the number of people that know the rumor at time, .
The spread of the rumor depends on the number of possible interactions between those who know the rumor and those who don't. In this isolated college town the number of people who don't know the rumor at time is given by .
The possible number of interactions that result in the rumor being spread is some fraction of . Let's call that fraction .
Consequently, the rate of change of is given by which gives us the following differential equation.
We can also solve the differential equation numerically using a fourth order Runge-Kutta method.