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
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]);
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). |
Powered by a WebAssembly SIMD128 compute engine running in a dedicated background Web Worker, ForgeCurves executes tabular machine learning pipelines without freezing the user interface:
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.
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.