35 of 40 focal problems use RatMath for a calculation or a substantive step.
Direct calculation
31 · 77.5%
Assisted
4 · 10%
Worked by hand
5 · 12.5%
Using the packages
The analytic library can build coefficients and approximations for many textbook bases. Users must specify period and normalization and distinguish mean-square convergence from pointwise convergence.
Calculator interface
Display the basis, period and normalization beside the coefficients. Link a partial sum, an error-energy plot and the reconstructed signal with sampling frequency shown.
Each of the 40 focal problems has equal weight. Direct means the displayed package calculation answers the computational question after the inputs are set up. Assisted means it contributes a step and the worked solution supplies essential reasoning, interpretation or selection. Worked by hand means the guide relies on a construction, argument or judgment for that task. The helpful share combines direct and assisted days. Courses and instructors assign different mixes of problems. The percentages describe this syllabus.
Classroom inputs and practical limits
35 of 40 days include a checked executable example. On 16 days the measured size sweep exercises a named API used in the lesson. Each day identifies its tested inputs and the mathematical property checked. Hand-worked days give the input scale and the argument to verify.
Ranges across the five units
Days 1–8 · Fourier series. Periodic elementary functions, often 1–10 harmonics and one specified period and normalization.
Unit benchmark · analytic.fourier.exact, partial-sum order. Largest passing sample 16 (2,617 ms, 131.8 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (2,617 ms).
Days 9–16 · Energy and convergence. Inner products of low-frequency modes and partial sums typically through order 10; mean-square and pointwise errors differ.
Unit benchmark · analytic.fourier.exact, partial-sum order. Largest passing sample 16 (2,617 ms, 131.8 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (2,617 ms).
Days 17–24 · Discrete spectra. About 2–16 samples in worked transforms, often powers of two for FFT examples. Sampling rate and aliasing are part of the data.
Unit benchmark · analytic.dft, sample count. Largest passing sample 256 (134 ms, 91.3 MiB peak process RSS). The first sampled passing call above 100 ms used 256 (134 ms). The runs did not locate a ceiling for this family.
Days 25–32 · Transforms and convolution. One-dimensional transform pairs or convolutions with one or two parameters and a specified convergence convention.
Unit benchmark · symbolic.integrate, degree. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family.
Days 33–40 · Eigenfunction expansions. Separation on a simple interval or disk, typically 1–16 eigenmodes and a few evaluation points.
Unit benchmark · analytic.heat, requested sine terms. Largest passing sample 16 (1,510 ms, 127.2 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (1,510 ms).
Find the Fourier series of the square wave on , on , period 2, up to .
Worked solution
is odd, so only sines: , i.e. for odd . , with .
Using RatMath
Use the period or sample convention shown. Keep the normalization when converting a coefficient or transform value back to the original signal.
JavaScript module
import * as analytic from "@ratmath/analytic";
const F = analytic.fourier("-1 if -1:x:!0; 1 if 0:x:1", [-1, 1], { terms: 3 }).exact();
console.log([F.b[1], F.b[2], F.b[3]]);
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Periodic elementary functions, often 1–10 harmonics and one specified period and normalization.
For this problem type. Keep about 2–16 harmonics, nodes or modes in a worked example. For a transform specify interval, frequency convention and sampling rate.
Focal example. The code above passed its displayed check in 65.12 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Same API, measured input family.analytic.fourier.exact · partial-sum order. Baseline test points across courses 1, 2, 4, 8. For odd f(x)=x, every cosine coefficient vanishes, including the constant term.
Practical limit. Largest passing sample 16 (2,617 ms, 131.8 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (2,617 ms). Check enclosure widths as well as inclusion of the target. High harmonics require increasingly oscillatory integrals.
Measured times, memory and outcomes
partial-sum order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
32.79
89.7
2
Baseline
Passed
109
90.9
4
Baseline
Passed
215
91
8
Baseline
Passed
764
92.7
16
Stretch
Passed
2,617
131.8
32
Stretch
Time cutoff
—
133.5
64
Stretch
Time cutoff
—
134.2
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.fourier · 4 passing test cases, 5 distinct argument descriptions
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Periodic elementary functions, often 1–10 harmonics and one specified period and normalization.
For this problem type. Keep about 2–16 harmonics, nodes or modes in a worked example. For a transform specify interval, frequency convention and sampling rate.
Focal example. The code above passed its displayed check in 75.46 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Same API, measured input family.analytic.fourier.exact · partial-sum order. Baseline test points across courses 1, 2, 4, 8. For odd f(x)=x, every cosine coefficient vanishes, including the constant term.
Practical limit. Largest passing sample 16 (2,617 ms, 131.8 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (2,617 ms). Check enclosure widths as well as inclusion of the target. High harmonics require increasingly oscillatory integrals.
Measured times, memory and outcomes
partial-sum order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
32.79
89.7
2
Baseline
Passed
109
90.9
4
Baseline
Passed
215
91
8
Baseline
Passed
764
92.7
16
Stretch
Passed
2,617
131.8
32
Stretch
Time cutoff
—
133.5
64
Stretch
Time cutoff
—
134.2
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.fourier · 4 passing test cases, 5 distinct argument descriptions
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Periodic elementary functions, often 1–10 harmonics and one specified period and normalization.
For this problem type. Keep about 2–16 harmonics, nodes or modes in a worked example. For a transform specify interval, frequency convention and sampling rate.
Focal example. The code above passed its displayed check in 42.14 ms on Node.
Same API, measured input family.analytic.fourier.exact · partial-sum order. Baseline test points across courses 1, 2, 4, 8. For odd f(x)=x, every cosine coefficient vanishes, including the constant term.
Practical limit. Largest passing sample 16 (2,617 ms, 131.8 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (2,617 ms). Check enclosure widths as well as inclusion of the target. High harmonics require increasingly oscillatory integrals.
Measured times, memory and outcomes
partial-sum order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
32.79
89.7
2
Baseline
Passed
109
90.9
4
Baseline
Passed
215
91
8
Baseline
Passed
764
92.7
16
Stretch
Passed
2,617
131.8
32
Stretch
Time cutoff
—
133.5
64
Stretch
Time cutoff
—
134.2
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.fourier · 4 passing test cases, 5 distinct argument descriptions
A period-two square wave equals −1 on (−1,0) and +1 on (0,1). To what value does its Fourier series converge at the origin?
Worked solution
To the average of the one-sided limits, (every ).
Using RatMath
Use the jump-average theorem for the infinite series. The finite Fourier evaluation illustrates the value at this point.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.fourier("-1 if -1:x:!0; 1 if 0:x:1", [-1, 1], { terms: 9 }).exact().value(0));
Checked output
-0.00000000004839537745:0.00000000004839537745
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Periodic elementary functions, often 1–10 harmonics and one specified period and normalization.
For this problem type. Keep about 2–16 harmonics, nodes or modes in a worked example. For a transform specify interval, frequency convention and sampling rate.
Focal example. The code above passed its displayed check in 706 ms on Node.
Same API, measured input family.analytic.fourier.exact · partial-sum order. Baseline test points across courses 1, 2, 4, 8. For odd f(x)=x, every cosine coefficient vanishes, including the constant term.
Practical limit. Largest passing sample 16 (2,617 ms, 131.8 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (2,617 ms). Check enclosure widths as well as inclusion of the target. High harmonics require increasingly oscillatory integrals.
Measured times, memory and outcomes
partial-sum order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
32.79
89.7
2
Baseline
Passed
109
90.9
4
Baseline
Passed
215
91
8
Baseline
Passed
764
92.7
16
Stretch
Passed
2,617
131.8
32
Stretch
Time cutoff
—
133.5
64
Stretch
Time cutoff
—
134.2
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.fourier · 4 passing test cases, 5 distinct argument descriptions
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(
[symbolic.integrate("sin(2x)*sin(3x)", "x", { from: "-pi", to: "pi" }).value, symbolic.integrate("sin(2x)^2", "x", { from: "-pi", to: "pi" }).value]
);
Checked output
[0, pi]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Periodic elementary functions, often 1–10 harmonics and one specified period and normalization.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 219 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
const PRINT = console.log;
const F = symbolic.integrate("sin(x)^3", "x");
PRINT(F);
console.log(String(symbolic.equal(String(F.result), "-cos(x) + cos(x)^3/3")));
Checked output
equal (normal form, after the rules the assumptions allow)
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Periodic elementary functions, often 1–10 harmonics and one specified period and normalization.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 3.48 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
symbolic.equal · 8 passing test cases, 28 distinct argument descriptions
{type="op", op="-", args=[Object, Object] (n=2)}, "x*exp(x)", {assume={x="x > 1"}} or {type="op", op="+", args=[Object, Object] (n=2)}, "1/(x^2+1)^2", {assume={x="x > 1"}} · every result differentiates back to the integrand
A signal has value 3 throughout one period. What is its constant Fourier-series term?
Worked solution
The mean is 3. In the convention a₀/2 this means a₀=6.
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`2*3`));
Checked output
6
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Periodic elementary functions, often 1–10 harmonics and one specified period and normalization.
Focal example. The code above passed its displayed check in 0.186 ms on Node.
Same arithmetic expression. Replaced its first numeral 2 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.R · whole-number operand. Baseline test points across courses 0, 1, 10, 20, 100, 1,000, 1,000,000. (n+7)(n−3) by independent BigInt arithmetic.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 9,007,199,254,740,991 (1.67 ms, 75.3 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact integer arithmetic grows with operand bit length. Enter large integers as decimal strings or BigInts before any JavaScript Number conversion.
Measured times, memory and outcomes
whole-number operand · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
1.75
75
1
Baseline
Passed
1.70
75.7
10
Baseline
Passed
1.78
75.1
20
Baseline
Passed
1.88
75.4
100
Baseline
Passed
1.55
75.4
1,000
Baseline
Passed
1.36
75.3
1,000,000
Baseline
Passed
1.39
74.8
1,000,000,000
Stretch
Passed
1.69
76.3
9,007,199,254,740,991
Stretch
Passed
1.67
75.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
Which coefficients vanish when a function on [0,L] is extended evenly to [−L,L]?
Worked solution
Every sine coefficient vanishes since the product of the even extension with sine is odd.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Periodic elementary functions, often 1–10 harmonics and one specified period and normalization.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 09 / 40 · Energy and convergence
Parseval's identity
Direct calculation@ratmath/symbolic
Problem
Use Parseval's identity for on to find .
Worked solution
, so .
Using RatMath
Pass the integrand and variable separately. Finite bounds request a definite integral. For an antiderivative, differentiate the proposed expression on its domain.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
console.log(
[symbolic.integrate("x^2", "x", { from: -1, to: 1 }).value, symbolic.sum("4/(n^2*pi^2)", "n", 1, "inf").value, symbolic.sum("1/n^2", "n", 1, "inf").value]
);
Checked output
[2/3, 2/3, pi^2/6]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Inner products of low-frequency modes and partial sums typically through order 10; mean-square and pointwise errors differ.
For this problem type. Use a low-degree or elementary integrand and one to three integration variables, with one interval per dimension or a few piecewise bounds.
Focal example. The code above passed its displayed check in 23.05 ms on Node.
Same API, measured input family.symbolic.integrate · degree. Baseline test points across courses 0, 1, 2, 5, 10. The integral of x^n over [0,1] is 1/(n+1).
Practical limit. Largest passing sample 500 (195 ms, 88.7 MiB peak process RSS). The first sampled passing call above 100 ms used 500 (195 ms). The runs did not locate a ceiling for this family. Polynomial primitives are a favorable case. Singular endpoints, non-elementary primitives and unevaluated integrals need separate treatment.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
5.98
75.7
1
Baseline
Passed
8.66
75.9
2
Baseline
Passed
7.14
75.7
5
Baseline
Passed
9.22
75.5
10
Baseline
Passed
8.48
75.8
30
Stretch
Passed
56.11
88.9
100
Stretch
Passed
78.06
88.4
500
Stretch
Passed
195
88.7
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
symbolic.integrate · 11 passing test cases, 47 distinct argument descriptions
For on , find the mean square error of the 3-term Fourier sum .
Worked solution
By Bessel's equality, . Half of that is .
Using RatMath
Use the period or sample convention shown. Keep the normalization when converting a coefficient or transform value back to the original signal.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.fourier("x", [-1, 1], { terms: 3 }).exact().meanSquareError());
Checked output
0.05751455563627443977:0.0575145556456395458
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Inner products of low-frequency modes and partial sums typically through order 10; mean-square and pointwise errors differ.
For this problem type. Keep about 2–16 harmonics, nodes or modes in a worked example. For a transform specify interval, frequency convention and sampling rate.
Focal example. The code above passed its displayed check in 88.52 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Same API, measured input family.analytic.fourier.exact · partial-sum order. Baseline test points across courses 1, 2, 4, 8. For odd f(x)=x, every cosine coefficient vanishes, including the constant term.
Practical limit. Largest passing sample 16 (2,617 ms, 131.8 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (2,617 ms). Check enclosure widths as well as inclusion of the target. High harmonics require increasingly oscillatory integrals.
Measured times, memory and outcomes
partial-sum order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
32.79
89.7
2
Baseline
Passed
109
90.9
4
Baseline
Passed
215
91
8
Baseline
Passed
764
92.7
16
Stretch
Passed
2,617
131.8
32
Stretch
Time cutoff
—
133.5
64
Stretch
Time cutoff
—
134.2
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.fourier · 4 passing test cases, 5 distinct argument descriptions
Apply Gram–Schmidt to , (orthogonal, not yet normalised).
Worked solution
; .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as linalg from "@ratmath/linalg";
console.log(linalg.gramSchmidt([[1, 1], [1, 0], [0, 1]]).exact());
Checked output
[[[1], [1], [0]], [[1/2], [-1/2], [1]]]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Inner products of low-frequency modes and partial sums typically through order 10; mean-square and pointwise errors differ.
Focal example. The code above passed its displayed check in 0.724 ms on Node.
Related workload in this unit.linalg.leastSquares.exact · observations. Baseline test points across courses 2, 3, 5, 20. For y=2+3x, recover both coefficients with zero residual.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 2,000 (68.14 ms, 92.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Cost depends on both observations and independent columns. Collinearity can destroy uniqueness, and near-collinearity makes floating fits sensitive.
Measured times, memory and outcomes
observations · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
1.88
75.3
3
Baseline
Passed
2.81
75.9
5
Baseline
Passed
2.05
74.7
20
Baseline
Passed
2.43
75.7
100
Stretch
Passed
4.00
75.9
500
Stretch
Passed
18.48
81.3
2,000
Stretch
Passed
68.14
92.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
linalg.gramSchmidt · 1 passing test case, 1 distinct argument description
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as linalg from "@ratmath/linalg";
const A = [[1], [1], [1]];
console.log(String(linalg.multiply(A, linalg.leastSquares(A, [[1], [2], [3]]).exact().x)));
Checked output
[2]
[2]
[2]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Inner products of low-frequency modes and partial sums typically through order 10; mean-square and pointwise errors differ.
For this problem type. Hand fits use about 4–12 paired observations. A classroom dataset can have tens to hundreds of rows and one to five predictors. Include a nonconstant predictor.
Focal example. The code above passed its displayed check in 1.69 ms on Node.
Same API, measured input family.linalg.leastSquares.exact · observations. Baseline test points across courses 2, 3, 5, 20. For y=2+3x, recover both coefficients with zero residual.
Practical limit. Largest passing sample 2,000 (68.14 ms, 92.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Cost depends on both observations and independent columns. Collinearity can destroy uniqueness, and near-collinearity makes floating fits sensitive.
Measured times, memory and outcomes
observations · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
1.88
75.3
3
Baseline
Passed
2.81
75.9
5
Baseline
Passed
2.05
74.7
20
Baseline
Passed
2.43
75.7
100
Stretch
Passed
4.00
75.9
500
Stretch
Passed
18.48
81.3
2,000
Stretch
Passed
68.14
92.5
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
linalg.leastSquares · 1 passing test case, 2 distinct argument descriptions
for and at : a discontinuous limit of continuous functions.
Using RatMath
The two evaluations illustrate the cases. Use geometric decay for every 0≤x<1 and handle x=1 separately.
JavaScript module
import * as analytic from "@ratmath/analytic";
const F = analytic.functionSequence("x^n");
console.log([F.pointwise("1/2"), F.pointwise("1")]);
Checked output
[0, 1]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Inner products of low-frequency modes and partial sums typically through order 10; mean-square and pointwise errors differ.
For this problem type. Classroom tolerances often range from 10⁻¹ to 10⁻⁶. The associated N or δ can be orders of magnitude larger or smaller, depending on the function.
Focal example. The code above passed its displayed check in 0.576 ms on Node.
Related workload in this unit.analytic.sequence.nFor · decimal tolerance exponent. Baseline test points across courses 1, 2, 3, 4. For |1/n|<10^−d the first index is 10^d+1, including the strict-boundary case.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 12 (10.71 ms, 78.8 MiB peak process RSS). Library refusal at 16. A tiny ε may force a very large witness index. Check the whole tail when certifying an N for a nonmonotone sequence.
Measured times, memory and outcomes
decimal tolerance exponent · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
8.20
79.8
2
Baseline
Passed
10.10
79.5
3
Baseline
Passed
8.40
80.3
4
Baseline
Passed
18.49
80.5
6
Stretch
Passed
8.67
80.2
8
Stretch
Passed
8.84
80.3
12
Stretch
Passed
10.71
78.8
16
Stretch
Library refusal · AnalyticError: no index was found where the terms are within ε of the limit
10.35
80.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.functionSequence · 7 passing test cases, 9 distinct argument descriptions
For the half-open interval prove that the supremum is 1 for each n, although no x in the interval attains it.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.functionSequence("x^n").uniform(["0","1/2"]).verdict);
Checked output
uniform
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Inner products of low-frequency modes and partial sums typically through order 10; mean-square and pointwise errors differ.
For this problem type. Classroom tolerances often range from 10⁻¹ to 10⁻⁶. The associated N or δ can be orders of magnitude larger or smaller, depending on the function.
Focal example. The code above passed its displayed check in 51.65 ms on Node.
Related workload in this unit.analytic.sequence.nFor · decimal tolerance exponent. Baseline test points across courses 1, 2, 3, 4. For |1/n|<10^−d the first index is 10^d+1, including the strict-boundary case.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 12 (10.71 ms, 78.8 MiB peak process RSS). Library refusal at 16. A tiny ε may force a very large witness index. Check the whole tail when certifying an N for a nonmonotone sequence.
Measured times, memory and outcomes
decimal tolerance exponent · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
8.20
79.8
2
Baseline
Passed
10.10
79.5
3
Baseline
Passed
8.40
80.3
4
Baseline
Passed
18.49
80.5
6
Stretch
Passed
8.67
80.2
8
Stretch
Passed
8.84
80.3
12
Stretch
Passed
10.71
78.8
16
Stretch
Library refusal · AnalyticError: no index was found where the terms are within ε of the limit
10.35
80.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.functionSequence · 7 passing test cases, 9 distinct argument descriptions
An orthonormal expansion has first two coefficient magnitudes 3 and 4. What lower bound follows for the squared norm?
Worked solution
The orthogonal projection has squared norm 9+16, bounded by the full energy.
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`3^2+4^2`));
Checked output
25
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Inner products of low-frequency modes and partial sums typically through order 10; mean-square and pointwise errors differ.
Focal example. The code above passed its displayed check in 0.162 ms on Node.
Same arithmetic expression. Replaced its first numeral 3 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.Rational.multiply · operand bits. Baseline test points across courses 8, 32, 64, 256. Cross-multiply the unreduced integer products; operands have unlike denominators.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 131,072 (1.53 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Intermediate products can have twice the bit length of their factors. Repeated squaring can exhaust the engine’s BigInt allocation limit in a small number of steps.
Measured times, memory and outcomes
operand bits · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
8
Baseline
Passed
0.317
74.6
32
Baseline
Passed
0.035
75.5
64
Baseline
Passed
0.045
75.1
256
Baseline
Passed
0.106
74
1,024
Stretch
Passed
0.035
75.3
8,192
Stretch
Passed
0.075
75.8
32,768
Stretch
Passed
0.245
75
131,072
Stretch
Passed
1.53
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
Does adding more Fourier modes at a jump make the maximum relative overshoot tend to zero?
Worked solution
For a standard jump the overshoot persists near the jump while the oscillatory region narrows. Pointwise and uniform convergence differ.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Inner products of low-frequency modes and partial sums typically through order 10; mean-square and pointwise errors differ.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 17 / 40 · Discrete spectra
Discrete Fourier transform
Direct calculation@ratmath/analytic
Problem
Compute the DFT of .
Worked solution
, , , .
Using RatMath
Use the period or sample convention shown. Keep the normalization when converting a coefficient or transform value back to the original signal.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.dft([1, 2, 3, 4]).text);
Checked output
["10", "-2 + 2ζ", "-2", "-2 - 2ζ"]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. About 2–16 samples in worked transforms, often powers of two for FFT examples. Sampling rate and aliasing are part of the data.
For this problem type. Keep about 2–16 harmonics, nodes or modes in a worked example. For a transform specify interval, frequency convention and sampling rate.
Focal example. The code above passed its displayed check in 0.640 ms on Node.
Same API, measured input family.analytic.dft · sample count. Baseline test points across courses 2, 4, 8, 16. The DFT of a unit impulse is identically one in every frequency bin.
Practical limit. Largest passing sample 256 (134 ms, 91.3 MiB peak process RSS). The first sampled passing call above 100 ms used 256 (134 ms). The runs did not locate a ceiling for this family. The result keeps one complex value per frequency. For signals with general phases, precision and transform length can dominate cost.
Measured times, memory and outcomes
sample count · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.887
76.2
4
Baseline
Passed
0.815
75.4
8
Baseline
Passed
1.07
75.8
16
Baseline
Passed
2.08
75.7
32
Stretch
Passed
3.29
76.4
64
Stretch
Passed
17.10
79.6
128
Stretch
Passed
29.35
83.2
256
Stretch
Passed
134
91.3
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.dft · 2 passing test cases, 4 distinct argument descriptions
Use the period or sample convention shown. Keep the normalization when converting a coefficient or transform value back to the original signal.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.dft([1, 0, 0, 0]).text);
Checked output
["1", "1", "1", "1"]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. About 2–16 samples in worked transforms, often powers of two for FFT examples. Sampling rate and aliasing are part of the data.
For this problem type. Keep about 2–16 harmonics, nodes or modes in a worked example. For a transform specify interval, frequency convention and sampling rate.
Focal example. The code above passed its displayed check in 0.428 ms on Node.
Same API, measured input family.analytic.dft · sample count. Baseline test points across courses 2, 4, 8, 16. The DFT of a unit impulse is identically one in every frequency bin.
Practical limit. Largest passing sample 256 (134 ms, 91.3 MiB peak process RSS). The first sampled passing call above 100 ms used 256 (134 ms). The runs did not locate a ceiling for this family. The result keeps one complex value per frequency. For signals with general phases, precision and transform length can dominate cost.
Measured times, memory and outcomes
sample count · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.887
76.2
4
Baseline
Passed
0.815
75.4
8
Baseline
Passed
1.07
75.8
16
Baseline
Passed
2.08
75.7
32
Stretch
Passed
3.29
76.4
64
Stretch
Passed
17.10
79.6
128
Stretch
Passed
29.35
83.2
256
Stretch
Passed
134
91.3
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.dft · 2 passing test cases, 4 distinct argument descriptions
A 7 Hz sine is sampled at 10 Hz. What frequency does it appear to have?
Worked solution
The Nyquist frequency is 5 Hz; folds to Hz, and a sine comes back with its sign reversed: .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as analytic from "@ratmath/analytic";
const a = analytic.alias(7, 10);
console.log([a.alias, a.sign, a.aliased]);
Checked output
[3, -1, true]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. About 2–16 samples in worked transforms, often powers of two for FFT examples. Sampling rate and aliasing are part of the data.
For this problem type. Keep about 2–16 harmonics, nodes or modes in a worked example. For a transform specify interval, frequency convention and sampling rate.
Focal example. The code above passed its displayed check in 0.167 ms on Node.
Related workload in this unit.analytic.dft · sample count. Baseline test points across courses 2, 4, 8, 16. The DFT of a unit impulse is identically one in every frequency bin.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 256 (134 ms, 91.3 MiB peak process RSS). The first sampled passing call above 100 ms used 256 (134 ms). The runs did not locate a ceiling for this family. The result keeps one complex value per frequency. For signals with general phases, precision and transform length can dominate cost.
Measured times, memory and outcomes
sample count · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.887
76.2
4
Baseline
Passed
0.815
75.4
8
Baseline
Passed
1.07
75.8
16
Baseline
Passed
2.08
75.7
32
Stretch
Passed
3.29
76.4
64
Stretch
Passed
17.10
79.6
128
Stretch
Passed
29.35
83.2
256
Stretch
Passed
134
91.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.alias · 1 passing test case, 3 distinct argument descriptions
If sin(2πft) is sampled at t=k/(2f), what sequence is observed?
Worked solution
Every sample equals sin(kπ)=0. A sine component exactly at the boundary can disappear at this sampling phase; use a strictly larger sampling rate for this example.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. About 2–16 samples in worked transforms, often powers of two for FFT examples. Sampling rate and aliasing are part of the data.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 21 / 40 · Discrete spectra
Chebyshev nodes
Direct calculation@ratmath/analytic
Problem
Give the three Chebyshev nodes on .
Worked solution
: .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.chebyshevNodes(-1, 1, 3));
Checked output
[-56755/65536, 0, 14189/16384]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. About 2–16 samples in worked transforms, often powers of two for FFT examples. Sampling rate and aliasing are part of the data.
For this problem type. Use roughly 3–10 distinct nodes. On the line, compare both a nodal value and a value between nodes.
Focal example. The code above passed its displayed check in 0.856 ms on Node.
Related workload in this unit.analytic.dft · sample count. Baseline test points across courses 2, 4, 8, 16. The DFT of a unit impulse is identically one in every frequency bin.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 256 (134 ms, 91.3 MiB peak process RSS). The first sampled passing call above 100 ms used 256 (134 ms). The runs did not locate a ceiling for this family. The result keeps one complex value per frequency. For signals with general phases, precision and transform length can dominate cost.
Measured times, memory and outcomes
sample count · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.887
76.2
4
Baseline
Passed
0.815
75.4
8
Baseline
Passed
1.07
75.8
16
Baseline
Passed
2.08
75.7
32
Stretch
Passed
3.29
76.4
64
Stretch
Passed
17.10
79.6
128
Stretch
Passed
29.35
83.2
256
Stretch
Passed
134
91.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.chebyshevNodes · 1 passing test case, 1 distinct argument description
Sample a signal at 800 Hz for 100 samples. What is the bin spacing?
Worked solution
Frequency spacing is sampling rate divided by sample count.
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`800/100`));
Checked output
8
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. About 2–16 samples in worked transforms, often powers of two for FFT examples. Sampling rate and aliasing are part of the data.
Focal example. The code above passed its displayed check in 0.082 ms on Node.
Same arithmetic expression. Replaced its first numeral 800 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.Rational.add · denominator. Baseline test points across courses 1, 2, 3, 12, 100, 1,000. Cross-multiply 1/n + 1/(n+1) against (2n+1)/(n(n+1)).
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000,000,007 (0.038 ms, 76.3 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact work depends on the bit lengths of both numerator and denominator. A long sum of relatively prime fractions can build a large common denominator.
Measured times, memory and outcomes
denominator · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.034
74.9
2
Baseline
Passed
0.036
75.6
3
Baseline
Passed
0.040
75.9
12
Baseline
Passed
0.039
75.2
100
Baseline
Passed
0.041
75
1,000
Baseline
Passed
0.035
75.8
1,000,003
Stretch
Passed
0.044
75
1,000,000,007
Stretch
Passed
0.038
76.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
If a real length-eight signal has DFT value 3+2i in bin 1, what is bin 7?
Worked solution
Conjugate symmetry gives 3−2i, with the usual unnormalized forward transform.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as complex from "@ratmath/complex";
console.log(String(complex.complex("3+2i").conj()));
Checked output
3 - 2i
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. About 2–16 samples in worked transforms, often powers of two for FFT examples. Sampling rate and aliasing are part of the data.
For this problem type. Use one to three complex inputs, often with small rational coordinates. State the branch, and handle zeros or cut crossings explicitly.
Focal example. The code above passed its displayed check in 0.105 ms on Node.
Same API, measured input family.complex.complex · absolute component. Baseline test points across courses 1, 3, 10, 100. The product (n+i)(n−i) has imaginary part zero and real part n²+1.
Practical limit. Largest passing sample 1,000,000,000 (0.540 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact rational complex arithmetic retains both coordinates. Branches, singularities and transcendental functions introduce a separate precision question.
Measured times, memory and outcomes
absolute component · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.20
76
3
Baseline
Passed
0.887
75
10
Baseline
Passed
0.519
75.2
100
Baseline
Passed
0.549
74.5
100,000
Stretch
Passed
0.534
75.6
1,000,000,000
Stretch
Passed
0.540
75.5
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
complex.complex · 20 passing test cases, 32 distinct argument descriptions
Why zero-pad two length-four sequences before using an FFT for their linear convolution?
Worked solution
The linear convolution has length seven. Transform length at least seven avoids wrapping the tail onto early indices.
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`4+4-1`));
Checked output
7
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. About 2–16 samples in worked transforms, often powers of two for FFT examples. Sampling rate and aliasing are part of the data.
Focal example. The code above passed its displayed check in 0.071 ms on Node.
Same arithmetic expression. Replaced its first numeral 4 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.R · whole-number operand. Baseline test points across courses 0, 1, 10, 20, 100, 1,000, 1,000,000. (n+7)(n−3) by independent BigInt arithmetic.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 9,007,199,254,740,991 (1.67 ms, 75.3 MiB peak process RSS). The runs did not locate a ceiling for this family. Exact integer arithmetic grows with operand bit length. Enter large integers as decimal strings or BigInts before any JavaScript Number conversion.
Measured times, memory and outcomes
whole-number operand · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
1.75
75
1
Baseline
Passed
1.70
75.7
10
Baseline
Passed
1.78
75.1
20
Baseline
Passed
1.88
75.4
100
Baseline
Passed
1.55
75.4
1,000
Baseline
Passed
1.36
75.3
1,000,000
Baseline
Passed
1.39
74.8
1,000,000,000
Stretch
Passed
1.69
76.3
9,007,199,254,740,991
Stretch
Passed
1.67
75.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
Use the period or sample convention shown. Keep the normalization when converting a coefficient or transform value back to the original signal.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(
[analytic.fourierTransform("exp(-abs(x))").formula.text, analytic.fourierTransform("exp(-x^2)").formula.text]
);
Checked output
["2/(w^2 + 1)", "sqrt(pi)*exp(-1/4*w^2)"]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One-dimensional transform pairs or convolutions with one or two parameters and a specified convergence convention.
For this problem type. Keep about 2–16 harmonics, nodes or modes in a worked example. For a transform specify interval, frequency convention and sampling rate.
Focal example. The code above passed its displayed check in 883 ms on Node.
Related workload in this unit.analytic.fourier.exact · partial-sum order. Baseline test points across courses 1, 2, 4, 8. For odd f(x)=x, every cosine coefficient vanishes, including the constant term.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 16 (2,617 ms, 131.8 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (2,617 ms). Check enclosure widths as well as inclusion of the target. High harmonics require increasingly oscillatory integrals.
Measured times, memory and outcomes
partial-sum order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
32.79
89.7
2
Baseline
Passed
109
90.9
4
Baseline
Passed
215
91
8
Baseline
Passed
764
92.7
16
Stretch
Passed
2,617
131.8
32
Stretch
Time cutoff
—
133.5
64
Stretch
Time cutoff
—
134.2
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.fourierTransform · 7 passing test cases, 11 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.convolution("exp(-abs(x))", "exp(-abs(x))").at(1));
Checked output
0.7357588823428846[3133:4755]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One-dimensional transform pairs or convolutions with one or two parameters and a specified convergence convention.
For this problem type. Keep about 2–16 harmonics, nodes or modes in a worked example. For a transform specify interval, frequency convention and sampling rate.
Focal example. The code above passed its displayed check in 129 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.analytic.dft · sample count. Baseline test points across courses 2, 4, 8, 16. The DFT of a unit impulse is identically one in every frequency bin.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 256 (134 ms, 91.3 MiB peak process RSS). The first sampled passing call above 100 ms used 256 (134 ms). The runs did not locate a ceiling for this family. The result keeps one complex value per frequency. For signals with general phases, precision and transform length can dominate cost.
Measured times, memory and outcomes
sample count · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.887
76.2
4
Baseline
Passed
0.815
75.4
8
Baseline
Passed
1.07
75.8
16
Baseline
Passed
2.08
75.7
32
Stretch
Passed
3.29
76.4
64
Stretch
Passed
17.10
79.6
128
Stretch
Passed
29.35
83.2
256
Stretch
Passed
134
91.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.convolution · 1 passing test case, 1 distinct argument description
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log([analytic.laplace("t^2"), analytic.laplace("exp(2t)*sin(3t)")].map(String));
Checked output
["2/s^3", "3/((s - 2)^2 + 9)"]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One-dimensional transform pairs or convolutions with one or two parameters and a specified convergence convention.
Focal example. The code above passed its displayed check in 0.656 ms on Node.
Related workload in this unit.analytic.fourier.exact · partial-sum order. Baseline test points across courses 1, 2, 4, 8. For odd f(x)=x, every cosine coefficient vanishes, including the constant term.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 16 (2,617 ms, 131.8 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (2,617 ms). Check enclosure widths as well as inclusion of the target. High harmonics require increasingly oscillatory integrals.
Measured times, memory and outcomes
partial-sum order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
32.79
89.7
2
Baseline
Passed
109
90.9
4
Baseline
Passed
215
91
8
Baseline
Passed
764
92.7
16
Stretch
Passed
2,617
131.8
32
Stretch
Time cutoff
—
133.5
64
Stretch
Time cutoff
—
134.2
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.laplace · 2 passing test cases, 7 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(String(analytic.inverseLaplace("1/(s*(s+1))").result));
Checked output
1 - exp(-t)
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One-dimensional transform pairs or convolutions with one or two parameters and a specified convergence convention.
Focal example. The code above passed its displayed check in 0.748 ms on Node.
Related workload in this unit.analytic.fourier.exact · partial-sum order. Baseline test points across courses 1, 2, 4, 8. For odd f(x)=x, every cosine coefficient vanishes, including the constant term.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 16 (2,617 ms, 131.8 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (2,617 ms). Check enclosure widths as well as inclusion of the target. High harmonics require increasingly oscillatory integrals.
Measured times, memory and outcomes
partial-sum order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
32.79
89.7
2
Baseline
Passed
109
90.9
4
Baseline
Passed
215
91
8
Baseline
Passed
764
92.7
16
Stretch
Passed
2,617
131.8
32
Stretch
Time cutoff
—
133.5
64
Stretch
Time cutoff
—
134.2
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.inverseLaplace · 2 passing test cases, 6 distinct argument descriptions
, whose inverse transform at 1 is , the same as the direct convolution.
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as analytic from "@ratmath/analytic";
const r = analytic.convolution("exp(-abs(x))", "exp(-abs(x))").theorem(1);
console.log([r.agrees, r.viaTransforms]);
Checked output
[true, 0.7357588[7243462884235:9227470254627]]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One-dimensional transform pairs or convolutions with one or two parameters and a specified convergence convention.
For this problem type. Keep about 2–16 harmonics, nodes or modes in a worked example. For a transform specify interval, frequency convention and sampling rate.
Focal example. The code above passed its displayed check in 2,199 ms on Node.
Related workload in this unit.analytic.dft · sample count. Baseline test points across courses 2, 4, 8, 16. The DFT of a unit impulse is identically one in every frequency bin.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 256 (134 ms, 91.3 MiB peak process RSS). The first sampled passing call above 100 ms used 256 (134 ms). The runs did not locate a ceiling for this family. The result keeps one complex value per frequency. For signals with general phases, precision and transform length can dominate cost.
Measured times, memory and outcomes
sample count · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
2
Baseline
Passed
0.887
76.2
4
Baseline
Passed
0.815
75.4
8
Baseline
Passed
1.07
75.8
16
Baseline
Passed
2.08
75.7
32
Stretch
Passed
3.29
76.4
64
Stretch
Passed
17.10
79.6
128
Stretch
Passed
29.35
83.2
256
Stretch
Passed
134
91.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.convolution · 1 passing test case, 1 distinct argument description
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.laplace("t^2*exp(3*t)"));
Checked output
2/(s - 3)^3
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One-dimensional transform pairs or convolutions with one or two parameters and a specified convergence convention.
Focal example. The code above passed its displayed check in 2.07 ms on Node.
Related workload in this unit.analytic.fourier.exact · partial-sum order. Baseline test points across courses 1, 2, 4, 8. For odd f(x)=x, every cosine coefficient vanishes, including the constant term.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 16 (2,617 ms, 131.8 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (2,617 ms). Check enclosure widths as well as inclusion of the target. High harmonics require increasingly oscillatory integrals.
Measured times, memory and outcomes
partial-sum order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
32.79
89.7
2
Baseline
Passed
109
90.9
4
Baseline
Passed
215
91
8
Baseline
Passed
764
92.7
16
Stretch
Passed
2,617
131.8
32
Stretch
Time cutoff
—
133.5
64
Stretch
Time cutoff
—
134.2
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.laplace · 2 passing test cases, 7 distinct argument descriptions
With transform kernel exp(−iωt), what factor accompanies replacing f(t) by f(t−a)?
Worked solution
Substitute u=t−a. The transform is multiplied by exp(−iωa).
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. One-dimensional transform pairs or convolutions with one or two parameters and a specified convergence convention.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.
Day 32 / 40 · Transforms and convolution
Inverse Laplace transform
Direct calculation@ratmath/analytic
Problem
Find .
Worked solution
: .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.inverseLaplace("(s + 1)/(s^2 + 4*s + 13)").result);
Checked output
cos(3*t)*exp(-2*t) + -1/3*sin(3*t)*exp(-2*t)
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. One-dimensional transform pairs or convolutions with one or two parameters and a specified convergence convention.
Focal example. The code above passed its displayed check in 1.50 ms on Node.
Related workload in this unit.analytic.fourier.exact · partial-sum order. Baseline test points across courses 1, 2, 4, 8. For odd f(x)=x, every cosine coefficient vanishes, including the constant term.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 16 (2,617 ms, 131.8 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (2,617 ms). Check enclosure widths as well as inclusion of the target. High harmonics require increasingly oscillatory integrals.
Measured times, memory and outcomes
partial-sum order · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
32.79
89.7
2
Baseline
Passed
109
90.9
4
Baseline
Passed
215
91
8
Baseline
Passed
764
92.7
16
Stretch
Passed
2,617
131.8
32
Stretch
Time cutoff
—
133.5
64
Stretch
Time cutoff
—
134.2
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.inverseLaplace · 2 passing test cases, 6 distinct argument descriptions
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.legendre(3));
Checked output
[0, -3/2, 0, 5/2]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Separation on a simple interval or disk, typically 1–16 eigenmodes and a few evaluation points.
For this problem type. Keep about 2–16 harmonics, nodes or modes in a worked example. For a transform specify interval, frequency convention and sampling rate.
Focal example. The code above passed its displayed check in 0.159 ms on Node.
Same API, measured input family.analytic.legendre · polynomial degree. Baseline test points across courses 0, 1, 2, 5, 10. P_n(1)=1 and P_n(−1)=(−1)^n; coefficients of opposite parity vanish.
Practical limit. Largest passing sample 100 (65.44 ms, 88.3 MiB peak process RSS). The runs did not locate a ceiling for this family. Storing coefficients in the power basis can create large alternating terms. Evaluating near cancellation in floating point may lose digits.
Measured times, memory and outcomes
polynomial degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
0.100
75
1
Baseline
Passed
0.073
75.1
2
Baseline
Passed
0.700
75.7
5
Baseline
Passed
0.702
75.1
10
Baseline
Passed
0.745
76
20
Stretch
Passed
2.46
76.1
50
Stretch
Passed
8.77
86.5
100
Stretch
Passed
65.44
88.3
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Day 34 / 40 · Eigenfunction expansions
Sturm–Liouville eigenvalues
Direct calculation@ratmath/analytic
Problem
Find the first three eigenvalues of , .
Worked solution
, : , , .
Using RatMath
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.sturmLiouville({ interval: [0, 1], count: 3 }).map((e) => e.eigenvalue));
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Separation on a simple interval or disk, typically 1–16 eigenmodes and a few evaluation points.
For this problem type. Keep about 2–16 harmonics, nodes or modes in a worked example. For a transform specify interval, frequency convention and sampling rate.
Focal example. The code above passed its displayed check in 3,342 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Related workload in this unit.analytic.wave · integer periods. Baseline test points across courses 1, 2, 3, 5. Unit string with initial displacement sin(πx) and zero velocity returns to amplitude one at its midpoint at time 2n.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000 (3.94 ms, 77.3 MiB peak process RSS). The runs did not locate a ceiling for this family. A single smooth eigenmode has known periodicity. Nonsmooth initial data may require many terms and can exhibit oscillations near a jump.
Measured times, memory and outcomes
integer periods · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
3.55
76.5
2
Baseline
Passed
3.19
76.9
3
Baseline
Passed
3.40
77
5
Baseline
Passed
3.31
76.5
10
Stretch
Passed
5.45
77.1
100
Stretch
Passed
3.30
76.7
1,000
Stretch
Passed
3.94
77.3
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.sturmLiouville · 1 passing test case, 2 distinct argument descriptions
Use separation of variables for the time dependence. The evaluated series encloses the predicted value with width below 0.0000006.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(
analytic.heat({ k: 1, length: 1, initial: "sin(pi*x)", terms: 3 }).at("1/2", "1/10").value
);
Checked output
0.37270[755611254181306:812159433401409]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Separation on a simple interval or disk, typically 1–16 eigenmodes and a few evaluation points.
For this problem type. Use a one- or two-dimensional domain, simple boundary data and typically 1–16 modes or one characteristic. Record physical units and compatibility at the boundary.
Focal example. The code above passed its displayed check in 579 ms on Node.
Same API, measured input family.analytic.heat · requested sine terms. Baseline test points across courses 1, 2, 4, 8. At x=1/2, t=1/10 a unit sine mode decays to exp(−π²/10). Test containment against the closed form to double precision. A loose tail bound at low order reduces usable precision.
Practical limit. Largest passing sample 16 (1,510 ms, 127.2 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (1,510 ms). Tail enclosure and precision can dominate the mode count. Compare both endpoints at the evaluation point, particularly near initial time.
Measured times, memory and outcomes
requested sine terms · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
458
90.1
2
Baseline
Passed
491
92.1
4
Baseline
Passed
632
90.8
8
Baseline
Passed
828
93
16
Stretch
Passed
1,510
127.2
32
Stretch
Time cutoff
—
135.3
64
Stretch
Time cutoff
—
136
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.heat · 1 passing test case, 2 distinct argument descriptions
A string of length 1 with starts at rest in the shape . Find the displacement at at and .
Worked solution
: , .
Using RatMath
Enter the differential equation data with the domain, boundary conditions and initial profile requested. Evaluate the resulting solution at the stated coordinates.
JavaScript module
import * as analytic from "@ratmath/analytic";
const W = analytic.wave({ length: 1, position: "sin(pi*x)" });
console.log([W.at("1/2", "1/2"), W.at("1/2", "1/3")]);
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Separation on a simple interval or disk, typically 1–16 eigenmodes and a few evaluation points.
For this problem type. Use a one- or two-dimensional domain, simple boundary data and typically 1–16 modes or one characteristic. Record physical units and compatibility at the boundary.
Focal example. The code above passed its displayed check in 3.32 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Same API, measured input family.analytic.wave · integer periods. Baseline test points across courses 1, 2, 3, 5. Unit string with initial displacement sin(πx) and zero velocity returns to amplitude one at its midpoint at time 2n.
Practical limit. Largest passing sample 1,000 (3.94 ms, 77.3 MiB peak process RSS). The runs did not locate a ceiling for this family. A single smooth eigenmode has known periodicity. Nonsmooth initial data may require many terms and can exhibit oscillations near a jump.
Measured times, memory and outcomes
integer periods · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
3.55
76.5
2
Baseline
Passed
3.19
76.9
3
Baseline
Passed
3.40
77
5
Baseline
Passed
3.31
76.5
10
Stretch
Passed
5.45
77.1
100
Stretch
Passed
3.30
76.7
1,000
Stretch
Passed
3.94
77.3
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.wave · 1 passing test case, 3 distinct argument descriptions
Solve in the unit disc with on the boundary. Find at , .
Worked solution
(harmonic and right on the circle): .
Using RatMath
Enter the differential equation data with the domain, boundary conditions and initial profile requested. Evaluate the resulting solution at the stated coordinates.
JavaScript module
import * as analytic from "@ratmath/analytic";
const u = analytic.laplaceDisc({ boundary: "cos(theta)" });
console.log([u.closedForm, u.at("1/2", 0).value]);
Checked output
["r*cos(theta)", 1/2]
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Separation on a simple interval or disk, typically 1–16 eigenmodes and a few evaluation points.
For this problem type. Use a one- or two-dimensional domain, simple boundary data and typically 1–16 modes or one characteristic. Record physical units and compatibility at the boundary.
Focal example. The code above passed its displayed check in 1.44 ms on Node.
Related workload in this unit.analytic.heat · requested sine terms. Baseline test points across courses 1, 2, 4, 8. At x=1/2, t=1/10 a unit sine mode decays to exp(−π²/10). Test containment against the closed form to double precision. A loose tail bound at low order reduces usable precision.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 16 (1,510 ms, 127.2 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (1,510 ms). Tail enclosure and precision can dominate the mode count. Compare both endpoints at the evaluation point, particularly near initial time.
Measured times, memory and outcomes
requested sine terms · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
458
90.1
2
Baseline
Passed
491
92.1
4
Baseline
Passed
632
90.8
8
Baseline
Passed
828
93
16
Stretch
Passed
1,510
127.2
32
Stretch
Time cutoff
—
135.3
64
Stretch
Time cutoff
—
136
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.laplaceDisc · 4 passing test cases, 5 distinct argument descriptions
On the unit rod with zero endpoint temperatures and , find the first Fourier sine coefficient .
Worked solution
.
Using RatMath
Enter the differential equation data with the domain, boundary conditions and initial profile requested. Evaluate the resulting solution at the stated coordinates.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.heat({ k: 1, length: 1, initial: "x*(1 - x)" }).modes[0].coefficient);
Checked output
0.2580122754652123854:0.25801227546718121957
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Separation on a simple interval or disk, typically 1–16 eigenmodes and a few evaluation points.
For this problem type. Use a one- or two-dimensional domain, simple boundary data and typically 1–16 modes or one characteristic. Record physical units and compatibility at the boundary.
Focal example. The code above passed its displayed check in 239 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Same API, measured input family.analytic.heat · requested sine terms. Baseline test points across courses 1, 2, 4, 8. At x=1/2, t=1/10 a unit sine mode decays to exp(−π²/10). Test containment against the closed form to double precision. A loose tail bound at low order reduces usable precision.
Practical limit. Largest passing sample 16 (1,510 ms, 127.2 MiB peak process RSS). Time cutoff at 32, 64. The first sampled passing call above one second used 16 (1,510 ms). Tail enclosure and precision can dominate the mode count. Compare both endpoints at the evaluation point, particularly near initial time.
Measured times, memory and outcomes
requested sine terms · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
458
90.1
2
Baseline
Passed
491
92.1
4
Baseline
Passed
632
90.8
8
Baseline
Passed
828
93
16
Stretch
Passed
1,510
127.2
32
Stretch
Time cutoff
—
135.3
64
Stretch
Time cutoff
—
136
Each row measures the stated fixture. Other inputs to this API can take different paths. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
analytic.heat · 1 passing test case, 2 distinct argument descriptions
For diffusivity κ>0, which of the modes n=2 and n=5 decays faster on the same interval?
Worked solution
Decay rates are proportional to n². The fifth mode has 25/4 times the rate of the second.
Using RatMath
Put the arithmetic inside the R tag so RatMath parses the literals. Keep fractions as ratios throughout the calculation and attach the units from the problem to the result.
JavaScript module
import { R } from "@ratmath/core";
console.log(String(R`5^2/2^2`));
Checked output
25/4
Run this example locally
Use the integrated RatMath workspace with the subject packages linked. Save this example as lesson.mjs in its root and run node lesson.mjs. The guide formats library objects as mathematical values. Your console may also print their fields or JavaScript type suffixes.
Typical inputs for this unit. Separation on a simple interval or disk, typically 1–16 eigenmodes and a few evaluation points.
Focal example. The code above passed its displayed check in 0.169 ms on Node.
Same arithmetic expression. Replaced its first numeral 5 with 0, 1, 2, 7, 12, 100, 1000, -3, 1/2. All 9 defined variants agreed exactly with Python’s rational arithmetic. This varies the arithmetic operation while holding the rest of the expression fixed.
Related workload in this unit.core.Rational.multiply · operand bits. Baseline test points across courses 8, 32, 64, 256. Cross-multiply the unreduced integer products; operands have unlike denominators.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 131,072 (1.53 ms, 75.5 MiB peak process RSS). The runs did not locate a ceiling for this family. Intermediate products can have twice the bit length of their factors. Repeated squaring can exhaust the engine’s BigInt allocation limit in a small number of steps.
Measured times, memory and outcomes
operand bits · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
8
Baseline
Passed
0.317
74.6
32
Baseline
Passed
0.035
75.5
64
Baseline
Passed
0.045
75.1
256
Baseline
Passed
0.106
74
1,024
Stretch
Passed
0.035
75.3
8,192
Stretch
Passed
0.075
75.8
32,768
Stretch
Passed
0.245
75
131,072
Stretch
Passed
1.53
75.5
Each row measures the stated fixture. This workload uses a different operation or expression from the focal example. Its thresholds apply only to the named fixture. Course intervals are estimates. Finite samples leave intermediate inputs and other problem families unverified.
Additional inputs from package tests
These arguments were observed in passing test cases. The linked assertions show what the tests actually checked. Structured inputs are abbreviated.
core.R · 2 passing test cases, 10 distinct argument descriptions
Which basis automatically satisfies zero endpoint values on [0,L]?
Worked solution
Sines sin(nπx/L) vanish at both endpoints. This makes them suitable eigenfunctions for homogeneous Dirichlet data.
Working without a calculator
Use the argument or construction in the worked solution. This lesson assigns the reasoning to the student.
Input range and limits
Typical inputs for this unit. Separation on a simple interval or disk, typically 1–16 eigenmodes and a few evaluation points.
Scope of verification. This day asks for a hand argument, construction or interpretation. The worked instance gives the input. General claims need the reasoning shown above. A measured time, memory ceiling or finite input sweep would not verify that claim.