The jmax command line
One binary spans the whole scientific-computing surface: symbolic math, automatic differentiation, optimization, differential equations, linear algebra, signal processing, statistics, dataframes, and units. Every command below is real and runs today.
Evaluate & Run
jmax eval "<expr>" Evaluate an expression: scalars, matrices, vectors, symbolic, or composed numeric functions.
jmax eval "[[1,2],[3,4]] * [5,6]" → [17, 39] jmax run file.jmax Run a JMax source file and print its result.
jmax run fit_model.jmax jmax plot "<expr>" --from a --to b Plot expression(s) over an interval, or render the plot statements in a source file, to SVG.
jmax plot "sin(x)/x" --from -10 --to 10 jmax export … Export data and plots to various formats.
jmax export data.jmax --format csv Symbolic & Verification
jmax eval "expand((x+1)^2)" Computer-algebra: expand, simplify, differentiate, integrate, solve, all exact and canonical.
→ 1 + x^2 + 2*x jmax eval "integrate(x^2, x)" Rule-based symbolic integration; the inverse of differentiation.
→ x^3/3 jmax dsolve "<y′>" Solve an ODE symbolically: y' = f (first order), or a·y''+b·y'+c·y = 0.
jmax dsolve "-2*y" → y = C·e^(-2t) jmax verify "<lhs> == <rhs>" Prove an identity two ways: a sound CAS self-check, and an emitted Lean 4 theorem.
jmax verify "(x+1)^2 == x^2 + 2*x + 1" Autodiff
jmax grad "<f>" <point...> Gradient by reverse-mode automatic differentiation of the computation graph.
jmax grad "x^2*y + sin(x)" 1.3 0.7 jmax hessian "<f>" <point...> Full Hessian via second-order (forward-over-reverse) AD.
jmax hessian "x^2*y + sin(x)" 1.3 0.7 Optimization
jmax minimize "<f>" <x0...> Unconstrained minimization (gradient descent; --newton for the AD-Hessian Newton method).
jmax minimize "(1-x)^2 + 100*(y-x^2)^2" -1.2 1 --newton jmax fit "<model>" data.csv Levenberg-Marquardt curve fitting; Jacobian from AD.
jmax fit "a*exp(b*x)" data.csv --p0 1,0 jmax lsq "<r1>;<r2>;…" Nonlinear least squares: minimize ½Σrᵢ² over residual expressions (SciPy least_squares / MATLAB lsqnonlin).
jmax lsq "a+b-3; a-b-1" jmax lp file jmax qp file [--ineq] Linear programs (two-phase simplex) and quadratic programs (KKT / active-set).
jmax lp problem.txt → max cᵀx s.t. Ax ≤ b Roots & Nonlinear Systems
jmax root "<f>" <x0> Find a root of a single-variable expression by Newton's method (derivative via AD).
jmax root "cos(x) - x" 0.5 → 0.7390851 jmax fsolve "<e1>;<e2>;…" Solve a general nonlinear system (each eqn = 0) by damped Newton, SciPy's fsolve. Handles sin/exp/etc.
jmax fsolve "x^2+y^2-1; x-y" jmax solve-system "<e1>;<e2>" Solve a polynomial system exactly via Gröbner bases.
jmax solve-system "x^2+y^2-1; x-y" Differential Equations
jmax ode "<dy/dt>" y0 Integrate an ODE: adaptive Dormand-Prince RK45, or --stiff for an implicit solver with an AD Jacobian.
jmax ode "1000*(cos(t) - y)" 2 --tf 1 --stiff jmax bvp "<y″>" --ya . --yb . Two-point boundary value problem y″=f(x,y,y′) by shooting or collocation (MATLAB bvp4c / SciPy solve_bvp).
jmax bvp "-y" --a 0 --b 3.14159 --ya 0 --yb 0 jmax sde "<drift>" "<diff>" Integrate a stochastic ODE dX = drift·dt + diffusion·dW over many paths.
jmax sde "-x" "0.3" --x0 1 --paths 1000 Integration & Interpolation
jmax quad "<f>" from to Numerically integrate over an interval (adaptive Gauss-Kronrod); quad2/quad3 for double/triple integrals.
jmax quad "exp(-x^2)" -5 5 → 1.7724539 jmax interp data.txt --method spline Interpolate (x,y) samples (spline / linear / pchip / nearest) and plot the curve.
jmax interp pts.txt --method pchip jmax cheb "<f>" --op diff Chebyshev spectral methods: approximate | diff | integrate to spectral accuracy (chebfun-style).
jmax cheb "sin(x)" --op integrate Linear Algebra
jmax eig file jmax eigvals file Symmetric eigenvalues (Jacobi), and all real+complex eigenvalues of a general matrix (Hessenberg + Francis QR, LAPACK dgeev-class).
jmax eigvals A.txt → λ₁, λ₂ ± μi jmax svd file jmax geneig K M Singular values, and symmetric-definite generalized eigenvalues K·x = λ·M·x (modal analysis).
jmax geneig K.txt M.txt jmax linsolve A b jmax lusolve A b [--spd] Solve A·x=b iteratively, or by exact sparse-direct LU / LDLᵀ (Cholesky with --spd).
jmax lusolve A.txt b.txt --spd jmax rrqr file jmax det / rank / pinv Rank-revealing pivoted QR (Businger–Golub), determinant (LU), numerical rank (SVD), Moore-Penrose pseudoinverse.
jmax rrqr A.txt → numerical rank + R diagonal jmax expm A --t 1 jmax sqrtm / logm Matrix functions: exponential e^(A·t) (state-transition), principal square root, and logarithm.
jmax expm A.txt --t 0.5 Tensors & Low-Rank
jmax einsum "<spec>" A B … Einstein summation over matrix operands (NumPy einsum): matmul "ij,jk->ik", trace "ii->", transpose "ij->ji".
jmax einsum "ij,jk->ik" A.txt B.txt jmax lowrank file --k r Best rank-k approximation by truncated SVD (Eckart–Young); --report shows energy + compression.
jmax lowrank img.txt --k 20 --report jmax nmf file --rank r Non-negative matrix factorization A ≈ W·H (interpretable parts; topic models / unmixing).
jmax nmf counts.txt --rank 5 jmax eigs file --k r Extreme eigenvalues of a large symmetric sparse matrix by Lanczos (matvec-only), like SciPy eigsh / ARPACK.
jmax eigs L.txt --k 3 Signal & Time Series
jmax fft signal.txt jmax spectrogram signal Magnitude spectrum via FFT, and a short-time Fourier transform (per-frame spectra).
jmax spectrogram sig.txt --frame 16 --hop 8 jmax biquad signal jmax wavelet signal IIR biquad (RBJ) filtering, and a discrete wavelet transform for multiresolution energy or denoising.
jmax wavelet sig.txt --denoise jmax kalman meas.txt Kalman filter + RTS smoother: constant-velocity tracking from noisy measurements.
jmax kalman noisy.txt jmax forecast series.txt --model arima Time-series forecasting: fit AR / ARIMA / Holt-Winters and forecast ahead.
jmax forecast sales.txt --model holt-winters --h 12 Statistics
jmax stats file Summary statistics: n, mean, std, min, median, max.
jmax stats data.txt jmax sample <dist> <params> Deterministic sampling from Normal / Uniform / Exponential.
jmax sample normal 0 1 -n 5 --seed 42 jmax ttest a b jmax wilcoxon a b Welch two-sample t-test; Wilcoxon signed-rank (paired, nonparametric).
jmax ttest a.txt b.txt → t, p jmax anova g1 g2 … jmax friedman / levene One-way ANOVA, Friedman repeated-measures, and Levene’s variance-equality test.
jmax anova g1.txt g2.txt g3.txt → F, p Simulation: FEM & CFD
jmax heat / stress / modal 2-D FEM: steady heat conduction, cantilever elasticity (von Mises), and modal analysis; each writes a field SVG.
jmax stress --load 1000 → tip deflection + peak stress jmax heat3d / stress3d / modal3d Solid 3-D tetrahedral FEM: steady heat, cantilever stress, and modal analysis with isometric surface plots.
jmax modal3d --modes 6 jmax stokes jmax unsteady / lbm CFD: lid-driven cavity Stokes flow, transient Navier–Stokes spin-up, and a Lattice-Boltzmann (D2Q9) solver.
jmax lbm --case cavity --re 100 jmax topopt jmax thermo / inverse-design Topology optimization (SIMP + OC), thermo-mechanical coupling, and adjoint-gradient inverse design.
jmax topopt --volfrac 0.4 Operator Learning
jmax fno --op deriv Fourier Neural Operator demo: learn an operator (derivative / integrate / smooth) between function spaces.
jmax fno --op integrate Data & Visualization
jmax df file.csv [--groupby c] Inspect a CSV (shape, types, describe) or group-by aggregate; read/write real Parquet (Arrow-validated).
jmax df sales.csv --groupby city --value rev --agg sum jmax chart <kind> data.txt Publication-quality SVG charts: line | scatter | bar | histogram | density | heatmap | box.
jmax chart heatmap corr.txt jmax project data.txt jmax splom data.txt Project n-D data to 2-D (PCA / random) for plotting, or a brushable SPLOM-of-projections bundle.
jmax project iris.txt && jmax chart scatter embedding.txt jmax animate a.txt b.txt Animate a state-transition tween between two datasets: frame SVGs or an interactive WebGPU bundle.
jmax animate t0.txt t1.txt --frames 30 Units
jmax convert <v> <from> <to> Dimensional unit conversion with compound units and metric prefixes.
jmax convert 60 km/hour m/s → 16.667 m/s Library crates
The CLI is a thin shell over composable Rust crates. Pure Rust, no external BLAS or FFT library; the same code compiles to native and to WebAssembly.
jmax-symbolic Computer-algebra engine: canonical term algebra, diff, e-graph simplify, integrate, solve.
jmax-linalg Dense linear algebra: LU, Cholesky, QR (incl. rank-revealing), eigen (symmetric + general), SVD, matrix functions.
jmax-sparse Sparse matrices: CSR/CSC, iterative (CG/GMRES) and direct (LU / Cholesky) solvers, Lanczos eigensolver.
jmax-tensor N-dimensional tensors, einsum, and low-rank / NMF decompositions.
jmax-optim Unconstrained + nonlinear least squares (Levenberg-Marquardt), roots, and damped-Newton systems.
jmax-ode ODE / BVP / SDE integrators: RK45, implicit-stiff, shooting + collocation, stochastic paths.
jmax-quad Adaptive Gauss-Kronrod quadrature in 1-D / 2-D / 3-D.
jmax-interp Spline / pchip / linear interpolation and Chebyshev spectral methods.
jmax-fem Finite elements: 2-D/3-D heat, elasticity, modal, Stokes, topology optimization, adjoint inverse design.
jmax-dsp FFT/IFFT, windows, spectrogram, wavelets, FIR + IIR filtering, Kalman filtering, forecasting.
jmax-stat Distributions, RNG, and a parametric + nonparametric hypothesis-test suite.
jmax-frame Typed dataframes with CSV and real Parquet I/O, group-by, pivot, joins.
jmax-convex Linear, quadratic, and nonlinear constrained optimization.
jmax-viz Publication-quality SVG charts, projections, SPLOMs, and animation bundles.
jmax-verify Formal-verification bridge: emit Lean 4 from symbolic results.
jmax-units Dimensional analysis and unit conversion.