@danielsimonjr/mathts-functions 0.52.0 → 0.54.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 +403 -0
- package/dist/numeric/solveDAE.d.ts +134 -0
- package/dist/numeric/solveDAE.d.ts.map +1 -0
- package/dist/numeric/solveODE.d.ts +17 -0
- package/dist/numeric/solveODE.d.ts.map +1 -1
- package/dist/numeric/solveParabolicPDE.d.ts +100 -0
- package/dist/numeric/solveParabolicPDE.d.ts.map +1 -0
- package/dist/typed/numeric.d.ts +2 -1
- package/dist/typed/numeric.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -439,8 +439,10 @@ __export(typed_exports, {
|
|
|
439
439
|
smaller: () => smaller,
|
|
440
440
|
smallerEq: () => smallerEq,
|
|
441
441
|
solveBVP: () => solveBVP,
|
|
442
|
+
solveDAE: () => solveDAE,
|
|
442
443
|
solveODESystem: () => solveODESystem,
|
|
443
444
|
solvePDE: () => solvePDE,
|
|
445
|
+
solveParabolicPDE: () => solveParabolicPDE,
|
|
444
446
|
spectrogram: () => spectrogram,
|
|
445
447
|
sqrt: () => sqrt,
|
|
446
448
|
square: () => square,
|
|
@@ -13106,6 +13108,405 @@ function quad(f, a, b, opts) {
|
|
|
13106
13108
|
return panel(a, b, 0);
|
|
13107
13109
|
}
|
|
13108
13110
|
|
|
13111
|
+
// src/numeric/solveParabolicPDE.ts
|
|
13112
|
+
function asSpaceFn(c, dflt) {
|
|
13113
|
+
if (c === void 0) return () => dflt;
|
|
13114
|
+
return typeof c === "function" ? c : () => c;
|
|
13115
|
+
}
|
|
13116
|
+
function asTimeFn(g) {
|
|
13117
|
+
return typeof g === "function" ? g : () => g;
|
|
13118
|
+
}
|
|
13119
|
+
function solveParabolicPDE(options) {
|
|
13120
|
+
const { x0, x1, T, nx, u0, bcLeft, bcRight } = options;
|
|
13121
|
+
if (!(nx >= 3) || !Number.isInteger(nx)) {
|
|
13122
|
+
throw new Error("solveParabolicPDE: nx must be an integer \u2265 3");
|
|
13123
|
+
}
|
|
13124
|
+
if (!(x1 > x0)) {
|
|
13125
|
+
throw new Error("solveParabolicPDE: require x1 > x0");
|
|
13126
|
+
}
|
|
13127
|
+
if (!(T > 0)) {
|
|
13128
|
+
throw new Error("solveParabolicPDE: require T > 0");
|
|
13129
|
+
}
|
|
13130
|
+
const h = (x1 - x0) / (nx - 1);
|
|
13131
|
+
const D = asSpaceFn(options.diffusion, 0);
|
|
13132
|
+
const c = asSpaceFn(options.advection, 0);
|
|
13133
|
+
const f = options.source ?? (() => 0);
|
|
13134
|
+
const gL = asTimeFn(bcLeft.value);
|
|
13135
|
+
const gR = asTimeFn(bcRight.value);
|
|
13136
|
+
const x = new Array(nx);
|
|
13137
|
+
for (let i = 0; i < nx; i++) x[i] = x0 + i * h;
|
|
13138
|
+
const leftDirichlet = bcLeft.type === "dirichlet";
|
|
13139
|
+
const rightDirichlet = bcRight.type === "dirichlet";
|
|
13140
|
+
const freeIdx = [];
|
|
13141
|
+
if (!leftDirichlet) freeIdx.push(0);
|
|
13142
|
+
for (let i = 1; i < nx - 1; i++) freeIdx.push(i);
|
|
13143
|
+
if (!rightDirichlet) freeIdx.push(nx - 1);
|
|
13144
|
+
const m = freeIdx.length;
|
|
13145
|
+
const reconstruct = (t, U) => {
|
|
13146
|
+
const full = new Array(nx);
|
|
13147
|
+
if (leftDirichlet) full[0] = gL(t);
|
|
13148
|
+
if (rightDirichlet) full[nx - 1] = gR(t);
|
|
13149
|
+
for (let s = 0; s < m; s++) full[freeIdx[s]] = U[s];
|
|
13150
|
+
return full;
|
|
13151
|
+
};
|
|
13152
|
+
const rhs = (t, U) => {
|
|
13153
|
+
const full = reconstruct(t, U);
|
|
13154
|
+
const out = new Array(m);
|
|
13155
|
+
for (let s = 0; s < m; s++) {
|
|
13156
|
+
const i = freeIdx[s];
|
|
13157
|
+
const xi = x[i];
|
|
13158
|
+
let uxx;
|
|
13159
|
+
let ux;
|
|
13160
|
+
if (i === 0) {
|
|
13161
|
+
const g = gL(t);
|
|
13162
|
+
uxx = (2 * full[1] - 2 * full[0] - 2 * h * g) / (h * h);
|
|
13163
|
+
ux = g;
|
|
13164
|
+
} else if (i === nx - 1) {
|
|
13165
|
+
const g = gR(t);
|
|
13166
|
+
uxx = (2 * full[nx - 2] - 2 * full[nx - 1] + 2 * h * g) / (h * h);
|
|
13167
|
+
ux = g;
|
|
13168
|
+
} else {
|
|
13169
|
+
uxx = (full[i - 1] - 2 * full[i] + full[i + 1]) / (h * h);
|
|
13170
|
+
ux = (full[i + 1] - full[i - 1]) / (2 * h);
|
|
13171
|
+
}
|
|
13172
|
+
out[s] = D(xi) * uxx + c(xi) * ux + f(xi, t, full[i]);
|
|
13173
|
+
}
|
|
13174
|
+
return out;
|
|
13175
|
+
};
|
|
13176
|
+
const y0 = freeIdx.map((i) => u0(x[i]));
|
|
13177
|
+
const bdfOptions = {};
|
|
13178
|
+
if (options.tol !== void 0) bdfOptions.tol = options.tol;
|
|
13179
|
+
else bdfOptions.tol = 1e-6;
|
|
13180
|
+
if (options.maxStep !== void 0) bdfOptions.maxStep = options.maxStep;
|
|
13181
|
+
const sol = bdfSolve(rhs, [0, T], y0, bdfOptions);
|
|
13182
|
+
const stepT = sol.t;
|
|
13183
|
+
const stepY = sol.y;
|
|
13184
|
+
const requested = options.times;
|
|
13185
|
+
if (requested === void 0) {
|
|
13186
|
+
return { x, t: stepT.slice(), u: stepT.map((tk, k) => reconstruct(tk, stepY[k])) };
|
|
13187
|
+
}
|
|
13188
|
+
const u = requested.map((tq) => {
|
|
13189
|
+
const U = interpState(stepT, stepY, tq);
|
|
13190
|
+
return reconstruct(tq, U);
|
|
13191
|
+
});
|
|
13192
|
+
return { x, t: requested.slice(), u };
|
|
13193
|
+
}
|
|
13194
|
+
function interpState(stepT, stepY, tq) {
|
|
13195
|
+
const n = stepT.length;
|
|
13196
|
+
if (tq <= stepT[0]) return stepY[0].slice();
|
|
13197
|
+
if (tq >= stepT[n - 1]) return stepY[n - 1].slice();
|
|
13198
|
+
let lo = 0;
|
|
13199
|
+
let hi = n - 1;
|
|
13200
|
+
while (hi - lo > 1) {
|
|
13201
|
+
const mid = lo + hi >> 1;
|
|
13202
|
+
if (stepT[mid] <= tq) lo = mid;
|
|
13203
|
+
else hi = mid;
|
|
13204
|
+
}
|
|
13205
|
+
const t0 = stepT[lo];
|
|
13206
|
+
const t1 = stepT[lo + 1];
|
|
13207
|
+
const w = t1 === t0 ? 0 : (tq - t0) / (t1 - t0);
|
|
13208
|
+
const y0 = stepY[lo];
|
|
13209
|
+
const y1 = stepY[lo + 1];
|
|
13210
|
+
return y0.map((v, i) => v + w * (y1[i] - v));
|
|
13211
|
+
}
|
|
13212
|
+
|
|
13213
|
+
// src/numeric/solveDAE.ts
|
|
13214
|
+
function _arr(v) {
|
|
13215
|
+
return Array.isArray(v) ? v.slice() : [v];
|
|
13216
|
+
}
|
|
13217
|
+
function _evalArr(fn, t, y, z) {
|
|
13218
|
+
const r = fn(t, y, z);
|
|
13219
|
+
return Array.isArray(r) ? r : [r];
|
|
13220
|
+
}
|
|
13221
|
+
function _wrms(v, scale4) {
|
|
13222
|
+
let s = 0;
|
|
13223
|
+
for (let i = 0; i < v.length; i++) {
|
|
13224
|
+
const q = v[i] / scale4[i];
|
|
13225
|
+
s += q * q;
|
|
13226
|
+
}
|
|
13227
|
+
return Math.sqrt(s / v.length);
|
|
13228
|
+
}
|
|
13229
|
+
function _bdfCoeffs(nodes) {
|
|
13230
|
+
const m = nodes.length;
|
|
13231
|
+
const x0 = nodes[0];
|
|
13232
|
+
const c = new Array(m).fill(0);
|
|
13233
|
+
let diag2 = 0;
|
|
13234
|
+
for (let p = 1; p < m; p++) diag2 += 1 / (x0 - nodes[p]);
|
|
13235
|
+
c[0] = diag2;
|
|
13236
|
+
for (let j = 1; j < m; j++) {
|
|
13237
|
+
let val = 1 / (nodes[j] - x0);
|
|
13238
|
+
for (let p = 0; p < m; p++) {
|
|
13239
|
+
if (p === 0 || p === j) continue;
|
|
13240
|
+
val *= (x0 - nodes[p]) / (nodes[j] - nodes[p]);
|
|
13241
|
+
}
|
|
13242
|
+
c[j] = val;
|
|
13243
|
+
}
|
|
13244
|
+
return c;
|
|
13245
|
+
}
|
|
13246
|
+
function _polyExtrap(times, vals, tnew) {
|
|
13247
|
+
const p = times.length;
|
|
13248
|
+
const n = vals[0].length;
|
|
13249
|
+
const out = new Array(n).fill(0);
|
|
13250
|
+
for (let i = 0; i < p; i++) {
|
|
13251
|
+
let li = 1;
|
|
13252
|
+
for (let m = 0; m < p; m++) {
|
|
13253
|
+
if (m === i) continue;
|
|
13254
|
+
li *= (tnew - times[m]) / (times[i] - times[m]);
|
|
13255
|
+
}
|
|
13256
|
+
for (let d = 0; d < n; d++) out[d] += li * vals[i][d];
|
|
13257
|
+
}
|
|
13258
|
+
return out;
|
|
13259
|
+
}
|
|
13260
|
+
function _denseSolve(A, b) {
|
|
13261
|
+
const n = b.length;
|
|
13262
|
+
const M = A.map((r) => r.slice());
|
|
13263
|
+
const x = b.slice();
|
|
13264
|
+
for (let k = 0; k < n; k++) {
|
|
13265
|
+
let piv = k;
|
|
13266
|
+
for (let i = k + 1; i < n; i++) if (Math.abs(M[i][k]) > Math.abs(M[piv][k])) piv = i;
|
|
13267
|
+
if (Math.abs(M[piv][k]) < 1e-300) return new Array(n).fill(NaN);
|
|
13268
|
+
[M[k], M[piv]] = [M[piv], M[k]];
|
|
13269
|
+
[x[k], x[piv]] = [x[piv], x[k]];
|
|
13270
|
+
const akk = M[k][k];
|
|
13271
|
+
for (let i = k + 1; i < n; i++) {
|
|
13272
|
+
const factor2 = M[i][k] / akk;
|
|
13273
|
+
for (let j = k; j < n; j++) M[i][j] -= factor2 * M[k][j];
|
|
13274
|
+
x[i] -= factor2 * x[k];
|
|
13275
|
+
}
|
|
13276
|
+
}
|
|
13277
|
+
for (let i = n - 1; i >= 0; i--) {
|
|
13278
|
+
let s = x[i];
|
|
13279
|
+
for (let j = i + 1; j < n; j++) s -= M[i][j] * x[j];
|
|
13280
|
+
x[i] = s / M[i][i];
|
|
13281
|
+
}
|
|
13282
|
+
return x;
|
|
13283
|
+
}
|
|
13284
|
+
function _solveAlgebraic(g, t, y, zGuess, tol) {
|
|
13285
|
+
const na = zGuess.length;
|
|
13286
|
+
const z = zGuess.slice();
|
|
13287
|
+
for (let iter = 0; iter < 50; iter++) {
|
|
13288
|
+
const g0 = _evalArr(g, t, y, z);
|
|
13289
|
+
if (g0.length !== na) {
|
|
13290
|
+
throw new Error(
|
|
13291
|
+
`solveDAE: the constraint g must return ${na} value(s) (matching z0); got ${g0.length}`
|
|
13292
|
+
);
|
|
13293
|
+
}
|
|
13294
|
+
const J = Array.from({ length: na }, () => new Array(na));
|
|
13295
|
+
for (let j = 0; j < na; j++) {
|
|
13296
|
+
const eps = Math.max(1e-8, 1e-7 * Math.abs(z[j]));
|
|
13297
|
+
const zp = z.slice();
|
|
13298
|
+
zp[j] += eps;
|
|
13299
|
+
const gp = _evalArr(g, t, y, zp);
|
|
13300
|
+
for (let i = 0; i < na; i++) J[i][j] = (gp[i] - g0[i]) / eps;
|
|
13301
|
+
}
|
|
13302
|
+
const dz = _denseSolve(
|
|
13303
|
+
J,
|
|
13304
|
+
g0.map((v) => -v)
|
|
13305
|
+
);
|
|
13306
|
+
if (!dz.every((v) => Number.isFinite(v))) return null;
|
|
13307
|
+
let znorm = 0;
|
|
13308
|
+
let dnorm = 0;
|
|
13309
|
+
for (let i = 0; i < na; i++) {
|
|
13310
|
+
z[i] += dz[i];
|
|
13311
|
+
znorm += z[i] * z[i];
|
|
13312
|
+
dnorm += dz[i] * dz[i];
|
|
13313
|
+
}
|
|
13314
|
+
if (Math.sqrt(dnorm) <= tol * (1 + Math.sqrt(znorm))) {
|
|
13315
|
+
const gCheck = _evalArr(g, t, y, z);
|
|
13316
|
+
const res = Math.sqrt(gCheck.reduce((a, v) => a + v * v, 0));
|
|
13317
|
+
return res < 1e-6 ? z : null;
|
|
13318
|
+
}
|
|
13319
|
+
}
|
|
13320
|
+
return null;
|
|
13321
|
+
}
|
|
13322
|
+
function solveDAE(f, g, tspan, y0, z0, options = {}) {
|
|
13323
|
+
const t0 = tspan[0];
|
|
13324
|
+
const tf = tspan[1];
|
|
13325
|
+
if (!(typeof t0 === "number" && typeof tf === "number")) {
|
|
13326
|
+
throw new Error("solveDAE: tspan must be [t0, T] numbers");
|
|
13327
|
+
}
|
|
13328
|
+
if (!(tf > t0)) {
|
|
13329
|
+
throw new Error("solveDAE: require T > t0 (forward integration)");
|
|
13330
|
+
}
|
|
13331
|
+
const yScalar = !Array.isArray(y0);
|
|
13332
|
+
const zScalar = z0 === void 0 || !Array.isArray(z0);
|
|
13333
|
+
const y0v = _arr(y0);
|
|
13334
|
+
const z0v = z0 === void 0 ? [0] : _arr(z0);
|
|
13335
|
+
const nd = y0v.length;
|
|
13336
|
+
const na = z0v.length;
|
|
13337
|
+
const n = nd + na;
|
|
13338
|
+
const rtol = options.tol ?? 1e-6;
|
|
13339
|
+
const atol = options.atol ?? rtol * 1e-3;
|
|
13340
|
+
const maxOrder = options.maxOrder ?? 2;
|
|
13341
|
+
const maxIter = options.maxIter ?? 1e5;
|
|
13342
|
+
const maxStep = options.maxStep ?? Infinity;
|
|
13343
|
+
const minStepOpt = options.minStep ?? 0;
|
|
13344
|
+
const EPS5 = Number.EPSILON;
|
|
13345
|
+
const newtonTol = options.newtonTol ?? Math.max(10 * EPS5 / rtol, Math.min(0.03, Math.sqrt(rtol)));
|
|
13346
|
+
const span = tf - t0;
|
|
13347
|
+
const yOf = (w2) => w2.slice(0, nd);
|
|
13348
|
+
const zOf = (w2) => w2.slice(nd);
|
|
13349
|
+
const z0consistent = _solveAlgebraic(g, t0, y0v, z0v, newtonTol);
|
|
13350
|
+
if (z0consistent === null) {
|
|
13351
|
+
throw new Error(
|
|
13352
|
+
"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)."
|
|
13353
|
+
);
|
|
13354
|
+
}
|
|
13355
|
+
let t = t0;
|
|
13356
|
+
let w = [...y0v, ...z0consistent];
|
|
13357
|
+
const histT = [t];
|
|
13358
|
+
const histW = [w.slice()];
|
|
13359
|
+
const tOut = [t];
|
|
13360
|
+
const yOut = [yOf(w)];
|
|
13361
|
+
const zOut = [zOf(w)];
|
|
13362
|
+
let h;
|
|
13363
|
+
if (options.firstStep !== void 0) {
|
|
13364
|
+
h = Math.abs(options.firstStep);
|
|
13365
|
+
} else {
|
|
13366
|
+
const f0 = _evalArr(f, t0, y0v, z0consistent);
|
|
13367
|
+
const nrm = (v) => Math.sqrt(v.reduce((a, x) => a + x * x, 0) / Math.max(1, v.length));
|
|
13368
|
+
const d0 = nrm(y0v);
|
|
13369
|
+
const d1 = nrm(f0);
|
|
13370
|
+
h = Math.min(d0 < 1e-5 || d1 < 1e-5 ? 1e-3 : 0.01 * (d0 / d1), span);
|
|
13371
|
+
}
|
|
13372
|
+
h = Math.min(h, maxStep);
|
|
13373
|
+
function makeResidual(tNew, c0, histSum) {
|
|
13374
|
+
return (wc) => {
|
|
13375
|
+
const y = yOf(wc);
|
|
13376
|
+
const z = zOf(wc);
|
|
13377
|
+
const fv = _evalArr(f, tNew, y, z);
|
|
13378
|
+
const gv = _evalArr(g, tNew, y, z);
|
|
13379
|
+
if (fv.length !== nd) {
|
|
13380
|
+
throw new Error(`solveDAE: f must return ${nd} value(s) (matching y0); got ${fv.length}`);
|
|
13381
|
+
}
|
|
13382
|
+
if (gv.length !== na) {
|
|
13383
|
+
throw new Error(`solveDAE: g must return ${na} value(s) (matching z0); got ${gv.length}`);
|
|
13384
|
+
}
|
|
13385
|
+
const R = new Array(n);
|
|
13386
|
+
for (let i = 0; i < nd; i++) R[i] = c0 * wc[i] + histSum[i] - fv[i];
|
|
13387
|
+
for (let i = 0; i < na; i++) R[nd + i] = gv[i];
|
|
13388
|
+
return R;
|
|
13389
|
+
};
|
|
13390
|
+
}
|
|
13391
|
+
function newtonMatrix(tNew, wc, c0, residual, R0) {
|
|
13392
|
+
if (options.jacobian) {
|
|
13393
|
+
const { fy, fz, gy, gz } = options.jacobian(tNew, yOf(wc), zOf(wc));
|
|
13394
|
+
const J2 = Array.from({ length: n }, () => new Array(n).fill(0));
|
|
13395
|
+
for (let i = 0; i < nd; i++) {
|
|
13396
|
+
for (let j = 0; j < nd; j++) J2[i][j] = (i === j ? c0 : 0) - fy[i][j];
|
|
13397
|
+
for (let j = 0; j < na; j++) J2[i][nd + j] = -fz[i][j];
|
|
13398
|
+
}
|
|
13399
|
+
for (let i = 0; i < na; i++) {
|
|
13400
|
+
for (let j = 0; j < nd; j++) J2[nd + i][j] = gy[i][j];
|
|
13401
|
+
for (let j = 0; j < na; j++) J2[nd + i][nd + j] = gz[i][j];
|
|
13402
|
+
}
|
|
13403
|
+
return J2;
|
|
13404
|
+
}
|
|
13405
|
+
const J = Array.from({ length: n }, () => new Array(n));
|
|
13406
|
+
for (let col = 0; col < n; col++) {
|
|
13407
|
+
const eps = Math.max(1e-8, 1e-7 * Math.abs(wc[col]));
|
|
13408
|
+
const wp = wc.slice();
|
|
13409
|
+
wp[col] += eps;
|
|
13410
|
+
const Rp = residual(wp);
|
|
13411
|
+
for (let row2 = 0; row2 < n; row2++) J[row2][col] = (Rp[row2] - R0[row2]) / eps;
|
|
13412
|
+
}
|
|
13413
|
+
return J;
|
|
13414
|
+
}
|
|
13415
|
+
let iter = 0;
|
|
13416
|
+
while (t < tf && iter < maxIter) {
|
|
13417
|
+
iter++;
|
|
13418
|
+
if (t + h > tf) h = tf - t;
|
|
13419
|
+
const minStep = Math.max(minStepOpt, 1e-13 * Math.max(1, Math.abs(t)));
|
|
13420
|
+
const order = Math.max(1, Math.min(maxOrder, histT.length - 1));
|
|
13421
|
+
let accepted = false;
|
|
13422
|
+
let wNew = w;
|
|
13423
|
+
let acceptedTime = t;
|
|
13424
|
+
while (!accepted) {
|
|
13425
|
+
if (h < minStep) {
|
|
13426
|
+
throw new Error(
|
|
13427
|
+
"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."
|
|
13428
|
+
);
|
|
13429
|
+
}
|
|
13430
|
+
const tNew = t + h;
|
|
13431
|
+
const nodes = [tNew];
|
|
13432
|
+
for (let j = 0; j < order; j++) nodes.push(histT[j]);
|
|
13433
|
+
const coeffs = _bdfCoeffs(nodes);
|
|
13434
|
+
const c0 = coeffs[0];
|
|
13435
|
+
const histSum = new Array(nd).fill(0);
|
|
13436
|
+
for (let j = 1; j <= order; j++) {
|
|
13437
|
+
const cj = coeffs[j];
|
|
13438
|
+
const wj = histW[j - 1];
|
|
13439
|
+
for (let i = 0; i < nd; i++) histSum[i] += cj * wj[i];
|
|
13440
|
+
}
|
|
13441
|
+
const residual = makeResidual(tNew, c0, histSum);
|
|
13442
|
+
let wPred;
|
|
13443
|
+
if (histT.length >= order + 1) {
|
|
13444
|
+
wPred = _polyExtrap(histT.slice(0, order + 1), histW.slice(0, order + 1), tNew);
|
|
13445
|
+
} else {
|
|
13446
|
+
wPred = w.slice();
|
|
13447
|
+
const fn = _evalArr(f, histT[0], yOf(w), zOf(w));
|
|
13448
|
+
for (let i = 0; i < nd; i++) wPred[i] = w[i] + h * fn[i];
|
|
13449
|
+
}
|
|
13450
|
+
const wc = wPred.slice();
|
|
13451
|
+
let converged = false;
|
|
13452
|
+
const scale4 = new Array(n);
|
|
13453
|
+
for (let it = 0; it < 12; it++) {
|
|
13454
|
+
const R0 = residual(wc);
|
|
13455
|
+
const J = newtonMatrix(tNew, wc, c0, residual, R0);
|
|
13456
|
+
const solve2 = _factorSolver(J, n);
|
|
13457
|
+
const dw = solve2(R0.map((v) => -v));
|
|
13458
|
+
if (!dw.every((v) => Number.isFinite(v))) break;
|
|
13459
|
+
for (let i = 0; i < n; i++) {
|
|
13460
|
+
wc[i] += dw[i];
|
|
13461
|
+
scale4[i] = atol + rtol * Math.abs(wc[i]);
|
|
13462
|
+
}
|
|
13463
|
+
if (_wrms(dw, scale4) <= newtonTol) {
|
|
13464
|
+
converged = true;
|
|
13465
|
+
break;
|
|
13466
|
+
}
|
|
13467
|
+
}
|
|
13468
|
+
if (!converged) {
|
|
13469
|
+
h *= 0.5;
|
|
13470
|
+
continue;
|
|
13471
|
+
}
|
|
13472
|
+
for (let i = 0; i < n; i++) scale4[i] = atol + rtol * Math.abs(wc[i]);
|
|
13473
|
+
const errNorm = _wrms(
|
|
13474
|
+
wc.map((v, i) => v - wPred[i]),
|
|
13475
|
+
scale4
|
|
13476
|
+
);
|
|
13477
|
+
if (errNorm <= 1 || h <= minStep) {
|
|
13478
|
+
wNew = wc;
|
|
13479
|
+
acceptedTime = tNew;
|
|
13480
|
+
accepted = true;
|
|
13481
|
+
}
|
|
13482
|
+
const factor2 = errNorm === 0 ? 4 : 0.9 * Math.pow(errNorm, -1 / (order + 1));
|
|
13483
|
+
h *= Math.min(4, Math.max(0.2, factor2));
|
|
13484
|
+
if (h > maxStep) h = maxStep;
|
|
13485
|
+
}
|
|
13486
|
+
w = wNew;
|
|
13487
|
+
t = acceptedTime;
|
|
13488
|
+
histT.unshift(t);
|
|
13489
|
+
histW.unshift(w.slice());
|
|
13490
|
+
if (histT.length > maxOrder + 2) {
|
|
13491
|
+
histT.pop();
|
|
13492
|
+
histW.pop();
|
|
13493
|
+
}
|
|
13494
|
+
tOut.push(t);
|
|
13495
|
+
yOut.push(yOf(w));
|
|
13496
|
+
zOut.push(zOf(w));
|
|
13497
|
+
}
|
|
13498
|
+
if (iter >= maxIter) {
|
|
13499
|
+
throw new Error(
|
|
13500
|
+
"solveDAE: maximum number of steps reached \u2014 try loosening tol or raising maxIter"
|
|
13501
|
+
);
|
|
13502
|
+
}
|
|
13503
|
+
return {
|
|
13504
|
+
t: tOut,
|
|
13505
|
+
y: yScalar ? yOut.map((v) => v[0]) : yOut,
|
|
13506
|
+
z: zScalar ? zOut.map((v) => v[0]) : zOut
|
|
13507
|
+
};
|
|
13508
|
+
}
|
|
13509
|
+
|
|
13109
13510
|
// src/typed/numeric.ts
|
|
13110
13511
|
var NUMERIC_WASM_THRESHOLD = 16;
|
|
13111
13512
|
function findRoot(f, a, b, opts) {
|
|
@@ -54239,9 +54640,11 @@ export {
|
|
|
54239
54640
|
solve,
|
|
54240
54641
|
solveBVP,
|
|
54241
54642
|
solveBanded,
|
|
54643
|
+
solveDAE,
|
|
54242
54644
|
solveODE,
|
|
54243
54645
|
solveODESystem,
|
|
54244
54646
|
solvePDE,
|
|
54647
|
+
solveParabolicPDE,
|
|
54245
54648
|
sort,
|
|
54246
54649
|
sosfilt,
|
|
54247
54650
|
sparse,
|
|
@@ -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"}
|
|
@@ -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,EA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AAE,CAAA;CAAE,CA4HhC;AAED,eAAO,MAAM,cAAc,yDAusB1B,CAAC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* General 1-D parabolic PDE solver via the method of lines (MOL).
|
|
3
|
+
*
|
|
4
|
+
* Solves
|
|
5
|
+
*
|
|
6
|
+
* u_t = D(x)·u_xx + c(x)·u_x + f(x, t, u)
|
|
7
|
+
*
|
|
8
|
+
* on `x ∈ [x0, x1]`, `t ∈ [0, T]`, with initial condition `u(x,0) = u0(x)` and
|
|
9
|
+
* Dirichlet or Neumann boundary conditions at each end.
|
|
10
|
+
*
|
|
11
|
+
* The spatial domain is discretised on a uniform grid of `nx` points (spacing
|
|
12
|
+
* `h`). The second derivative uses the standard central second difference
|
|
13
|
+
* `u_xx ≈ (u_{i-1} − 2u_i + u_{i+1})/h²` and the first derivative the central
|
|
14
|
+
* difference `u_x ≈ (u_{i+1} − u_{i-1})/(2h)` — both second-order accurate, so
|
|
15
|
+
* the scheme converges as `O(h²)` in space. This semi-discretisation turns the
|
|
16
|
+
* PDE into a **stiff** ODE system `U'(t) = RHS(t, U)` in the nodal values (the
|
|
17
|
+
* diffusion term gives the Jacobian eigenvalues ≈ −D/h², very stiff for fine
|
|
18
|
+
* grids), which is integrated with the variable-order BDF stiff solver
|
|
19
|
+
* ({@link bdfSolve}) — implicit, so there is no explicit-Euler CFL step cap.
|
|
20
|
+
*
|
|
21
|
+
* This is a NEW public entry point; the legacy explicit-Euler heat-only
|
|
22
|
+
* {@link solvePDE} is intentionally left unchanged.
|
|
23
|
+
*
|
|
24
|
+
* @packageDocumentation
|
|
25
|
+
*/
|
|
26
|
+
/** A spatially-varying coefficient `D(x)` / `c(x)`; a plain number means constant. */
|
|
27
|
+
export type SpaceCoefficient = number | ((x: number) => number);
|
|
28
|
+
/** A time-varying boundary datum `g(t)`; a plain number means constant in time. */
|
|
29
|
+
export type BoundaryDatum = number | ((t: number) => number);
|
|
30
|
+
/**
|
|
31
|
+
* Boundary condition at one end of the domain.
|
|
32
|
+
* - `dirichlet`: prescribes the value `u = g(t)`.
|
|
33
|
+
* - `neumann`: prescribes the spatial derivative `u_x = g(t)` (a second-order
|
|
34
|
+
* ghost-node closure is used so overall `O(h²)` accuracy is preserved).
|
|
35
|
+
*/
|
|
36
|
+
export interface ParabolicBC {
|
|
37
|
+
type: 'dirichlet' | 'neumann';
|
|
38
|
+
value: BoundaryDatum;
|
|
39
|
+
}
|
|
40
|
+
/** Reaction / source term `f(x, t, u)`. */
|
|
41
|
+
export type ParabolicSource = (x: number, t: number, u: number) => number;
|
|
42
|
+
/** Options for {@link solveParabolicPDE}. */
|
|
43
|
+
export interface SolveParabolicPDEOptions {
|
|
44
|
+
/** Diffusion coefficient `D(x)` (constant if a number). Must be > 0 for a well-posed problem. */
|
|
45
|
+
diffusion: SpaceCoefficient;
|
|
46
|
+
/** Advection coefficient `c(x)` in `c(x)·u_x` (default 0 — pure diffusion/reaction). */
|
|
47
|
+
advection?: SpaceCoefficient;
|
|
48
|
+
/** Reaction/source `f(x, t, u)` (default 0). */
|
|
49
|
+
source?: ParabolicSource;
|
|
50
|
+
/** Left domain endpoint. */
|
|
51
|
+
x0: number;
|
|
52
|
+
/** Right domain endpoint (`x1 > x0`). */
|
|
53
|
+
x1: number;
|
|
54
|
+
/** Final integration time (`T > 0`). */
|
|
55
|
+
T: number;
|
|
56
|
+
/** Number of grid points including both boundaries (`nx ≥ 3`). Spacing `h = (x1−x0)/(nx−1)`. */
|
|
57
|
+
nx: number;
|
|
58
|
+
/** Initial condition `u0(x)`. */
|
|
59
|
+
u0: (x: number) => number;
|
|
60
|
+
/** Left (`x = x0`) boundary condition. */
|
|
61
|
+
bcLeft: ParabolicBC;
|
|
62
|
+
/** Right (`x = x1`) boundary condition. */
|
|
63
|
+
bcRight: ParabolicBC;
|
|
64
|
+
/** Relative tolerance for the BDF integrator (default 1e-6). */
|
|
65
|
+
tol?: number;
|
|
66
|
+
/** Maximum BDF step size (default: no cap). */
|
|
67
|
+
maxStep?: number;
|
|
68
|
+
/**
|
|
69
|
+
* Explicit output times at which to report the solution (each in `[0, T]`).
|
|
70
|
+
* When omitted the solver's own accepted time steps are returned (the last is
|
|
71
|
+
* exactly `T`). When given, the free-node states are linearly interpolated
|
|
72
|
+
* between accepted steps and the boundary nodes evaluated exactly at each time.
|
|
73
|
+
*/
|
|
74
|
+
times?: number[];
|
|
75
|
+
}
|
|
76
|
+
/** Solution returned by {@link solveParabolicPDE}. */
|
|
77
|
+
export interface ParabolicPDESolution {
|
|
78
|
+
/** The `nx` spatial grid points. */
|
|
79
|
+
x: number[];
|
|
80
|
+
/** The output times (length `nt`). */
|
|
81
|
+
t: number[];
|
|
82
|
+
/** Solution values `u[timeIndex][spaceIndex]`, full grid including boundary nodes. */
|
|
83
|
+
u: number[][];
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Solve the general 1-D parabolic PDE `u_t = D(x)·u_xx + c(x)·u_x + f(x, t, u)`
|
|
87
|
+
* by the method of lines onto the BDF stiff ODE solver.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* // Heat equation u_t = u_xx, u(x,0)=sin(πx), Dirichlet 0 → u = e^{−π²t} sin(πx)
|
|
91
|
+
* const sol = solveParabolicPDE({
|
|
92
|
+
* diffusion: 1, x0: 0, x1: 1, T: 0.1, nx: 81,
|
|
93
|
+
* u0: (x) => Math.sin(Math.PI * x),
|
|
94
|
+
* bcLeft: { type: 'dirichlet', value: 0 },
|
|
95
|
+
* bcRight: { type: 'dirichlet', value: 0 },
|
|
96
|
+
* });
|
|
97
|
+
* // sol.u[sol.t.length - 1] ≈ e^{−π²·0.1} sin(πx)
|
|
98
|
+
*/
|
|
99
|
+
export declare function solveParabolicPDE(options: SolveParabolicPDEOptions): ParabolicPDESolution;
|
|
100
|
+
//# sourceMappingURL=solveParabolicPDE.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solveParabolicPDE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;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,sDAAsD;AACtD,MAAM,WAAW,oBAAoB;IACnC,oCAAoC;IACpC,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,sCAAsC;IACtC,CAAC,EAAE,MAAM,EAAE,CAAC;IACZ,sFAAsF;IACtF,CAAC,EAAE,MAAM,EAAE,EAAE,CAAC;CACf;AAaD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,oBAAoB,CA8FzF"}
|
package/dist/typed/numeric.d.ts
CHANGED
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @packageDocumentation
|
|
12
12
|
*/
|
|
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';
|
|
13
15
|
type f64 = number;
|
|
14
16
|
type i32 = number;
|
|
15
17
|
/**
|
|
@@ -435,5 +437,4 @@ export declare function solvePDE(pde: {
|
|
|
435
437
|
x: number[];
|
|
436
438
|
u: number[];
|
|
437
439
|
};
|
|
438
|
-
export {};
|
|
439
440
|
//# sourceMappingURL=numeric.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"numeric.d.ts","sourceRoot":"","sources":["../../src/typed/numeric.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
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,EA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