## Interactive Graphs

Click on the following links to open an interactive graph.

The M&M Experiment

• This is a simulator for the M&M population experiment. Instead of M&Ms that can be up or down we have a row of boxes that can contain a 0 or 1. M&M down is a 0, M&M up is a 1.
• The experiment starts with an initial number boxes all in 1 except the first box, which counts how many 1 we have in that row.
• The second row is constructed from the first by randomly choosing between 0 or 1. Again, the first box counts how many 1 we got.
• The third row is constructed from the second, if we had a box with a 0, it remains a 0. If we had a 1, we randomly choose a between 0 or 1. As before, the first box counts the number of 1 in that row.
• We keep going in this way till we have a number of rows given by the constant in Trials.
• We can also add a fix number of boxes on each round, we call these added boxes the immigrants.

Finally, we can generalize the M&M experiment by changing the mortality coefficient from 50% to any percent from 0 to 100.

• The simulation has one button and four slider:
• The button Run runs the simulation with the chosen parameters.
• The slider Initial fixes the initial amount of M&Ms. Default Initial = 30
• The slider Imm fixes the number of immigrants M&M added on every trial. Default Imm = 0
• The slider Trials sets the number of rounds we have in the simulation. Default Trials = 10
• The slider Mortality sets the mortality percent. Default Mortality = 50%

We also can plot the first column with the counts of boxes with 1.

Going Viral

This is a simulator of a viral infection spreading in a population with the following rules:

• The total population where the virus can spread is fixed at 100.
• Each person in the population has a fixed Identification Number in the interval $$[1,100]$$.
• At day zero there is only one person infected.
• Each day, each infected person pass the virus to only one, random, person in the population.
• Infected persons remain always infected.
• Nobody dies.
Direction Field

We plot the direction field for the differential equation $$y’ = \sin(y)$$. For the segments you can change:

• The width.
• The length.
• The $$x$$ separation and density.
• The $$y$$ separation and density.
Picard Iteration vs Taylor Expansion: Linear Equations - Explicit Solution
MathStudio Link: Picard Iteration vs Taylor Expansion: Linear Equations.

• We graph in purple the functions $$y(t)$$ solutions of the initial value problem
$y^{\prime}(t) = 2 \,y(t) +3, \qquad y(0) = 1.$
• The slider Function turns on-off the graph of the solution $$y(t)$$.
• We graph in blue approximate solutions $$y_n$$ of the differential equation constructed with the Picard iteration up to order $$n=10$$. The slider Picard_App_Blue turns on-off the Picard approximate solution.
• We graph in green the $$n$$-order Taylor expansion centered $$t=0$$ of the solution of the differential equation up to order $$n=10$$. The slider Taylor_App_Green turns on-off the Taylor approximation of the solution.

We conclude that the Picard iteration is identical as the Taylor expansion for solutions of the linear differential equation above.

Picard Iteration vs Taylor Expansion: Non-Linear Equations - Explicit Solution
MathStudio Link: Picard Iteration vs Taylor Expansion: Non-Linear Equations – Explicit Solution.

• We graph in purple the functions $$y(t)$$ solutions of the initial value problem
$y^{\prime}(t) = y^2(t), \qquad y(0) = -1.$
• The slider Function turns on-off the graph of the solution $$y(t)$$.
• We graph in blue approximate solutions $$y_n$$ of the differential equation constructed with the Picard iteration up to order $$n=5$$. The slider Picard_App_Blue turns on-off the Picard approximate solution.
• We graph in green the $$n$$-order Taylor expansion centered $$t=0$$ of the solution of the differential equation up to order $$n=5$$. The slider Taylor_App_Green turns on-off the Taylor approximation of the solution.

We conclude that the Picard iteration is a different and better approximation than the Taylor expansion for solutions of the non-linear differential equation above.

Picard Iteration vs Taylor Expansion: Non-Linear Equations - No Explicit Solution
MathStudio Link: Picard Iteration vs Taylor Expansion: Non-Linear Equations – No Explicit Solution.

• In this second example we study approximate solutions of the initial value problem
$y^{\prime}(t) = y^2(t) + t, \qquad y(0) = -1.$
• In this case we do not have an explicit expression for the solution $$y(t)$$.  We only have the approximate solutions.
• We graph in blue approximate solutions $$y_n$$ of the differential equation constructed with the Picard iteration up to order $$n=5$$. The slider Picard_App_Blue turns on-off the Picard approximate solution.
• We graph in green the $$n$$-order Taylor expansion centered $$t=0$$ of the solution of the differential equation up to order $$n=5$$. The slider Taylor_App_Green turns on-off the Taylor approximation of the solution.

We conclude, one more time, that the Picard iteration is a different (hopefully better) approximation than the Taylor expansion for solutions of the non-linear differential equation above.

Beating and Resonance
MathStudio Link: Beating and Resonance on an LC-series Circuit.

• An LC-series circuit with a voltage source is described by Krichhoff equation
$L \, I'(t) + \frac{1}{C} \int I(t)\, dt = V(t).$
• Consider the case that $$V(t) = L \sin(\omega t)$$. In this case, computing one time derivative and dividing by $$L$$ we get
$I” + \omega_0^2 I = \omega \cos(\omega t).$ where $$\displaystyle\omega^2 = \frac{1}{\sqrt{LC}}$$. The solution with initial conditions $$I(0)=0$$ and $$I'(0)=0$$ is
$I(t) = \frac{t}{2}\,\sin(\omega t).$
• Consider the case that $$V(t) = L \sin(\nu t)$$. In this case, computing one time derivative and dividing by $$L$$ we get
$I” + \omega_0^2 I = \nu \cos(\nu t).$ where $$\displaystyle\omega^2 = \frac{1}{\sqrt{LC}}$$. The solution with initial conditions $$I(0)=0$$ and $$I'(0)=0$$ is
$\tilde I(t) = \frac{\nu}{(\omega^2-\nu^2)}\bigl( \cos(\nu t)-\cos(\omega t) \bigr)$
• Click on the interactive graph link here to see how the function changes when $$\nu \to \omega_0$$, exhibiting the beating phenomenon.
Dirac Delta Sequences

We show a few different sequence of functions that have the same Dirac’s delta as their limit. The sequences are:

• In red: $$\displaystyle\Bigl. \delta_n(t) = n \,\bigl(u(t) – u(t- \frac{1}{n})\bigr)$$.
• In blue: $$\displaystyle\Bigl.\delta_n(t) = \frac{n}{2} \,\bigl(u(t+\frac{1}{n}) – u(t-\frac{1}{n})\bigr)$$.
• In green: $$\displaystyle\Bigl.\delta_n(t) = \sqrt{\frac{n}{\pi}} \, e^{-n^2 t^2}$$.
• In purple: $$\displaystyle\Bigl.\delta_n(t) = \frac{1}{\pi} \frac{n}{(1 + n^2 t^2)}$$.
• In gray: $$\displaystyle\Bigl.\delta_n(t) = \frac{\sin(n t)}{\pi \,t}$$.
Convolution Graphs
Convolution Graphs.
We compute the convolution of the functions $$f$$ and $$g$$,
$(f*g)(t) = \int_0^t f(\tau) \,g(t-\tau)\, d\tau,$ and we plot $$f$$ in blue, $$g$$ in green, and $$f*g$$ in red.

We see that the convolution is a measure of (although not equal to) the area of the overlap of the two functions, $$f$$ and $$g$$, which is shown in gray.

• MathStudio Link: Convolution: Example 1 (Slow).
In this graph we choose
$f(x) = u(x) -u(x-1), \qquad g(x) = u(x) -u(x-1).$
• MathStudio Link: Convolution: Example 2.
In this graph we choose
$f(x) = u(x) \, e^{-x}, \qquad g(x) = u(x) \sin(x).$
• MathStudio Link: Convolution, Example 3. (Slow).
In this first graph we choose
$f(x) = u(x) -u(x-1), \qquad g(x) = 2\,u(x) \, e^{-x}.$
Linear Pendulum
Predator-Prey System
Predator-Prey System: Finite Food
Infectious Disease Models (SIR)
Eigenvectors
2x2 Systems of Linear Differential Equations: Real Eigenvectors
2x2 Systems of Linear Differential Equations: Complex Eigenvectors
The Nonlinear Pendulum
Competing Species: Extinction
Competing Species: Coexistence
BVP and Eigenfunctions

In the first picture we show the solution to the BVP
$y”+ \pi^2 y =0, \qquad y(0)=1, \quad y(1)=-1$ This BVP has infinitely many solutions, given by
$y(x) = \cos(\pi x) + k \sin(\pi x), \qquad k\in \mathbb{R}.$

• We plot the fundamental solution $$y_1(x)= \cos(\pi x)$$ in red.
• We plot the fundamental solution $$y_2(x)= \sin(\pi x)$$ in red.
• We plot the solution $$y_k(x) = k \sin(\pi x)$$ in purple.
• We plot the solution $$y(x) = \cos(\pi x) + k\sin(\pi x)$$ in blue.

In the second picture we plot the function
$y_n(x) = \sin(n\pi x), \qquad n\in \mathbb{R}.$ In the case that $$n$$ is an integer, these functions are eigenfunctions solutions
$y” + \lambda y =0, \qquad y(0)=0, \quad y(1)=0.$ In this problem the eigenvalues are $$\lambda_n = (n\pi)^2$$ for $$n = 1, 2, 3, \cdots$$, and the eigenfunctions are the functions $$y_n$$ above for $$n=1,2,3,\cdots$$.

Fourier Series
Cosine and Sine Series of Even and Odd Extensions
The Heat Equation: Dirichlet BC
The Heat Equation: Neumann BC