CMNA Laboratory

The mathematics should move.

Read the method, inspect the R implementation, replace the textbook example with your own problem, and then watch the algorithm explain itself.

Actual R

The R Workbench has no training wheels.

If the guided laboratories are too polite, open the workbench and run arbitrary valid R directly in the browser with selected CMNA functions already loaded.

Open the R Workbench
Root finding

Bisection

Supply an arbitrary R function, establish a bracket, and play every interval-halving step.

Open laboratory →
Root finding

Newton's method

Supply f and f' in R, then play tangent lines as their x-intercepts become the next guesses.

Open laboratory →
Root finding

Secant method

Supply only f, then watch successive chords estimate the slope and generate new root approximations.

Open laboratory →
Root finding

Bisection vs. Newton vs. Secant

Run three root finders against the same problem and compare convergence by residual.

Open laboratory →
Interpolation

Polynomial, linear, and spline interpolation

Paste x and y vectors into R, then sweep across three interpolants built from exactly the same data.

Open laboratory →
Differentiation

Finite differences

Supply an arbitrary R function, shrink h, and watch forward and symmetric secants approach the derivative.

Open laboratory →
Integration

Gauss-Legendre quadrature

Watch specially chosen nodes and weights replace a uniform partition with strategic function evaluations.

Open laboratory →
Integration

Monte Carlo integration

Let R draw random samples and play the noisy running estimate as the sample size grows.

Open laboratory →
Integration

Simpson's rule

Give R your own integrand and watch quadratic panels accumulate into a numerical integral.

Open laboratory →
Linear algebra

Jacobi vs. Gauss-Seidel

Paste your own matrix and watch two iterative solvers drive the residual toward zero.

Open laboratory →
Partial differential equations

Heat equation

Define the initial temperature in R, then play FTCS diffusion through time and inspect the space-time heatmap.

Open laboratory →
Partial differential equations

Wave equation

Define an initial displacement in R, then play the finite-difference wave through time and stress the Courant limit.

Open laboratory →
Differential equations

Euler, midpoint, and RK4

Define an arbitrary ODE and play through the four internal slopes of every Runge-Kutta step.

Open laboratory →
Optimization

Golden-section search

Supply a one-dimensional R objective and watch the search interval shrink around a minimum or maximum.

Open laboratory →
Optimization

Gradient descent

Define a two-dimensional objective and gradient in R, then watch the path move across the sampled landscape.

Open laboratory →
Optimization

Simulated annealing

Let R propose, accept, reject, cool, and remember the best point while wandering across your objective surface.

Open laboratory →

Experiment portability

Share it, export it, or take the source apart.

Every guided laboratory now carries the current experiment with it. The controls can be encoded into a shareable URL, exported as an R script, or opened directly in the unrestricted R Workbench. A source drawer pulls the canonical package implementation alongside the experiment.

There is also a print-friendly prediction worksheet for each laboratory. The order is intentional: predict first, run second, explain third.

The Numerical Zoo supplies worked problems worth using more than once.

The pattern

One architecture, different numerical ideas.

The browser interface changes with the mathematics. Bisection gets a shrinking bracket. Simpson gets quadratic panels. Iterative linear algebra gets residual histories. RK4 exposes its internal slope samples. Gradient descent draws a path across an objective surface.

What stays constant is the important part: R performs the numerical work, while JavaScript turns the intermediate state into something visible and playable.