@danielsimonjr/mathts-functions 0.53.0 → 0.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -439,6 +439,8 @@ __export(typed_exports, {
439
439
  smaller: () => smaller,
440
440
  smallerEq: () => smallerEq,
441
441
  solveBVP: () => solveBVP,
442
+ solveDAE: () => solveDAE,
443
+ solveDDE: () => solveDDE,
442
444
  solveODESystem: () => solveODESystem,
443
445
  solvePDE: () => solvePDE,
444
446
  solveParabolicPDE: () => solveParabolicPDE,
@@ -13209,6 +13211,469 @@ function interpState(stepT, stepY, tq) {
13209
13211
  return y0.map((v, i) => v + w * (y1[i] - v));
13210
13212
  }
13211
13213
 
13214
+ // src/numeric/solveDAE.ts
13215
+ function _arr(v) {
13216
+ return Array.isArray(v) ? v.slice() : [v];
13217
+ }
13218
+ function _evalArr(fn, t, y, z) {
13219
+ const r = fn(t, y, z);
13220
+ return Array.isArray(r) ? r : [r];
13221
+ }
13222
+ function _wrms(v, scale4) {
13223
+ let s = 0;
13224
+ for (let i = 0; i < v.length; i++) {
13225
+ const q = v[i] / scale4[i];
13226
+ s += q * q;
13227
+ }
13228
+ return Math.sqrt(s / v.length);
13229
+ }
13230
+ function _bdfCoeffs(nodes) {
13231
+ const m = nodes.length;
13232
+ const x0 = nodes[0];
13233
+ const c = new Array(m).fill(0);
13234
+ let diag2 = 0;
13235
+ for (let p = 1; p < m; p++) diag2 += 1 / (x0 - nodes[p]);
13236
+ c[0] = diag2;
13237
+ for (let j = 1; j < m; j++) {
13238
+ let val = 1 / (nodes[j] - x0);
13239
+ for (let p = 0; p < m; p++) {
13240
+ if (p === 0 || p === j) continue;
13241
+ val *= (x0 - nodes[p]) / (nodes[j] - nodes[p]);
13242
+ }
13243
+ c[j] = val;
13244
+ }
13245
+ return c;
13246
+ }
13247
+ function _polyExtrap(times, vals, tnew) {
13248
+ const p = times.length;
13249
+ const n = vals[0].length;
13250
+ const out = new Array(n).fill(0);
13251
+ for (let i = 0; i < p; i++) {
13252
+ let li = 1;
13253
+ for (let m = 0; m < p; m++) {
13254
+ if (m === i) continue;
13255
+ li *= (tnew - times[m]) / (times[i] - times[m]);
13256
+ }
13257
+ for (let d = 0; d < n; d++) out[d] += li * vals[i][d];
13258
+ }
13259
+ return out;
13260
+ }
13261
+ function _denseSolve(A, b) {
13262
+ const n = b.length;
13263
+ const M = A.map((r) => r.slice());
13264
+ const x = b.slice();
13265
+ for (let k = 0; k < n; k++) {
13266
+ let piv = k;
13267
+ for (let i = k + 1; i < n; i++) if (Math.abs(M[i][k]) > Math.abs(M[piv][k])) piv = i;
13268
+ if (Math.abs(M[piv][k]) < 1e-300) return new Array(n).fill(NaN);
13269
+ [M[k], M[piv]] = [M[piv], M[k]];
13270
+ [x[k], x[piv]] = [x[piv], x[k]];
13271
+ const akk = M[k][k];
13272
+ for (let i = k + 1; i < n; i++) {
13273
+ const factor2 = M[i][k] / akk;
13274
+ for (let j = k; j < n; j++) M[i][j] -= factor2 * M[k][j];
13275
+ x[i] -= factor2 * x[k];
13276
+ }
13277
+ }
13278
+ for (let i = n - 1; i >= 0; i--) {
13279
+ let s = x[i];
13280
+ for (let j = i + 1; j < n; j++) s -= M[i][j] * x[j];
13281
+ x[i] = s / M[i][i];
13282
+ }
13283
+ return x;
13284
+ }
13285
+ function _solveAlgebraic(g, t, y, zGuess, tol) {
13286
+ const na = zGuess.length;
13287
+ const z = zGuess.slice();
13288
+ for (let iter = 0; iter < 50; iter++) {
13289
+ const g0 = _evalArr(g, t, y, z);
13290
+ if (g0.length !== na) {
13291
+ throw new Error(
13292
+ `solveDAE: the constraint g must return ${na} value(s) (matching z0); got ${g0.length}`
13293
+ );
13294
+ }
13295
+ const J = Array.from({ length: na }, () => new Array(na));
13296
+ for (let j = 0; j < na; j++) {
13297
+ const eps = Math.max(1e-8, 1e-7 * Math.abs(z[j]));
13298
+ const zp = z.slice();
13299
+ zp[j] += eps;
13300
+ const gp = _evalArr(g, t, y, zp);
13301
+ for (let i = 0; i < na; i++) J[i][j] = (gp[i] - g0[i]) / eps;
13302
+ }
13303
+ const dz = _denseSolve(
13304
+ J,
13305
+ g0.map((v) => -v)
13306
+ );
13307
+ if (!dz.every((v) => Number.isFinite(v))) return null;
13308
+ let znorm = 0;
13309
+ let dnorm = 0;
13310
+ for (let i = 0; i < na; i++) {
13311
+ z[i] += dz[i];
13312
+ znorm += z[i] * z[i];
13313
+ dnorm += dz[i] * dz[i];
13314
+ }
13315
+ if (Math.sqrt(dnorm) <= tol * (1 + Math.sqrt(znorm))) {
13316
+ const gCheck = _evalArr(g, t, y, z);
13317
+ const res = Math.sqrt(gCheck.reduce((a, v) => a + v * v, 0));
13318
+ return res < 1e-6 ? z : null;
13319
+ }
13320
+ }
13321
+ return null;
13322
+ }
13323
+ function solveDAE(f, g, tspan, y0, z0, options = {}) {
13324
+ const t0 = tspan[0];
13325
+ const tf = tspan[1];
13326
+ if (!(typeof t0 === "number" && typeof tf === "number")) {
13327
+ throw new Error("solveDAE: tspan must be [t0, T] numbers");
13328
+ }
13329
+ if (!(tf > t0)) {
13330
+ throw new Error("solveDAE: require T > t0 (forward integration)");
13331
+ }
13332
+ const yScalar = !Array.isArray(y0);
13333
+ const zScalar = z0 === void 0 || !Array.isArray(z0);
13334
+ const y0v = _arr(y0);
13335
+ const z0v = z0 === void 0 ? [0] : _arr(z0);
13336
+ const nd = y0v.length;
13337
+ const na = z0v.length;
13338
+ const n = nd + na;
13339
+ const rtol = options.tol ?? 1e-6;
13340
+ const atol = options.atol ?? rtol * 1e-3;
13341
+ const maxOrder = options.maxOrder ?? 2;
13342
+ const maxIter = options.maxIter ?? 1e5;
13343
+ const maxStep = options.maxStep ?? Infinity;
13344
+ const minStepOpt = options.minStep ?? 0;
13345
+ const EPS5 = Number.EPSILON;
13346
+ const newtonTol = options.newtonTol ?? Math.max(10 * EPS5 / rtol, Math.min(0.03, Math.sqrt(rtol)));
13347
+ const span = tf - t0;
13348
+ const yOf = (w2) => w2.slice(0, nd);
13349
+ const zOf = (w2) => w2.slice(nd);
13350
+ const z0consistent = _solveAlgebraic(g, t0, y0v, z0v, newtonTol);
13351
+ if (z0consistent === null) {
13352
+ throw new Error(
13353
+ "solveDAE: could not solve g(t0, y0, z0) = 0 for a consistent z0 \u2014 \u2202g/\u2202z appears singular. The DAE is not semi-explicit index-1 (index-1 requires \u2202g/\u2202z nonsingular)."
13354
+ );
13355
+ }
13356
+ let t = t0;
13357
+ let w = [...y0v, ...z0consistent];
13358
+ const histT = [t];
13359
+ const histW = [w.slice()];
13360
+ const tOut = [t];
13361
+ const yOut = [yOf(w)];
13362
+ const zOut = [zOf(w)];
13363
+ let h;
13364
+ if (options.firstStep !== void 0) {
13365
+ h = Math.abs(options.firstStep);
13366
+ } else {
13367
+ const f0 = _evalArr(f, t0, y0v, z0consistent);
13368
+ const nrm = (v) => Math.sqrt(v.reduce((a, x) => a + x * x, 0) / Math.max(1, v.length));
13369
+ const d0 = nrm(y0v);
13370
+ const d1 = nrm(f0);
13371
+ h = Math.min(d0 < 1e-5 || d1 < 1e-5 ? 1e-3 : 0.01 * (d0 / d1), span);
13372
+ }
13373
+ h = Math.min(h, maxStep);
13374
+ function makeResidual(tNew, c0, histSum) {
13375
+ return (wc) => {
13376
+ const y = yOf(wc);
13377
+ const z = zOf(wc);
13378
+ const fv = _evalArr(f, tNew, y, z);
13379
+ const gv = _evalArr(g, tNew, y, z);
13380
+ if (fv.length !== nd) {
13381
+ throw new Error(`solveDAE: f must return ${nd} value(s) (matching y0); got ${fv.length}`);
13382
+ }
13383
+ if (gv.length !== na) {
13384
+ throw new Error(`solveDAE: g must return ${na} value(s) (matching z0); got ${gv.length}`);
13385
+ }
13386
+ const R = new Array(n);
13387
+ for (let i = 0; i < nd; i++) R[i] = c0 * wc[i] + histSum[i] - fv[i];
13388
+ for (let i = 0; i < na; i++) R[nd + i] = gv[i];
13389
+ return R;
13390
+ };
13391
+ }
13392
+ function newtonMatrix(tNew, wc, c0, residual, R0) {
13393
+ if (options.jacobian) {
13394
+ const { fy, fz, gy, gz } = options.jacobian(tNew, yOf(wc), zOf(wc));
13395
+ const J2 = Array.from({ length: n }, () => new Array(n).fill(0));
13396
+ for (let i = 0; i < nd; i++) {
13397
+ for (let j = 0; j < nd; j++) J2[i][j] = (i === j ? c0 : 0) - fy[i][j];
13398
+ for (let j = 0; j < na; j++) J2[i][nd + j] = -fz[i][j];
13399
+ }
13400
+ for (let i = 0; i < na; i++) {
13401
+ for (let j = 0; j < nd; j++) J2[nd + i][j] = gy[i][j];
13402
+ for (let j = 0; j < na; j++) J2[nd + i][nd + j] = gz[i][j];
13403
+ }
13404
+ return J2;
13405
+ }
13406
+ const J = Array.from({ length: n }, () => new Array(n));
13407
+ for (let col = 0; col < n; col++) {
13408
+ const eps = Math.max(1e-8, 1e-7 * Math.abs(wc[col]));
13409
+ const wp = wc.slice();
13410
+ wp[col] += eps;
13411
+ const Rp = residual(wp);
13412
+ for (let row2 = 0; row2 < n; row2++) J[row2][col] = (Rp[row2] - R0[row2]) / eps;
13413
+ }
13414
+ return J;
13415
+ }
13416
+ let iter = 0;
13417
+ while (t < tf && iter < maxIter) {
13418
+ iter++;
13419
+ if (t + h > tf) h = tf - t;
13420
+ const minStep = Math.max(minStepOpt, 1e-13 * Math.max(1, Math.abs(t)));
13421
+ const order = Math.max(1, Math.min(maxOrder, histT.length - 1));
13422
+ let accepted = false;
13423
+ let wNew = w;
13424
+ let acceptedTime = t;
13425
+ while (!accepted) {
13426
+ if (h < minStep) {
13427
+ throw new Error(
13428
+ "solveDAE: required step size fell below the minimum \u2014 the Newton iteration is not converging. The system may be higher-index (\u2202g/\u2202z singular) or the tolerance too tight."
13429
+ );
13430
+ }
13431
+ const tNew = t + h;
13432
+ const nodes = [tNew];
13433
+ for (let j = 0; j < order; j++) nodes.push(histT[j]);
13434
+ const coeffs = _bdfCoeffs(nodes);
13435
+ const c0 = coeffs[0];
13436
+ const histSum = new Array(nd).fill(0);
13437
+ for (let j = 1; j <= order; j++) {
13438
+ const cj = coeffs[j];
13439
+ const wj = histW[j - 1];
13440
+ for (let i = 0; i < nd; i++) histSum[i] += cj * wj[i];
13441
+ }
13442
+ const residual = makeResidual(tNew, c0, histSum);
13443
+ let wPred;
13444
+ if (histT.length >= order + 1) {
13445
+ wPred = _polyExtrap(histT.slice(0, order + 1), histW.slice(0, order + 1), tNew);
13446
+ } else {
13447
+ wPred = w.slice();
13448
+ const fn = _evalArr(f, histT[0], yOf(w), zOf(w));
13449
+ for (let i = 0; i < nd; i++) wPred[i] = w[i] + h * fn[i];
13450
+ }
13451
+ const wc = wPred.slice();
13452
+ let converged = false;
13453
+ const scale4 = new Array(n);
13454
+ for (let it = 0; it < 12; it++) {
13455
+ const R0 = residual(wc);
13456
+ const J = newtonMatrix(tNew, wc, c0, residual, R0);
13457
+ const solve2 = _factorSolver(J, n);
13458
+ const dw = solve2(R0.map((v) => -v));
13459
+ if (!dw.every((v) => Number.isFinite(v))) break;
13460
+ for (let i = 0; i < n; i++) {
13461
+ wc[i] += dw[i];
13462
+ scale4[i] = atol + rtol * Math.abs(wc[i]);
13463
+ }
13464
+ if (_wrms(dw, scale4) <= newtonTol) {
13465
+ converged = true;
13466
+ break;
13467
+ }
13468
+ }
13469
+ if (!converged) {
13470
+ h *= 0.5;
13471
+ continue;
13472
+ }
13473
+ for (let i = 0; i < n; i++) scale4[i] = atol + rtol * Math.abs(wc[i]);
13474
+ const errNorm = _wrms(
13475
+ wc.map((v, i) => v - wPred[i]),
13476
+ scale4
13477
+ );
13478
+ if (errNorm <= 1 || h <= minStep) {
13479
+ wNew = wc;
13480
+ acceptedTime = tNew;
13481
+ accepted = true;
13482
+ }
13483
+ const factor2 = errNorm === 0 ? 4 : 0.9 * Math.pow(errNorm, -1 / (order + 1));
13484
+ h *= Math.min(4, Math.max(0.2, factor2));
13485
+ if (h > maxStep) h = maxStep;
13486
+ }
13487
+ w = wNew;
13488
+ t = acceptedTime;
13489
+ histT.unshift(t);
13490
+ histW.unshift(w.slice());
13491
+ if (histT.length > maxOrder + 2) {
13492
+ histT.pop();
13493
+ histW.pop();
13494
+ }
13495
+ tOut.push(t);
13496
+ yOut.push(yOf(w));
13497
+ zOut.push(zOf(w));
13498
+ }
13499
+ if (iter >= maxIter) {
13500
+ throw new Error(
13501
+ "solveDAE: maximum number of steps reached \u2014 try loosening tol or raising maxIter"
13502
+ );
13503
+ }
13504
+ return {
13505
+ t: tOut,
13506
+ y: yScalar ? yOut.map((v) => v[0]) : yOut,
13507
+ z: zScalar ? zOut.map((v) => v[0]) : zOut
13508
+ };
13509
+ }
13510
+
13511
+ // src/numeric/solveDDE.ts
13512
+ function _arr2(v) {
13513
+ return Array.isArray(v) ? v.slice() : [v];
13514
+ }
13515
+ function _hermite2(ta, tb, ya, yb, fa, fb, t) {
13516
+ const h = tb - ta;
13517
+ const theta = h === 0 ? 0 : (t - ta) / h;
13518
+ const th2 = theta * theta;
13519
+ const th3 = th2 * theta;
13520
+ const h00 = 2 * th3 - 3 * th2 + 1;
13521
+ const h10 = th3 - 2 * th2 + theta;
13522
+ const h01 = -2 * th3 + 3 * th2;
13523
+ const h11 = th3 - th2;
13524
+ return ya.map((_, i) => h00 * ya[i] + h10 * h * fa[i] + h01 * yb[i] + h11 * h * fb[i]);
13525
+ }
13526
+ function _wrms2(v, scale4) {
13527
+ let s = 0;
13528
+ for (let i = 0; i < v.length; i++) {
13529
+ const q = v[i] / scale4[i];
13530
+ s += q * q;
13531
+ }
13532
+ return Math.sqrt(s / v.length);
13533
+ }
13534
+ var _BS23_B = [2 / 9, 1 / 3, 4 / 9, 0];
13535
+ var _BS23_BP = [7 / 24, 1 / 4, 1 / 3, 1 / 8];
13536
+ var _BS23_DB = _BS23_B.map((b, i) => b - _BS23_BP[i]);
13537
+ function solveDDE(f, tspan, history, delays, options = {}) {
13538
+ const t0 = tspan[0];
13539
+ const tf = tspan[1];
13540
+ if (!(typeof t0 === "number" && typeof tf === "number")) {
13541
+ throw new Error("solveDDE: tspan must be [t0, T] numbers");
13542
+ }
13543
+ if (!(tf > t0)) {
13544
+ throw new Error("solveDDE: require T > t0 (forward integration)");
13545
+ }
13546
+ if (!Array.isArray(delays) || delays.length === 0) {
13547
+ throw new Error("solveDDE: at least one delay \u03C4 must be given");
13548
+ }
13549
+ if (!delays.every((d) => typeof d === "number" && d > 0)) {
13550
+ throw new Error("solveDDE: every delay \u03C4 must be a positive number");
13551
+ }
13552
+ const histFn = typeof history === "function" ? (s) => _arr2(history(s)) : () => _arr2(history);
13553
+ const y0raw = typeof history === "function" ? history(t0) : history;
13554
+ const yScalar = !Array.isArray(y0raw);
13555
+ const y0 = _arr2(y0raw);
13556
+ const n = y0.length;
13557
+ const minTau = Math.min(...delays);
13558
+ const rtol = options.tol ?? 1e-6;
13559
+ const atol = options.atol ?? rtol * 1e-3;
13560
+ const maxIter = options.maxIter ?? 1e5;
13561
+ const maxStep = options.maxStep ?? Infinity;
13562
+ const minStepOpt = options.minStep ?? 0;
13563
+ const Ts = [t0];
13564
+ const Ys = [y0.slice()];
13565
+ const Fs = [];
13566
+ function _locate(s) {
13567
+ let lo = 0;
13568
+ let hi = Ts.length - 1;
13569
+ if (s <= Ts[0]) return 0;
13570
+ if (s >= Ts[hi]) return hi - 1;
13571
+ while (hi - lo > 1) {
13572
+ const mid = lo + hi >> 1;
13573
+ if (Ts[mid] <= s) lo = mid;
13574
+ else hi = mid;
13575
+ }
13576
+ return lo;
13577
+ }
13578
+ function delayedState(s) {
13579
+ if (s <= t0) return histFn(s);
13580
+ const i = _locate(s);
13581
+ return _hermite2(Ts[i], Ts[i + 1], Ys[i], Ys[i + 1], Fs[i], Fs[i + 1], s);
13582
+ }
13583
+ function fEval(t2, y2) {
13584
+ const yd = delays.map((tau2) => delayedState(t2 - tau2));
13585
+ const r = f(t2, y2, yd);
13586
+ const out = Array.isArray(r) ? r : [r];
13587
+ if (out.length !== n) {
13588
+ throw new Error(
13589
+ `solveDDE: f must return ${n} value(s) (matching the state); got ${out.length}`
13590
+ );
13591
+ }
13592
+ return out;
13593
+ }
13594
+ function nextBreakpoint(t2) {
13595
+ let best = Infinity;
13596
+ for (const tau2 of delays) {
13597
+ let m = Math.floor((t2 - t0) / tau2) + 1;
13598
+ let cand = t0 + m * tau2;
13599
+ while (cand <= t2 + 1e-12 * Math.max(1, Math.abs(t2))) {
13600
+ m += 1;
13601
+ cand = t0 + m * tau2;
13602
+ }
13603
+ if (cand < best) best = cand;
13604
+ }
13605
+ return best;
13606
+ }
13607
+ Fs[0] = fEval(t0, y0);
13608
+ const rms = (v) => Math.sqrt(v.reduce((a, x) => a + x * x, 0) / Math.max(1, v.length));
13609
+ let h;
13610
+ if (options.firstStep !== void 0) {
13611
+ h = Math.abs(options.firstStep);
13612
+ } else {
13613
+ const d0 = rms(y0);
13614
+ const d1 = rms(Fs[0]);
13615
+ h = d0 < 1e-5 || d1 < 1e-5 ? 1e-6 : 0.01 * (d0 / d1);
13616
+ }
13617
+ h = Math.min(h, minTau, maxStep, tf - t0);
13618
+ let t = t0;
13619
+ let y = y0.slice();
13620
+ let f0 = Fs[0];
13621
+ let iter = 0;
13622
+ while (t < tf && iter < maxIter) {
13623
+ iter += 1;
13624
+ const nb = nextBreakpoint(t);
13625
+ let hmax = Math.min(minTau, maxStep, tf - t);
13626
+ if (nb < tf) hmax = Math.min(hmax, nb - t);
13627
+ if (h > hmax) h = hmax;
13628
+ const minStep = Math.max(minStepOpt, 1e-13 * Math.max(1, Math.abs(t)));
13629
+ if (h < minStep) h = Math.min(minStep, hmax);
13630
+ const k1 = f0;
13631
+ const k2 = fEval(
13632
+ t + 0.5 * h,
13633
+ y.map((yi, i) => yi + 0.5 * h * k1[i])
13634
+ );
13635
+ const k3 = fEval(
13636
+ t + 0.75 * h,
13637
+ y.map((yi, i) => yi + 0.75 * h * k2[i])
13638
+ );
13639
+ const yNew = y.map(
13640
+ (yi, i) => yi + h * (_BS23_B[0] * k1[i] + _BS23_B[1] * k2[i] + _BS23_B[2] * k3[i])
13641
+ );
13642
+ const k4 = fEval(t + h, yNew);
13643
+ const scale4 = y.map((yi, i) => atol + rtol * Math.max(Math.abs(yi), Math.abs(yNew[i])));
13644
+ const err = yNew.map(
13645
+ (_, i) => h * (_BS23_DB[0] * k1[i] + _BS23_DB[1] * k2[i] + _BS23_DB[2] * k3[i] + _BS23_DB[3] * k4[i])
13646
+ );
13647
+ const errNorm = _wrms2(err, scale4);
13648
+ if (errNorm <= 1 || h <= minStep) {
13649
+ t += h;
13650
+ y = yNew;
13651
+ f0 = k4;
13652
+ Ts.push(t);
13653
+ Ys.push(y.slice());
13654
+ Fs.push(f0);
13655
+ }
13656
+ const factor2 = errNorm === 0 ? 5 : 0.9 * Math.pow(errNorm, -1 / 3);
13657
+ h *= Math.min(5, Math.max(0.2, factor2));
13658
+ }
13659
+ if (iter >= maxIter) {
13660
+ throw new Error(
13661
+ "solveDDE: maximum number of steps reached \u2014 try loosening tol or raising maxIter"
13662
+ );
13663
+ }
13664
+ const yInterp = (tq) => {
13665
+ const s = tq <= t0 ? t0 : tq >= t ? t : tq;
13666
+ const i = _locate(s);
13667
+ const val = _hermite2(Ts[i], Ts[i + 1], Ys[i], Ys[i + 1], Fs[i], Fs[i + 1], s);
13668
+ return yScalar ? val[0] : val;
13669
+ };
13670
+ return {
13671
+ t: Ts,
13672
+ y: yScalar ? Ys.map((v) => v[0]) : Ys,
13673
+ yInterp
13674
+ };
13675
+ }
13676
+
13212
13677
  // src/typed/numeric.ts
13213
13678
  var NUMERIC_WASM_THRESHOLD = 16;
13214
13679
  function findRoot(f, a, b, opts) {
@@ -54342,6 +54807,8 @@ export {
54342
54807
  solve,
54343
54808
  solveBVP,
54344
54809
  solveBanded,
54810
+ solveDAE,
54811
+ solveDDE,
54345
54812
  solveODE,
54346
54813
  solveODESystem,
54347
54814
  solvePDE,
@@ -0,0 +1,134 @@
1
+ /**
2
+ * Semi-explicit index-1 differential-algebraic equation (DAE) solver via BDF.
3
+ *
4
+ * Solves the semi-explicit index-1 system
5
+ *
6
+ * y' = f(t, y, z) (differential variables y)
7
+ * 0 = g(t, y, z) (algebraic constraint z)
8
+ *
9
+ * on `t ∈ [t0, T]`. "Index-1" means the algebraic Jacobian block `∂g/∂z` is
10
+ * **nonsingular**, so the constraint `g = 0` locally determines `z` from
11
+ * `(t, y)`; this is exactly the condition that makes the coupled per-step
12
+ * Newton system solvable.
13
+ *
14
+ * ## Method — variable-step, variable-order (1–2) BDF with a combined Newton step
15
+ *
16
+ * The differential derivative is discretised with a Backward Differentiation
17
+ * Formula (the same BDF family that backs {@link bdfSolve}): on the last `k`
18
+ * accepted times plus the new time `t_{n+1}`, the interpolating polynomial's
19
+ * derivative at `t_{n+1}` is `Σ_j c_j·w_{n+1-j}` (variable-step coefficients
20
+ * `c_j` from the Lagrange-basis derivative, so BDF1/BDF2 work on a non-uniform
21
+ * grid). Each step then solves the **combined** nonlinear system for the new
22
+ * `w_{n+1} = (y_{n+1}, z_{n+1})`
23
+ *
24
+ * differential rows: c_0·y_{n+1} + (history) − f(t_{n+1}, y_{n+1}, z_{n+1}) = 0
25
+ * algebraic rows: g(t_{n+1}, y_{n+1}, z_{n+1}) = 0
26
+ *
27
+ * by Newton's method. The Newton (iteration) matrix is the block
28
+ *
29
+ * ⎡ c_0·I − ∂f/∂y − ∂f/∂z ⎤
30
+ * ⎣ ∂g/∂y ∂g/∂z ⎦
31
+ *
32
+ * (finite-differenced from the residual by default, or built from analytic
33
+ * blocks supplied via `options.jacobian`) and is LU-solved through the shared
34
+ * matrix-package factorisation ({@link _factorSolver}). The index-1 condition
35
+ * (`∂g/∂z` nonsingular) is exactly what makes this matrix nonsingular, so a
36
+ * **higher-index** input is detected as a singular Jacobian and reported
37
+ * (it is not silently integrated to garbage).
38
+ *
39
+ * Adaptive step size uses a predictor/corrector local-error estimate (the
40
+ * corrector minus a lower-order extrapolation predictor), scaled by the usual
41
+ * `atol + rtol·|w|` weights.
42
+ *
43
+ * ## Consistent initial values
44
+ *
45
+ * The initial algebraic value `z0` is treated as a **guess**: the solver runs
46
+ * Newton on `g(t0, y0, z0) = 0` to land on the constraint manifold before the
47
+ * first step (so a slightly-off or omitted `z0` is corrected rather than
48
+ * silently propagated). If that Newton fails / `∂g/∂z` is singular at `t0`,
49
+ * the problem is not index-1 and an error is thrown.
50
+ *
51
+ * Plain-number state only (the Jacobian and linear solves are numeric).
52
+ *
53
+ * @packageDocumentation
54
+ */
55
+ /** Differential forcing `y' = f(t, y, z)`. Returns the `y'` vector (a scalar is accepted for 1-D y). */
56
+ export type DAEDifferential = (t: number, y: number[], z: number[]) => number[] | number;
57
+ /** Algebraic constraint `0 = g(t, y, z)`. Returns the residual vector (a scalar is accepted for 1-D z). */
58
+ export type DAEConstraint = (t: number, y: number[], z: number[]) => number[] | number;
59
+ /**
60
+ * Analytic Jacobian blocks of the DAE at `(t, y, z)`, supplied via
61
+ * {@link SolveDAEOptions.jacobian} in place of the default finite differences.
62
+ * Each block is a matrix in the usual `[row][col]` convention:
63
+ * `fy[i][j] = ∂fᵢ/∂yⱼ`, `fz[i][j] = ∂fᵢ/∂zⱼ`, `gy`, `gz` likewise.
64
+ */
65
+ export interface DAEJacobianBlocks {
66
+ fy: number[][];
67
+ fz: number[][];
68
+ gy: number[][];
69
+ gz: number[][];
70
+ }
71
+ /** Options for {@link solveDAE}. */
72
+ export interface SolveDAEOptions {
73
+ /** Relative tolerance for the local-error step control (default `1e-6`). */
74
+ tol?: number;
75
+ /** Absolute tolerance (default `tol · 1e-3`). */
76
+ atol?: number;
77
+ /** Initial step size (default: chosen from `‖f‖`). */
78
+ firstStep?: number;
79
+ /** Minimum step size (a hard floor; the solver throws if it must go below it). */
80
+ minStep?: number;
81
+ /** Maximum step size (default: no cap). */
82
+ maxStep?: number;
83
+ /** Maximum number of accepted steps (default `1e5`). */
84
+ maxIter?: number;
85
+ /** Maximum BDF order, 1 or 2 (default `2`). */
86
+ maxOrder?: 1 | 2;
87
+ /** Newton convergence tolerance on the scaled increment (default derived from `tol`). */
88
+ newtonTol?: number;
89
+ /**
90
+ * Analytic Jacobian blocks `(t, y, z) => { fy, fz, gy, gz }`. When given they
91
+ * replace the default finite-difference Newton matrix (faster + more accurate).
92
+ */
93
+ jacobian?: (t: number, y: number[], z: number[]) => DAEJacobianBlocks;
94
+ }
95
+ /**
96
+ * Solution returned by {@link solveDAE}.
97
+ *
98
+ * `y`/`z` are `number[][]` (one state vector per time) when the corresponding
99
+ * initial value was an array, and unwrapped to `number[]` when it was a scalar.
100
+ */
101
+ export interface DAESolution {
102
+ /** Accepted output times, `t[0] = t0`, last entry `= T`. */
103
+ t: number[];
104
+ /** Differential state at each time. */
105
+ y: number[][] | number[];
106
+ /** Algebraic state at each time. */
107
+ z: number[][] | number[];
108
+ }
109
+ /**
110
+ * Solve the semi-explicit index-1 DAE `y' = f(t, y, z)`, `0 = g(t, y, z)` on
111
+ * `[tspan[0], tspan[1]]` with a variable-step BDF(1–2) integrator and a coupled
112
+ * Newton solve for `(y, z)` at each step.
113
+ *
114
+ * @param f Differential forcing `f(t, y, z) → y'`.
115
+ * @param g Algebraic constraint `g(t, y, z) → 0`.
116
+ * @param tspan `[t0, T]` (forward integration; `T > t0`).
117
+ * @param y0 Initial differential state (scalar or vector).
118
+ * @param z0 Initial algebraic guess (scalar or vector). Refined to satisfy
119
+ * `g(t0, y0, z0) = 0` before the first step. Defaults to `[0]`.
120
+ * @param options See {@link SolveDAEOptions}.
121
+ * @returns `{ t, y, z }` — `y`/`z` are unwrapped to `number[]` when the matching
122
+ * initial value was a scalar, else `number[][]`.
123
+ *
124
+ * @example
125
+ * // RC circuit: C·V' = i, i·R = Vs − V (semi-explicit, index-1)
126
+ * // with C=R=Vs=1, V(0)=0 → V = 1 − e^{−t}, i = e^{−t}
127
+ * const sol = solveDAE(
128
+ * (t, y, z) => [z[0]], // V' = i
129
+ * (t, y, z) => [z[0] - (1 - y[0])], // i − (Vs − V) = 0
130
+ * [0, 3], 0, 1,
131
+ * );
132
+ */
133
+ export declare function solveDAE(f: DAEDifferential, g: DAEConstraint, tspan: [number, number] | number[], y0: number | number[], z0?: number | number[], options?: SolveDAEOptions): DAESolution;
134
+ //# sourceMappingURL=solveDAE.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solveDAE.d.ts","sourceRoot":"","sources":["../../src/numeric/solveDAE.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAIH,wGAAwG;AACxG,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,GAAG,MAAM,CAAC;AAEzF,2GAA2G;AAC3G,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,GAAG,MAAM,CAAC;AAEvF;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;IACf,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;IACf,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;IACf,EAAE,EAAE,MAAM,EAAE,EAAE,CAAC;CAChB;AAED,oCAAoC;AACpC,MAAM,WAAW,eAAe;IAC9B,4EAA4E;IAC5E,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACjB,yFAAyF;IACzF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,iBAAiB,CAAC;CACvE;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,4DAA4D;IAC5D,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,uCAAuC;IACvC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC;IACzB,oCAAoC;IACpC,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC;CAC1B;AAiJD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,QAAQ,CACtB,CAAC,EAAE,eAAe,EAClB,CAAC,EAAE,aAAa,EAChB,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,EAClC,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,EACrB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,EACtB,OAAO,GAAE,eAAoB,GAC5B,WAAW,CAwPb"}
@@ -0,0 +1,107 @@
1
+ /**
2
+ * Constant-delay delay differential equation (DDE) solver via the method of steps.
3
+ *
4
+ * Solves
5
+ *
6
+ * y'(t) = f(t, y(t), [y(t−τ₁), y(t−τ₂), …]) on t ∈ [t0, T]
7
+ *
8
+ * with a **history function** `φ(t)` giving `y(t)` for `t ≤ t0` (the initial state
9
+ * is `y(t0) = φ(t0)`). The `τ_k` are fixed positive **constant delays**.
10
+ *
11
+ * ## Method — method of steps + continuous extension (Bellen–Zennaro)
12
+ *
13
+ * The system is integrated with the adaptive **BS23** (Bogacki–Shampine 3(2))
14
+ * embedded Runge–Kutta pair — the same explicit pair MATLAB's `dde23` uses. At each
15
+ * RK stage the delayed argument `y(t − τ_k)` is obtained from
16
+ *
17
+ * - the **history function** `φ` when `t − τ_k ≤ t0`, or
18
+ * - a **cubic-Hermite dense-output interpolant** of the already-computed solution
19
+ * otherwise (a C¹, O(h⁴) continuous extension built from the stored per-step
20
+ * `(t, y, y')` data — consistent with BS23's order).
21
+ *
22
+ * ### The step cap (standard MOS constraint)
23
+ *
24
+ * Each step is **capped at `h ≤ min(τ)`**. With that cap every delayed argument
25
+ * `t_stage − τ_k` lies in `[t0, t_n]` (already-accepted history), so the delayed
26
+ * value is always available and the method stays fully **explicit** — no implicit
27
+ * coupling of the current step to itself. Adaptive error control still chooses `h`
28
+ * freely within that cap.
29
+ *
30
+ * ### Discontinuity propagation
31
+ *
32
+ * `y'` is generically discontinuous at `t0` (the history need not satisfy the DDE),
33
+ * and that low-order discontinuity propagates to `t0 + τ_k`, `t0 + 2τ_k`, …. The
34
+ * integrator **lands exactly on each `t0 + m·τ_k` breakpoint** (the step is trimmed
35
+ * so it never *crosses* one), so no dense-output interval straddles a derivative
36
+ * jump and the smoothing order increases past each breakpoint as it should.
37
+ *
38
+ * Plain-number state only (the interpolation and error norms are numeric).
39
+ *
40
+ * @packageDocumentation
41
+ */
42
+ /**
43
+ * Forcing function `y'(t) = f(t, y, yDelayed)`.
44
+ * - `y` is the current state (`number[]`; a length-1 array for a scalar DDE).
45
+ * - `yDelayed[k]` is `y(t − τ_k)` in the same shape as `y`, one entry per delay.
46
+ * Returns the derivative vector (a bare number is accepted for a scalar DDE).
47
+ */
48
+ export type DDEForcing = (t: number, y: number[], yDelayed: number[][]) => number[] | number;
49
+ /**
50
+ * History `φ(t)` giving `y(t)` for `t ≤ t0`. Either a function `(t) => state`
51
+ * (state as `number[]` or scalar `number`), or a constant (`number` / `number[]`)
52
+ * used for all `t ≤ t0`. The initial state is `φ(t0)`.
53
+ */
54
+ export type DDEHistory = ((t: number) => number[] | number) | number | number[];
55
+ /** Options for {@link solveDDE} (mirrors the `solveODE` option shape). */
56
+ export interface SolveDDEOptions {
57
+ /** Relative tolerance for the adaptive local-error control (default `1e-6`). */
58
+ tol?: number;
59
+ /** Absolute tolerance (default `tol · 1e-3`). */
60
+ atol?: number;
61
+ /** Initial step size (default: Hairer heuristic, capped to `min(τ)`). */
62
+ firstStep?: number;
63
+ /** Minimum step size (a hard floor; below it a step is force-accepted). */
64
+ minStep?: number;
65
+ /** Maximum step size (further capped by `min(τ)` and the next breakpoint). */
66
+ maxStep?: number;
67
+ /** Maximum number of accepted steps (default `1e5`). */
68
+ maxIter?: number;
69
+ }
70
+ /**
71
+ * Solution returned by {@link solveDDE}.
72
+ *
73
+ * `y` is `number[][]` (one state vector per accepted time) when the history/initial
74
+ * state is a vector, and unwrapped to `number[]` when it is a scalar.
75
+ */
76
+ export interface DDESolution {
77
+ /** Accepted output times, `t[0] = t0`, last entry `= T`. */
78
+ t: number[];
79
+ /** State at each accepted time (`number[]` for a scalar DDE, else `number[][]`). */
80
+ y: number[][] | number[];
81
+ /**
82
+ * Dense-output evaluator: the cubic-Hermite continuous extension `y(t)` for any
83
+ * `t ∈ [t0, T]` (clamped to that range). Returns the state in the same shape as
84
+ * `y` (scalar for a scalar DDE). C¹ and O(h⁴) between accepted steps.
85
+ */
86
+ yInterp: (t: number) => number[] | number;
87
+ }
88
+ /**
89
+ * Solve the constant-delay DDE `y'(t) = f(t, y(t), [y(t−τ₁), …])` on `[tspan[0],
90
+ * tspan[1]]` with a history `φ` and delays `τ_k`, by the method of steps (adaptive
91
+ * BS23 + cubic-Hermite continuous extension, step capped at `min(τ)`).
92
+ *
93
+ * @param f Forcing `f(t, y, yDelayed) → y'`. `yDelayed[k] = y(t − τ_k)`.
94
+ * @param tspan `[t0, T]` (forward integration; `T > t0`).
95
+ * @param history `φ(t)` for `t ≤ t0` — a function or a constant. `y(t0) = φ(t0)`.
96
+ * @param delays Positive constant delays `τ_k` (at least one).
97
+ * @param options See {@link SolveDDEOptions}.
98
+ * @returns `{ t, y, yInterp }` — `y` unwrapped to `number[]` for a scalar DDE.
99
+ *
100
+ * @example
101
+ * // y'(t) = −y(t−1), history φ ≡ 1 on t ≤ 0. Method-of-steps solution:
102
+ * // [0,1]: 1 − t, [1,2]: t²/2 − 2t + 3/2, …
103
+ * const sol = solveDDE((t, y, yd) => [-yd[0][0]], [0, 3], 1, [1]);
104
+ * sol.yInterp(2.5); // dense output at t = 2.5
105
+ */
106
+ export declare function solveDDE(f: DDEForcing, tspan: [number, number] | number[], history: DDEHistory, delays: number[], options?: SolveDDEOptions): DDESolution;
107
+ //# sourceMappingURL=solveDDE.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solveDDE.d.ts","sourceRoot":"","sources":["../../src/numeric/solveDDE.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAEH;;;;;GAKG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,KAAK,MAAM,EAAE,GAAG,MAAM,CAAC;AAE7F;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;AAEhF,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC9B,gFAAgF;IAChF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,4DAA4D;IAC5D,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,oFAAoF;IACpF,CAAC,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,CAAC;IACzB;;;;OAIG;IACH,OAAO,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,EAAE,GAAG,MAAM,CAAC;CAC3C;AAgDD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,QAAQ,CACtB,CAAC,EAAE,UAAU,EACb,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,EAAE,EAClC,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,MAAM,EAAE,EAChB,OAAO,GAAE,eAAoB,GAC5B,WAAW,CA8Kb"}
@@ -54,6 +54,23 @@ interface ODEOptions {
54
54
  * Forcing function type for ODE
55
55
  */
56
56
  type ForcingFunction = (t: MathNumericType, y: MathNumericType | MathArray) => MathNumericType | MathArray;
57
+ /**
58
+ * Return a solver for `A·x = b` reused across the 3–6 right-hand sides a single stiff step solves
59
+ * against the same iteration matrix (W for Rosenbrock, E for RODAS).
60
+ *
61
+ * Small systems (n < {@link LU_ROUTE_THRESHOLD}) use the allocation-light inline elimination.
62
+ * Large systems factor `A` **once** with the matrix `lu()` primitive (per
63
+ * project-two-decomposition-layers-prefer-matrix) and solve each RHS with `luSolve` — one O(n³)
64
+ * factorisation instead of the old inline's re-factorisation per RHS.
65
+ *
66
+ * Numerics are unchanged on the small path (identical inline code) and, on the large path, the
67
+ * matrix `lu()` uses the same partial-pivoting strategy and elimination arithmetic, so results
68
+ * match to rounding (well within the solver's `tol`). The one edge case — a singular iteration
69
+ * matrix — made the inline solve emit NaN/Inf (division by zero), which fails the embedded error
70
+ * test and rejects the step (h is then reduced); the matrix `lu()` throws "singular" instead, so
71
+ * we catch it and return a NaN vector to preserve that step-rejection behaviour.
72
+ */
73
+ export declare function _factorSolver(A: number[][], n: number): (b: number[]) => number[];
57
74
  /**
58
75
  * Rosenbrock stiff ODE solver — the linearly-implicit ode23s method (Shampine & Reichelt),
59
76
  * L-stable, with an embedded error estimate for adaptive stepping. Unlike the explicit RK23/RK45
@@ -1 +1 @@
1
- {"version":3,"file":"solveODE.d.ts","sourceRoot":"","sources":["../../src/numeric/solveODE.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,eAAe,EAAE,SAAS,EAAU,IAAI,EAAa,MAAM,aAAa,CAAC;AAkCvF;;;;;;;;;;;GAWG;AACH,UAAU,aAAa;IACrB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;IACjC,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,4FAA4F;AAC5F,UAAU,SAAS;IACjB,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,KAAK,MAAM,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,yEAAyE;AACzE,KAAK,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,KAAK,CAAC,aAAa,GAAG,SAAS,CAAC,CAAC;AAS9E;;GAEG;AACH,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,YAAY,GAAG,OAAO,GAAG,KAAK,GAAG,OAAO,CAAC;IACpE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,GAAG,CAA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,wBAAgB,UAAU,CACxB,CAAC,EAAE,eAAe,EAClB,KAAK,EAAE,OAAO,EAAE,EAChB,KAAK,EAAE,OAAO,EAAE,EAChB,OAAO,GAAE,UAAe,GACvB;IAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,CAAC,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,CA4HhC;AAED,eAAO,MAAM,cAAc,yDAusB1B,CAAC"}
@@ -11,6 +11,8 @@
11
11
  * @packageDocumentation
12
12
  */
13
13
  export { solveParabolicPDE, type SolveParabolicPDEOptions, type ParabolicPDESolution, type ParabolicBC, type SpaceCoefficient, type BoundaryDatum, type ParabolicSource, } from '../numeric/solveParabolicPDE.js';
14
+ export { solveDAE, type SolveDAEOptions, type DAESolution, type DAEDifferential, type DAEConstraint, type DAEJacobianBlocks, } from '../numeric/solveDAE.js';
15
+ export { solveDDE, type SolveDDEOptions, type DDESolution, type DDEForcing, type DDEHistory, } from '../numeric/solveDDE.js';
14
16
  type f64 = number;
15
17
  type i32 = number;
16
18
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"numeric.d.ts","sourceRoot":"","sources":["../../src/typed/numeric.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAQH,OAAO,EACL,iBAAiB,EACjB,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,eAAe,GACrB,MAAM,iCAAiC,CAAC;AAMzC,KAAK,GAAG,GAAG,MAAM,CAAC;AAClB,KAAK,GAAG,GAAG,MAAM,CAAC;AASlB;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,yDAAyD;IACzD,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,uCAAuC;IACvC,OAAO,CAAC,EAAE,GAAG,CAAC;CACf;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KA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CAAC;IAAC,CAAC,EAAE,GAAG,CAAA;CAAE,EAC5C,EAAE,EAAE;IAAE,IAAI,EAAE,GAAG,CAAC;IAAC,KAAK,EAAE,GAAG,CAAC;IAAC,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,GAAG,CAAA;CAAE,GACtD;IAAE,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CA+B9B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielsimonjr/mathts-functions",
3
- "version": "0.53.0",
3
+ "version": "0.55.0",
4
4
  "description": "Mathematical functions for MathTS - arithmetic, algebra, trigonometry, statistics, and more",
5
5
  "author": "Daniel Simon Jr.",
6
6
  "license": "MIT",