← Learning Library

GNU Octave · Math & Physics Lab

Euler, Gauss, Nash & Hilbert — an Octave compendium

A catalog of every .m script in this folder: number theory, curvature, Fourier & Hilbert space, game theory, quantum mechanics, and a few unclassifiable detours through DNA and water molecules. All scripts target GNU Octave 7+ with no toolboxes.

65 top-level scripts 3 packaged bundles 9 themes
All Euler's Number Basel · Zeta · Riemann Number Theory Gauss Curvature & Geometry Hilbert & Fourier Game Theory Physics Chemistry & Biology

No files match that search.

Euler's Number & Identity

7 files

e, e^{iθ}, and the unit circle as a complex exponential.

euler.m

Euler's Identity e^(iπ) + 1 = 0, computed via exp() and checked against machine epsilon.

identity
euler2.m

Approximates e via the compound-interest limit and the factorial series; verifies Euler's formula.

approximation
euler_complex.m

Identical content to euler2.m — e via compound interest and the factorial series.

≈ euler2.m
euler_exponent.m

Verifies Euler's formula numerically: the unit circle traced by e^{iθ}.

visualization
euler_helix.m

3D helix visualization of e^{iθ}, stacking the complex exponential along time.

visualization 3D
euler_trig_identities.m

Derives angle-addition trig identities (cos/sin of α+β) directly from Euler's formula.

trigonometry
circle_add.m

The unit circle as an algebraic group: points (cos θ, sin θ) with angle addition as the group law.

algebra

Basel Problem, Zeta & Riemann

6 files

From ∑1/n² to Euler products to the still-open Riemann Hypothesis.

euler3.m

Partial sums of the Basel series ∑1/n², plotted converging toward π²/6.

series
euler_identity_basel.m

Combined demo: Euler's identity on the unit circle, the Basel problem, and the e series.

identity series
zeta_basel.m

Basel sum, Euler product, ζ(2), ζ(4), the ζ(−1)=−1/12 regularization, Casimir energy, and π(x)~x/log x.

zeta function bundle
rh3.m

Riemann Hypothesis overview and numerical exploration of non-trivial zeta zeros.

open problem
rheman_hypothesis.m

A more heavily-documented outline script covering the same Riemann Hypothesis ground as rh3.m.

open problem ≈ rh3.m

Number Theory & Modular Arithmetic

13 files

Totients, congruences, Gaussian integers, graphs, and cryptography.

euler4.m

Königsberg's bridges as an adjacency matrix; checks for an Eulerian circuit or trail.

graph theory
euler5.m

Congruence basics: mod arithmetic, a multiplication table mod 7, and a powermod helper.

congruence
euler_quad.m

Identical content to euler5.m — congruence basics and the mod-7 multiplication table.

≈ euler5.m
totient.m

Congruence warm-up followed by a from-first-principles implementation of Euler's totient function.

totient
totient_naive.m

Totient by brute-force gcd counting vs. Euler's product formula, side by side.

totient
phi_euler.m

φ(n): counts 1≤k≤n with gcd(k,n)=1. Example: phi_euler(12) → 4.

totient
eulers_totient_lab.m

A full worked lab on Euler's totient function φ(n), built out step by step.

totient lab
modular_clock.m

Visualizes multiples of a (mod m) as clock arithmetic. Example: modular_clock(7,12,20).

congruence visualization
konigsberg_check.m

General Eulerian-trail condition check from vertex degrees (the Königsberg bridges, formalized).

graph theory
gaussian_integers.m

Explores ℤ[i]: norm N(a+bi)=a²+b², and the Gaussian-prime test.

Gaussian integers
gauss_crypto.m

Totient, Euler's theorem, modular inverse via extended Euclid, fast modpow, toy RSA, and Diffie–Hellman.

cryptography
imaginarynumbers1.m

Gaussian-integer arithmetic representing a+bi as [a, b] pairs.

Gaussian integers

Gauss — Statistics, Fitting & Signals

4 files
gauss_fit.m

Least-squares line fit y = mx + b (Gauss, 1809), with residual plots.

regression
gaussian_bell.m

Plots the normal distribution and shades the 68-95-99.7 rule.

statistics
gauss_elimination.m

Fits a parabola through three observed points — the shape of a projectile, or Ceres' apparent path.

linear algebra
gauss_exponents.m

A signal with two hidden tones plus noise; shows the DFT as a matrix of Euler's formula.

signal processing

Curvature & Geometry

5 files
curvature_demo.m

Gaussian curvature K for a paraboloid z = ax²+by² (Theorema Egregium). Example: curvature_demo(1,1).

differential geometry
curvature_strings.m

Gaussian curvature, saddle vs. sphere, string vibration modes, and a note on Calabi–Yau Ricci-flatness.

differential geometry bundle
hilbert_curve_zeta.m

Space-filling curve plus a note linking it to cardinality and Hilbert-space completeness.

fractal bundle
nash_embedding_demo.m

Nash–Kuiper embedding: corrugation that preserves length.

differential geometry

Hilbert Space, Fourier & Spectral

6 files
hilbert_hotel.m

Bijections for Hilbert's infinite hotel: n→n+1, n→2n, and Cantor pairing.

set theory
gram_schmidt_hilbert.m

Modified Gram–Schmidt: builds an orthonormal basis of a Hilbert space ℝⁿ.

linear algebra
spectral_hilbert_demo.m

2×2 symmetric eigen-decomposition as ellipse axes, plus the Hilbert matrix's condition-number explosion.

spectral theory
fourier_machinery.m

Fourier series synthesis, FFT spectrum, Parseval's identity, and the Gibbs phenomenon.

Fourier bundle
variational_demo.m

The catenary as the curve minimizing potential energy, via the Euler–Lagrange equation.

calculus of variations

Game Theory (Nash)

5 files
nash_2x2.m

Pure and mixed Nash equilibria for a 2×2 bimatrix game.

equilibrium
best_response_plot.m

Plots expected payoffs vs. mixed strategies to visualize best-response curves.

equilibrium
nash_bargaining.m

Nash bargaining solution: maximizes (u1−d1)(u2−d2) over a convex polygon of feasible outcomes.

bargaining
cournot_nash.m

Cournot duopoly: solves for Nash equilibrium quantities.

equilibrium
nash_moser_newton.m

Nash–Moser: a smoothed, damped Newton's method compared against the plain version where derivatives lose regularity.

numerical methods

Physics — Waves, Circuits & Quantum

9 files
maxwell_circuits.m

EM plane waves e^{i(kx−ωt)}, the Helmholtz equation, RLC impedance Z=R+i(ωL−1/ωC), and resonance ω₀=1/√LC.

electromagnetism bundle
heisenberg.m

Matrix mechanics in ten lines: builds X and P for the harmonic oscillator and checks XP−PX ≈ i·I.

quantum mechanics
schrodinger_cat_middle.m

Schrödinger's cat as a wavepacket "sometimes in the middle," solved with Crank–Nicolson.

quantum mechanics
three_body_midpoint_demo.m

Applies the midpoint method to the three-body problem, linking two related numerical ideas.

mechanics numerical methods
three_body_schrodinger.m

Bridges the three-body problem with a Schrödinger-equation treatment.

mechanics quantum mechanics
euler_method.m

Solves an ODE y′=f(t,y) with the explicit Euler method. [t,y]=euler_method(f,t0,tf,y0,h).

numerical methods
euler_method copy.m

An earlier variant of the explicit Euler integrator with a different argument order.

numerical methods ≈ euler_method.m

Chemistry & Biology

3 files
dna_mathematics.m

The mathematics of DNA — base composition, GC content, and helical geometry.

biology
water_molecule.m

H₂O as a covalent molecule: 3D geometry, the ~104.5° bond angle, and animated normal modes.

chemistry animation

Packaged Bundles

The same scripts, re-grouped into self-contained folders with their own README — meant for standalone distribution alongside an HTML compendium.

Euler_Gauss_Octave_Bundle

11 scripts on totients, Euler's identity, the Basel sum, the Euler-product ζ(s), Königsberg, modular arithmetic, Gaussian integers, and curvature.

View README →

Nash_Hilbert_Octave_Bundle

12 scripts split into NASH (equilibria, bargaining, Cournot, embedding) and HILBERT (infinite hotel, Fourier, Gram–Schmidt, spectral theory, space-filling curves, catenaries).

View README →

Unified_Octave_Bundle

7 scripts tracing one throughline — Fourier → Maxwell → circuits, Gauss's totient → RSA cryptography, curvature → Calabi–Yau strings, and the Basel sum → ζ-regularization → string theory's D=26.

View README →

Notes