The browser-native computational notebook for matrix math, curve fitting, and machine learning
ForgeCurves: The browser-native computational notebook for matrix math, curve fitting, and machine learning.
Comprehensive reference manual for GNU Octave syntax, high-performance DataFrames, linear algebra invariants, heterogeneous I/O, nonlinear optimization, machine learning model cards, and platform architecture comparisons.
ForgeCurves is the browser-native computational notebook for matrix math, curve fitting, and machine learning. Modeled after JupyterLite and modern IDEs, it enables engineers, students, and researchers to execute linear algebra and algorithms directly inside browser tabs without local installs, compilers, or server sidecars.
Evaluates numerical operations, loops, and scripts client-side with Rust WASM SIMD128 vectorization in a background worker.
Intercepts plot(), stem(), and mesh() calls to generate vector graphics with custom line styles and zoom.
Exports entire notebook libraries with SHA-256 canonical hashing and HMAC signatures with transparent multi-part chunking.
ForgeCurves fully supports standard MATLAB and GNU Octave linear algebra conventions:
A = [1, 2, 3; 4, 5, 6; 7, 8, 9]; % 3x3 matrix v = 1:2:10; % Range vector [1, 3, 5, 7, 9] sub = A(1:2, 2:3); % Submatrix slicing row_sum = sum(A, 2); % Sum across rows
A = [4, 1; 2, 3]; b = [1; 2]; x = A \ b; % Left matrix division (Solve Ax = b) d = det(A); % Determinant [V, D] = eig(A); % Eigenvalues & Eigenvectors [U, S, V] = svd(A); % Singular Value Decomposition
Data Science & Data Analysis Support (Introduced in v1.2.0): ForgeCurves delivers a comprehensive, unified data science stack designed specifically to bridge high-throughput tabular data manipulation with dense linear algebra and nonlinear numerical solvers without memory copying or impedance mismatches.
Contiguous Float64Array columnar buffers with zero-copy vector projection df.Col, in-place dot deletion df.Col = [], coordinate assignment, and isna masking.
Rank, null space, orthogonal basis, condition numbers (cond, rcond), polynomial deconvolution (deconv), bivariate moments (cov, corrcoef), Bessel functions, and complex Fourier analysis.
Offset delimited I/O (dlmread, csvwrite), formatted text extraction (textscan), binary byte packing (fwrite, fread, fseek), JSON (jsonencode), and Excel workbooks.
pkg load dataframe;
% Construct table from heterogeneous records
raw_data = {
"Sample", "GeneA", "GeneB", "Group";
"S1", 45.2, 12.8, 1;
"S2", 88.1, 14.2, 2;
"S3", 12.3, 89.4, 1
};
df = dataframe(raw_data(2:end, :), raw_data(1, :));
% 1. Dynamic projection to standard column vectors for matrix algebra
gene_a_vec = df.GeneA; % Returns dense Octave column vector [45.2; 88.1; 12.3]
norm_a = norm(gene_a_vec, 2); % Direct handoff to linear algebra engine
% 2. In-place column addition, cell update, and column deletion
df.Ratio = df.GeneA ./ df.GeneB; % Append computed column via dot assignment
df(2, "GeneA") = 92.5; % Coordinate indexed cell update
df.Group = []; % In-place column deletion
% 3. Missing value identification & filtering
na_mask = isna(df); % Boolean logical bitmask
df_clean = dropna(df); % Drop rows containing NA
summary_stats = summary(df); % Comprehensive column reduction (mean, std, min, max)
% Structural Invariants & Matrix Rank A = [1, 2, 3; 4, 5, 6; 7, 8, 9]; r = rank(A); % Matrix rank = 2 Z = null(A); % Orthonormal basis for null space Q = orth(A); % Orthonormal basis for range space c = cond(A); % 2-norm condition number % Polynomial Roots, Characteristic Polynomial & Deconvolution coeffs = poly([2; 1; -3]); % Recover coefficients from roots p_roots = roots(coeffs); % Solve roots from polynomial coefficients [q, r] = deconv([2, 7, 11, 4], [2, 1]); % Polynomial division: quotient & remainder % Complex Fourier Transform with Parseval Energy Conservation signal = [1, 2, 3, 4, 3, 2]; F = fft(signal); % Discrete complex Fourier transform recovered = ifft(F); % Inverse Fourier transform (energy conserved) % Special Mathematical Functions g = gamma(5.5); % Euler gamma function b = besselj(1, 2.5); % Bessel function of the first kind J_1(2.5) e = erfc(0.75); % Complementary error function
pkg load io;
% Delimited Matrix R/W with Custom Row & Column Offsets
dlmwrite("offsets.csv", [10, 20; 30, 40], "delimiter", ",", "roffset", 2, "coffset", 1);
M_read = dlmread("offsets.csv", ",", 2, 1);
% Formatted Heterogeneous Parsing with Header Lines
fid = fopen("experiment.tsv", "w");
fputs(fid, "# Experiment Results Table\n");
fputs(fid, "101\tAlpha\t45.2\t1\n102\tBeta\t12.8\t0\n");
fclose(fid);
fid = fopen("experiment.tsv", "r");
C = textscan(fid, "%d %s %f %d", "HeaderLines", 1);
fclose(fid);
% C{1}: IDs, C{2}: Names, C{3}: Values, C{4}: Status
% Binary Byte Packing & Direct Seeking
fid = fopen("archive.bin", "wb", "ieee-le");
fwrite(fid, uint32(0xCAFEBABE), "uint32");
fwrite(fid, single([1.1, 2.2, 3.3]), "single");
fclose(fid);
fid = fopen("archive.bin", "rb", "ieee-le");
magic = fread(fid, 1, "uint32=>uint32");
fseek(fid, 4, "bof"); % Direct byte offset seek
data = fread(fid, 3, "single=>single");
fclose(fid);
pkg load optim;
% 1. Quasi-Newton BFGS with Analytic Gradient passing via deal()
rosen = @(p) 100 * (p(2) - p(1)^2)^2 + (1 - p(1))^2;
grad_rosen = @(p) [-400*p(1)*(p(2) - p(1)^2) - 2*(1 - p(1)); 200*(p(2) - p(1)^2)];
obj_fn = @(p) deal(rosen(p), grad_rosen(p));
opt = optimset("GradObj", "on", "Display", "off");
[x_opt, fval] = fminunc(obj_fn, [-1.2; 1.0], opt);
% 2. Box-Constrained Minimization (nonlin_min)
quad_fn = @(p) (p(1) - 4)^2 + (p(2) + 2)^2;
settings = struct("lbound", [5; -1], "ubound", [10; 5]);
[p_box, f_box] = nonlin_min(quad_fn, [0; 0], settings);
% 3. Coupled System of Nonlinear Equations (fsolve)
sys_fn = @(x) [2*x(1) - x(2) - exp(-x(1)); -x(1) + 2*x(2) - exp(-x(2))];
[x_root, fval, exitflag] = fsolve(sys_fn, [0.0; 0.0]);
% 4. Quadratic Programming with Inequality & Equality Constraints (qp)
% Minimize 0.5 * x' * H * x + q' * x s.t. A_ineq * x <= b_ineq, lb <= x <= ub
H = [4, 1; 1, 2]; q = [-8; -6];
A_ineq = [1, 1]; b_ineq = 2.0;
[x_qp, obj_val, status] = qp([0; 0], H, q, [], [], [0; 0], [5; 5], -inf, A_ineq, b_ineq);
% 5. Numerical Differentiation Stencils (numgradient & numhessian)
surface_fn = @(p) 3*p(1)^2 + 2*p(1)*p(2) + p(2)^2 + 5*p(1) - 3*p(2);
g_eval = numgradient(surface_fn, [1.5; -2.0]);
H_eval = numhessian(surface_fn, [1.5; -2.0]);
Signal Processing & Dynamic Systems Support (Delivered in v1.3.0): ForgeCurves delivers high-throughput, client-side digital signal processing via its Rust WebAssembly acceleration engine (crates/octave-wasm-math/src/signal_kernels.rs) coupled with complete extended signal transforms and Computer-Aided Control System Design (CACSD). From windowed sinc design to minimax equiripple Remez exchange, classical analog prototypes, time-domain filtering, Welch spectral estimation, polyphase multirate resampling, second-order sections (freqz, impz, tf2sos, sosfilt), analytic Hilbert transforms, Type-II/III DCTs, and order-statistic median filtering, all routines run client-side in linear contiguous memory with zero server dependencies:
pkg load signal; % 1. Window-Based & Frequency Sampling FIR Filter Design (fir1 & fir2) b_lp = fir1(64, 0.35); % 64th-order Hamming windowed lowpass filter b_bp = fir1(64, [0.2, 0.5]); % Bandpass filter with normalized cutoffs [0.2, 0.5] f_grid = [0, 0.25, 0.35, 0.65, 0.75, 1.0]; m_grid = [0, 0.00, 1.00, 1.00, 0.00, 0.0]; b_arb = fir2(64, f_grid, m_grid); % Arbitrary shape frequency-sampling FIR (WASM IFFT accelerated) % 2. Optimal Least-Squares & Remez Equiripple Filter Design (firls & firpm) b_ls = firls(32, [0, 0.3, 0.45, 1.0], [1, 1, 0, 0]); % Linear-phase least-squares LP [n_est, fo, ao, w] = firpmord([0.3, 0.4], [1, 0], [0.05, 0.01]); % Parks-McClellan order estimation b_eq = firpm(n_est, fo, ao, w); % Equiripple Chebyshev Remez exchange filter % 3. Classical IIR Filter Synthesis (butter, cheby1, cheby2, ellip) [b_but, a_but] = butter(8, 0.40); % 8th-order Butterworth lowpass filter [b_ch1, a_ch1] = cheby1(8, 1.0, 0.40); % Chebyshev Type I with 1 dB passband ripple [b_ch2, a_ch2] = cheby2(8, 40.0, 0.40);% Chebyshev Type II with 40 dB stopband attenuation [b_elp, a_elp] = ellip(8, 1.0, 40.0, 0.40); % Elliptic (Cauer) equiripple filter % 4. Time-Domain Filtering & Zero-Phase Filtering (filter & filtfilt) x = randn(100000, 1); y_iir = filter(b_but, a_but, x); % Direct-Form II Transposed filter (12.68 M-samp/s) y_zp = filtfilt(b_but, a_but, x); % Zero-phase forward-backward filter % 5. Group Delay Analysis & Welch Spectral Estimation (grpdelay & pwelch) [gd, w] = grpdelay(b_but, a_but, 2048); % 2048-point group delay evaluation [Pxx, f] = pwelch(x, 1024, 512, 2048, 1000); % Welch averaged periodogram (104 runs/s) [Txy, f_sys] = tfestimate(x, y_iir, 1024, 512, 2048, 1000); % Transfer function estimate % 6. Multirate Rational Resampling & Polyphase Filtering (resample & upfirdn) y_resamp = resample(x, 3, 2); % Polyphase rational resampling (P=3, Q=2, 27.6 M-pts/s) y_poly = upfirdn(x, [1, 2, 1], 2, 1); % Combined polyphase upsample-filter-downsample % 7. RF Pulse Train Generation & Discrete Windowing (pulstran, kaiser, chebwin) t = 0:0.001:1; d = 0:0.1:0.9; y_pulse = pulstran(t, d, "gauspuls", 10e3, 0.5); % RF pulse train (29.5x speedup) w_kaiser = kaiser(1024, 5.0); % Kaiser window with shape factor beta=5 w_cheb = chebwin(1024, 80); % Dolph-Chebyshev window with 80 dB ripple
To help engineering teams, researchers, and educators choose the ideal computational environment for their workflows, the following matrix compares ForgeCurves against leading numerical software platforms across architectural foundation, performance characteristics, and licensing:
| Dimension | ForgeCurves Web Native | GNU Octave | MATLAB® (MathWorks) | Scilab (INRIA) | Python / JupyterLite |
|---|---|---|---|---|---|
| Runtime Environment | Browser-Native Web Worker with Rust WASM SIMD128 vectorization; zero server dependencies. | Native compiled C++/Fortran desktop executable or server CLI terminal. | Native compiled desktop application or server cloud backend (MATLAB Online). | Native compiled C/C++/Java desktop software with Xcos block simulator. | Browser-native WebAssembly via Pyodide (Python CPython WASM interpreter). |
| Installation & Footprint | Instant tab load (<2 MB initial gzip, zero local installation, no admin rights). | Multi-hundred MB native desktop install with local C/Fortran compilers. | Heavy desktop installation (>10 GB full installation) or cloud subscription. | ~300 MB desktop install requiring a local Java Runtime Environment (JRE). | Browser load with ~30+ MB Pyodide initial WASM/wheel downloads. |
| Language & Indexing | 1-based matrix indexing; full GNU Octave and MATLAB syntax compatibility. | 1-based matrix indexing; high MATLAB syntax compatibility. | 1-based matrix indexing; canonical MATLAB language specification. | 1-based matrix indexing; distinct syntax (%pi, %i, //, spec()). |
0-based indexing; Python language syntax with NumPy array slicing. |
| Tabular DataFrames | Arrow-backed columnar buffers; dynamic vector projection df.Col; dot deletion; isna filtering. |
Optional dataframe forge package; slower row-oriented cell arrays. |
Native table & timetable types; column vector slicing; missing data filtering. |
Basic struct or hypermat; lacks native relational DataFrame engine. |
Native pandas.DataFrame / polars.DataFrame with relational verbs. |
| Linear Algebra & Invariants | SIMD128 accelerated lu, qr, chol, svd, eig, pinv, sparse linear solves. |
Native LAPACK & BLAS / SuiteSparse integration. | Proprietary Intel MKL / LAPACK accelerated BLAS & LAPACK. | Native LAPACK & BLAS linear algebra library. | NumPy / SciPy wrapping OpenBLAS or Pyodide WASM LAPACK. |
| Nonlinear Optimization | Native fminunc (BFGS with deal), fminsearch, fminbnd, nonlin_min, fsolve, qp. |
Core routines (fminbnd, fminsearch) + optional optim forge package. |
Comprehensive commercial Optimization Toolbox (fminunc, fmincon, quadprog). |
Built-in optim, fminsearch, karmarkar, bvode solvers. |
scipy.optimize (minimize, root, curve_fit, linprog). |
| I/O & Heterogeneous Data | Memory-buffered virtual FS (fopen, fwrite, fread, fseek, textscan, jsonencode, xlsread). |
Direct OS filesystem access; full C-standard stream I/O and text parsing. | Direct OS filesystem access; extensive file format engines (readtable, parquetread). |
Direct OS filesystem access (mopen, mfprintf, csvRead, xmlRead). |
Python io, csv, json, openpyxl, pyarrow file engines. |
| Diagnostics & Plotting | Crisp inline vector SVG plots (plot, mesh, plotconfusion, plotroc, plotperform). |
Gnuplot / FLTK / Qt desktop interactive window plotting. | Proprietary HG2 desktop graphic system with interactive figures. | Native 2D/3D graphics engine (Scilab Graphic Objects). | Matplotlib / Plotly rendered as canvas or static PNG images. |
| Export & Interoperability | Zero-lock-in: exports standalone .m functions, standard ONNX graphs, and Jupyter .ipynb. |
Scripts .m require external desktop Octave runtime. |
Scripts .m require commercial MATLAB runtime or compiled deployment. |
Scripts .sci / .sce are incompatible with MATLAB/Octave syntax. |
Notebooks .ipynb requiring Python/Jupyter kernel infrastructure. |
| Licensing & Governance | Tiered SaaS (Free ad-supported tier with client-side execution; paid subscription tier with cloud workspace synchronization & server persistence for registered accounts). | GNU General Public License (GPLv3). | Commercial proprietary license; per-seat and toolbox pricing. | Open source (CeCILL License / GPL compatible). | Open Source (PSF / BSD / Apache 2.0). |
Machine Learning Support (Introduced in v1.1.0): Powered by a WebAssembly SIMD128 compute engine running in a dedicated background Web Worker, ForgeCurves executes full-pipeline tabular machine learning (pkg load statistics) and deep neural architectures (pkg load nnet) with non-blocking execution, interactive Model Card inspection, and zero-lock-in export:
pkg load statistics; % Train Support Vector Machine (Linear or RBF kernel) model = fitcsvm(X_train, y_train, 'KernelFunction', 'rbf'); y_pred = predict(model, X_test); % Diagnostic Plotting plotconfusion(y_test, y_pred); plotroc(y_test, y_scores); plotperform(model.history);
Interactive dialog visualizing hyperparameters, confusion matrices, ROC curves, and training history for full auditability.
Export trained models as self-contained GNU Octave/MATLAB .m prediction scripts or portable ONNX specification files.
ForgeCurves features a high-performance Apache Parquet storage engine combining a pure TypeScript Thrift metadata parser with a zero-copy Rust SIMD WebAssembly columnar codec. Datasets written by ForgeCurves achieve 100% schema parity and bit-exact compatibility with modern data engineering tools like Polars (pl.read_parquet()), DuckDB, and Apache Arrow:
% Write table with Snappy compression and custom row group partitioning
parquetwrite("dataset.parquet", data_table, "Compression", "snappy", "RowGroupSize", 5000);
% Rapid footer-only metadata inspection in under 250 microseconds
info = parquetinfo("dataset.parquet");
printf("Rows: %d, Columns: %d\n", info.NumRows, info.NumColumns);
% Selective column projection (skips unselected byte chunks on disk)
projected = parquetread("dataset.parquet", "SelectedVariableNames", {"feat_01", "feat_05"});
To meet enterprise requirements for massive multi-gigabyte datasets and high-speed iterative execution, the ForgeCurves engineering roadmap defines two major architectural extensions:
A lightweight workstation background daemon streaming over loopback WebSocket (127.0.0.1:8765). Circumvents the browser's 1.5 GB memory cap by unlocking physical workstation RAM (16 GB to 128 GB+), native multi-threaded Rayon parallelism, and memory-mapped file access (mmap) for datasets exceeding physical memory.
An end-to-end transpilation pipeline converting cell ASTs into an optimized, type-annotated Rust crate. Compiles dynamic user scripts into native WebAssembly binaries, yielding 15x to 60x speedups on iterative loops and procedural numerical transforms while sharing workspace state in linear memory.
Plots are rendered directly inline beneath the execution cell as crisp, responsive SVG elements:
t = linspace(0, 10, 120);
y = exp(-0.25*t) .* cos(2*pi*0.5*t);
plot(t, y, 'r-');
title('Damped Sinusoidal Oscillation');
xlabel('Time (seconds)');
ylabel('Displacement (m)');
grid on;
Autonomous testing tools and AI coding agents can interact with ForgeCurves through declarative DOM attributes and the runtime bridge:
window.__FORGECURVES_AGENT_SPEC__.getSpec();
window.__FORGECURVES_AGENT_SPEC__.listActions();
window.__FORGECURVES_AGENT_SPEC__.triggerAction('run-all');
The machine-readable specification is accessible at /agent-spec.json.
To achieve near-native computational throughput, eliminate browser garbage collection pauses, and deliver predictable linear-memory performance, key numerical libraries from the GNU Octave and scientific computing ecosystem have been ported to Rust WebAssembly (crates/octave-wasm-math):
| Library / Subsystem | Original Language | Rust WASM Module | Key Ported Functions | Description & Computational Role |
|---|---|---|---|---|
| GNU Octave Signal Processing | Fortran 77 / C++ | signal_kernels.rs |
fir1, fir2, firls, firpm (remez), butter, cheby1, cheby2, ellip, filter, filtfilt, grpdelay, periodogram, pwelch, tfestimate, resample, upfirdn, interp, downsample, pulstran, hamming, hanning / hann, blackman, flattopwin, kaiser, chebwin |
Comprehensive digital signal processing: windowed FIR (fir1, fir2), optimal minimax equiripple (firpm), least-squares (firls), analog-prototyped IIR (butter, cheby1, cheby2, ellip), digital filtering (filter, filtfilt), spectral estimation (periodogram, pwelch, tfestimate), rational polyphase resampling (resample, upfirdn, interp, downsample), RF/geometric pulse synthesis (pulstran with gauspuls, up to 29.5× speedup), and discrete window generators (Hamming, Hann, Blackman, Flat-top, Kaiser with Bessel I0, Dolph-Chebyshev with radix-2 IFFT) in zero-copy WebAssembly linear memory with transparent lazy _f64 proxy vectors for 106-point arrays. |
| BLAS (Basic Linear Algebra) | Fortran 77 | blas.rs |
dgemm, ddot, daxpy, dscal, matrix product (*) |
Level-1, Level-2, and Level-3 linear algebra kernels. Cache-blocked matrix-matrix multiplication and inner vector dot products executed directly in WebAssembly linear memory with zero-copy pointer exchanges. |
| LAPACK (Matrix Factorizations) | Fortran 77 | factorizations.rs |
lu, chol, qr, linear solver (\), back-substitution |
Numerically stable matrix factorizations: LU decomposition with partial row pivoting (dgetrf), Cholesky factorization for symmetric positive definite matrices (dpotrf), and Householder QR decomposition (dgeqrf) powering the matrix left-division operator. |
| Data Science & Spatial Metrics | C++ / Octave m-code | ds_kernels.rs |
pdist, pdist2, corrcoef, cov, skewness, kurtosis |
High-dimensional distance geometry across 5 spatial metrics (Euclidean, Squared Euclidean, Cityblock/Manhattan, Chebyshev, Cosine), Pearson product-moment correlation matrix, sample covariances, and two-pass Welford statistical moments. |
| Statistical Distributions | C / Fortran (Cephes) | stats_kernels.rs |
normpdf, normcdf, norminv, chi2pdf, chi2cdf, tpdf, tcdf, fpdf, fcdf |
Exact probability density, cumulative distribution, and inverse quantile functions for continuous and discrete distributions via Lanczos gamma series approximations and regularized incomplete beta/gamma continued fractions. |
| Neural Network Kernels (nnet) | C++ / Octave Forge | nnet_kernels.rs |
feedforward, backprop, sigmoid, tanh, relu, softmax |
Vectorized forward and backward propagation passes for deep feedforward neural architectures, analytical activation derivatives, categorical cross-entropy loss, and gradient descent optimization parameter updates. |
| Tabular Machine Learning | C++ (LIBSVM / GLMNET) | tabular_ml.rs |
fitcsvm, TreeBagger, lasso, ridge, elasticnet |
Support Vector Machines (SVM) with linear and RBF kernels via Sequential Minimal Optimization (SMO), bagged decision tree ensembles (Random Forests) with bootstrap sampling, and coordinate descent for L1/L2 regularized regression paths. |
| Apache Parquet Columnar Storage | C++ (Arrow / Thrift) | parquet_codec.rs |
parquetread, parquetwrite, parquetinfo |
Binary columnar serialization adhering to the Apache Thrift Compact specification and Parquet 2.0 format, bit-exact Polars schema parity, Snappy and Zstandard byte-stream compression codecs, and sub-millisecond metadata footer parsing. |
| Signal Processing & Digital Filters (signal) | C / C++ (Octave Forge) | signal_kernels.rs |
fir1, firpm, butter, cheby1, ellip, freqz, tf2sos, sosfilt, xcorr, hilbert, dct, pwelch, resample |
Complete digital filter synthesis (Parks-McClellan Remez exchange, bilinear Butterworth/Chebyshev/Elliptic IIR), second-order section (SOS) cascaded biquads, Cooley-Tukey analytic Hilbert transforms, Type-II/III DCTs, and polyphase multirate resampling. |
| Control Systems & CACSD (control) | C++ / SLICOT | control_kernels.rs |
tf, ss, zpk, step, impulse, lsim, bode, nyquist, margin, rlocus, lqr, care, c2d, feedback |
Linear Time-Invariant (LTI) dynamic systems analysis and synthesis: matrix exponential state transition $\Phi(t) = e^{At}$, exact zero-order hold discretization, Evans root locus pole tracking, Newton-Kleinman iterative Riccati equation solvers, and state-feedback pole placement. |
| Nonlinear & Constrained Optimization (optim) | Fortran 77 / C (GLPK) | optim_kernels.rs |
fminunc, fminsearch, fminbnd, fmincon, linprog, lsqnonneg, lsqcurvefit, fsolve, qp, glpk |
Mathematical optimization suite featuring Quasi-Newton BFGS with exact Deal gradients, Nelder-Mead simplex, Simplex LP via GLPK, active-set non-negative least squares, Levenberg-Marquardt curve fitting, and Sequential Quadratic Programming (SQP) for general constrained optimization. |