32 of 40 focal problems use RatMath for a calculation or a substantive step.
Direct calculation
27 · 67.5%
Assisted
5 · 12.5%
Worked by hand
8 · 20%
Using the packages
Separated solutions and transform pairs are approachable once the domain, boundary conditions and sign convention are specified. Choosing a model and proving uniqueness need reasoning outside a displayed formula.
Calculator interface
Put the domain and boundary conditions into a diagram. Show the separated basis, coefficient normalization and residual, and overlay a boundary or initial trace against the requested data.
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
32 of 40 days include a checked executable example. On 15 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 · Classification and transport. Linear equations in one time and one space dimension or two space dimensions, with simple coefficients and characteristic data.
Unit benchmark · analytic.wave, integer periods. Largest passing sample 1,000 (3.94 ms, 77.3 MiB peak process RSS). The runs did not locate a ceiling for this family.
Days 9–16 · Diffusion. A finite rod, positive diffusivity, compatible boundary data and approximately 1–16 modes in a classroom partial sum.
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).
Days 17–24 · Waves. One-dimensional strings or lines, positive wave speed and a few modes or a simple explicit displacement/velocity.
Unit benchmark · analytic.wave, integer periods. Largest passing sample 1,000 (3.94 ms, 77.3 MiB peak process RSS). The runs did not locate a ceiling for this family.
Days 25–32 · Elliptic problems. Rectangles or disks with simple boundary data; low modes or 4–32 terms and a few interior 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).
Days 33–40 · Spectral methods. Small Sturm–Liouville spectra or Fourier coefficients, typically the first 1–16 modes. Tail bounds depend on data regularity.
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).
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 c = analytic.pde.classify({ A: 1, B: 4, C: 3 });
console.log([c.discriminant, c.type]);
Checked output
["4", "hyperbolic"]
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. Linear equations in one time and one space dimension or two space dimensions, with simple coefficients and characteristic data.
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 0.350 ms on Node.
Same API, measured input family.analytic.pde.classify · mixed-derivative coefficient B. Baseline test points across courses 0, 1, 2, 3, 5. A=C=1 gives discriminant B²−4. Its sign identifies elliptic, parabolic and hyperbolic cases.
Practical limit. Largest passing sample 10,000 (2.74 ms, 75.2 MiB peak process RSS). The runs did not locate a ceiling for this family. The sign of B²−4AC assumes the coefficient of the mixed derivative is B. A different convention uses a different discriminant.
Measured times, memory and outcomes
mixed-derivative coefficient B · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
0.647
74.8
1
Baseline
Passed
0.502
74.5
2
Baseline
Passed
0.821
75.6
3
Baseline
Passed
0.717
74.8
5
Baseline
Passed
0.516
76.5
50
Stretch
Passed
0.665
74.6
10,000
Stretch
Passed
2.74
75.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.pde.classify · 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";
const u = analytic.pde.transport({ speed: 2, initial: "exp(-x^2)" });
console.log([u.formula, u.characteristics, u.at(1, "1/2").value]);
Checked output
["exp(-(x - 2*t)^2)", "x - 2*t = const", 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. Linear equations in one time and one space dimension or two space dimensions, with simple coefficients and characteristic data.
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 0.786 ms on Node.
Same API, measured input family.analytic.pde.transport · wave speed. Baseline test points across courses 1, 2, 3, 5. At x=1,t=2 with initial data x², translation gives (1−2c)².
Practical limit. Largest passing sample 10,000 (2.52 ms, 76.1 MiB peak process RSS). The runs did not locate a ceiling for this family. This sweep uses exact polynomial data and a constant speed. Characteristics must stay inside the problem domain and satisfy the supplied boundary data.
Measured times, memory and outcomes
wave speed · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
3.10
73.6
2
Baseline
Passed
2.15
74.4
3
Baseline
Passed
1.41
76.2
5
Baseline
Passed
1.90
75.2
10
Stretch
Passed
2.31
75.6
100
Stretch
Passed
1.36
75.6
10,000
Stretch
Passed
2.52
76.1
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.pde.transport · 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.firstOrder("x*y^2").through(0, 1).solution);
Checked output
-(2/(x^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. Linear equations in one time and one space dimension or two space dimensions, with simple coefficients and characteristic data.
For this problem type. Use a scalar ODE or a two-state system with a short time interval. Hand traces use a few steps and classroom comparisons commonly use 10–100.
Focal example. The code above passed its displayed check in 3.03 ms on Node.
Related workload in this unit.analytic.odeMethod · Euler steps. Baseline test points across courses 1, 4, 10, 50. For y′=y and h=1/n, check the floating Euler iterate against exp(n log1p(1/n)) within 10⁻¹¹. Method error relative to e is separate.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000 (292 ms, 90.4 MiB peak process RSS). The first sampled passing call above 100 ms used 300 (117 ms). The runs did not locate a ceiling for this family. Smaller steps reduce Euler truncation error for a suitably stable problem. The teaching trace uses doubles. Stiff equations can require vastly smaller steps.
Measured times, memory and outcomes
Euler steps · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
51.00
90.3
4
Baseline
Passed
34.01
89.8
10
Baseline
Passed
36.24
89.6
50
Baseline
Passed
61.43
89.9
100
Stretch
Passed
66.45
90.3
300
Stretch
Passed
117
89.3
1,000
Stretch
Passed
292
90.4
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.firstOrder · 3 passing test cases, 9 distinct argument descriptions
On a finite rod with u(0,t)=0 and continuous data up to t=0, can u(x,0)=1 for all x including the left endpoint?
Worked solution
The corner requires both 0 and 1. A solution taking those data continuously on the closed space-time domain cannot exist.
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. Linear equations in one time and one space dimension or two space dimensions, with simple coefficients and characteristic 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 05 / 40 · Classification and transport
Partial derivatives
Direct calculation@ratmath/symbolic
Problem
For find and .
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 symbolic from "@ratmath/symbolic";
const f = symbolic.sym("x^2*y^3 + exp(x*y)");
console.log([f.diff("x"), f.diff("y")]);
Checked output
[2*x*y^3 + exp(x*y)*y, 3*x^2*y^2 + exp(x*y)*x]
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. Linear equations in one time and one space dimension or two space dimensions, with simple coefficients and characteristic data.
Focal example. The code above passed its displayed check in 0.225 ms on Node.
Same API, measured input family.symbolic.sym.diff · degree. Baseline test points across courses 1, 2, 4, 8. Derivative of x^n at 2 is n·2^(n−1).
Practical limit. Largest passing sample 1,024 (0.459 ms, 74.4 MiB peak process RSS). The runs did not locate a ceiling for this family. A monomial differentiates to one term. Products, repeated derivatives and expression expansion can make intermediate expressions much larger.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
0.157
75.7
2
Baseline
Passed
0.192
75.7
4
Baseline
Passed
0.276
75.2
8
Baseline
Passed
0.642
75.5
16
Stretch
Passed
18.83
74.7
64
Stretch
Passed
0.406
75
256
Stretch
Passed
0.241
75.3
1,024
Stretch
Passed
0.459
74.4
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.sym · 14 passing test cases, 44 distinct argument descriptions
It is first order and quasilinear. The coefficient of uₓ depends on u.
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. Linear equations in one time and one space dimension or two space dimensions, with simple coefficients and characteristic 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 07 / 40 · Classification and transport
Characteristic crossing
Worked by hand
Problem
For inviscid Burgers with u(x,0)=−x, when do classical characteristics first meet?
Worked solution
A characteristic from ξ is x=ξ−tξ. At t=1 every such line passes through x=0 and the smooth solution breaks down.
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. Linear equations in one time and one space dimension or two space dimensions, with simple coefficients and characteristic 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 08 / 40 · Classification and transport
Initial and boundary data
Worked by hand
Problem
For uₜ+2uₓ=0 on x>0, which boundary supplies inflow?
Worked solution
Characteristics move right, so x=0 supplies values to the domain for positive time.
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. Linear equations in one time and one space dimension or two space dimensions, with simple coefficients and characteristic 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 09 / 40 · Diffusion
Heat equation, fixed ends
Direct calculation@ratmath/analytic
Problem
A rod with , ends held at 0, starts at . Find .
Worked solution
for odd , so ; at the point, .
Using RatMath
Enter the differential equation data with the domain, boundary conditions and initial profile requested. Evaluate the resulting solution at the stated coordinates.
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. A finite rod, positive diffusivity, compatible boundary data and approximately 1–16 modes in a classroom partial sum.
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 188 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
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. A finite rod, positive diffusivity, compatible boundary data and approximately 1–16 modes in a classroom partial sum.
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 on with fixed ends, at what rate does the slowest mode decay?
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: 2, length: 3, initial: "x*(3 - x)" }).modes[0].rate);
Checked output
2*(pi/3)^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. A finite rod, positive diffusivity, compatible boundary data and approximately 1–16 modes in a classroom partial sum.
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 202 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 rod with insulated ends starts at . Find , and the temperature it tends to.
Worked solution
Cosine series: . So , tending to the mean, .
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({ length: 1, initial: "x", ends: "insulated" }).at(0, 1).value);
Checked output
0.4999790373822083[0213:2744]
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. A finite rod, positive diffusivity, compatible boundary data and approximately 1–16 modes in a classroom partial sum.
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 136 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
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.heatLine({ initial: "exp(-x^2)" }).at(1, "1/2"));
Checked output
0.4136895450425679529:0.41368954504257877051
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. A finite rod, positive diffusivity, compatible boundary data and approximately 1–16 modes in a classroom partial sum.
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 178 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
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.heatLine · 1 passing test case, 1 distinct argument description
On the whole line solve with initial profile . Show the total heat is constant and find it.
Worked solution
, so it stays .
Using RatMath
Integrate the PDE and use decay of the boundary flux at both infinities. The initial Gaussian integral sets the constant.
JavaScript module
import * as analytic from "@ratmath/analytic";
console.log(analytic.heatLine({ initial: "exp(-x^2)" }).heat());
Checked output
1.77245385090551[432259:858168]
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. A finite rod, positive diffusivity, compatible boundary data and approximately 1–16 modes in a classroom partial sum.
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 55.93 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
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.heatLine · 1 passing test case, 1 distinct argument description
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. A finite rod, positive diffusivity, compatible boundary data and approximately 1–16 modes in a classroom partial sum.
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
If the rod length doubles and diffusivity stays fixed, how does its first-mode decay time change?
Worked solution
The time scale is proportional to L²/κ, so it quadruples.
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^2`));
Checked output
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. A finite rod, positive diffusivity, compatible boundary data and approximately 1–16 modes in a classroom partial sum.
Focal example. The code above passed its displayed check in 0.140 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.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
A string with starts at rest in the shape . Find .
Worked solution
, so .
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.wave({ c: 1, length: 1, position: "sin(pi*x)" }).at("1/4", "1/3"));
Checked output
0.3535533905932737622:0.35355339059327376221
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 strings or lines, positive wave speed and a few modes or a simple explicit displacement/velocity.
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.07 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
A plucked string , , starts at rest as . Compare with .
Worked solution
The motion has period , so both are .
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 s = analytic.wave({ c: 1, length: 1, position: "x*(1 - x)" });
console.log([s.at("1/3", 2), s.at("1/3", 0)]);
Checked output
[2/9, 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 strings or lines, positive wave speed and a few modes or a simple explicit displacement/velocity.
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 0.228 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
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.wave({ c: 1, position: "exp(-x^2)" }).at(3, 3));
Checked output
0.5000000000000001159[7: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. One-dimensional strings or lines, positive wave speed and a few modes or a simple explicit displacement/velocity.
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 0.259 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
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.wave({ c: 1, position: "0", velocity: "1/(1 + x^2)" }).at(0, 1));
Checked output
0.785398163397[10379986:79262657]
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 strings or lines, positive wave speed and a few modes or a simple explicit displacement/velocity.
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 7.94 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
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. One-dimensional strings or lines, positive wave speed and a few modes or a simple explicit displacement/velocity.
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
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.linearODE([1, 2, 5]).general);
Checked output
y = C1*cos(2*x)*exp(-x) + C2*sin(2*x)*exp(-x)
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 strings or lines, positive wave speed and a few modes or a simple explicit displacement/velocity.
For this problem type. Use a scalar ODE or a two-state system with a short time interval. Hand traces use a few steps and classroom comparisons commonly use 10–100.
Focal example. The code above passed its displayed check in 1.90 ms on Node.
Related workload in this unit.analytic.odeMethod · Euler steps. Baseline test points across courses 1, 4, 10, 50. For y′=y and h=1/n, check the floating Euler iterate against exp(n log1p(1/n)) within 10⁻¹¹. Method error relative to e is separate.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000 (292 ms, 90.4 MiB peak process RSS). The first sampled passing call above 100 ms used 300 (117 ms). The runs did not locate a ceiling for this family. Smaller steps reduce Euler truncation error for a suitably stable problem. The teaching trace uses doubles. Stiff equations can require vastly smaller steps.
Measured times, memory and outcomes
Euler steps · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
51.00
90.3
4
Baseline
Passed
34.01
89.8
10
Baseline
Passed
36.24
89.6
50
Baseline
Passed
61.43
89.9
100
Stretch
Passed
66.45
90.3
300
Stretch
Passed
117
89.3
1,000
Stretch
Passed
292
90.4
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.linearODE · 3 passing test cases, 8 distinct argument descriptions
For a wave with speed 3, what initial interval influences (x,t)=(5,2)?
Worked solution
The characteristic endpoints are 5−6 and 5+6. Velocity data across [−1,11] enter d’Alembert’s integral.
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([R`5-3*2`,R`5+3*2`]);
Checked output
[-1, 11]
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 strings or lines, positive wave speed and a few modes or a simple explicit displacement/velocity.
Focal example. The code above passed its displayed check in 0.157 ms on Node.
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
Why use an odd extension at x=0 for a wave with zero displacement there?
Worked solution
Reflected contributions cancel at the endpoint. An even extension instead enforces a zero normal derivative for smooth 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. One-dimensional strings or lines, positive wave speed and a few modes or a simple explicit displacement/velocity.
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 25 / 40 · Elliptic problems
Laplace on a rectangle
Direct calculation@ratmath/analytic
Problem
Solve on the unit square with on the top edge and 0 on the other three. Find .
Worked solution
, so .
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.laplaceRectangle({ top: "sin(pi*x)", terms: 16 }).at("1/2", "1/2").value);
Checked output
0.1992684076691933402[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. Rectangles or disks with simple boundary data; low modes or 4–32 terms and a few interior 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.34 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
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.laplaceRectangle · 2 passing test cases, 5 distinct argument descriptions
A disc of radius 1 has its rim held at . What is the steady temperature at the centre?
Worked solution
The mean of the boundary values: .
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.laplaceDisc({ boundary: "cos(theta)^2", terms: 4 }).mean);
Checked output
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. Rectangles or disks with simple boundary data; low modes or 4–32 terms and a few interior 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 0.230 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
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
Find the steady harmonic temperature in the unit disc at radius 1/2 and angle 0 when the rim is held at cos²θ.
Worked solution
, so and .
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.laplaceDisc({ boundary: "cos(theta)^2", terms: 32 }).at("1/2", 0).value);
Checked output
5/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. Rectangles or disks with simple boundary data; low modes or 4–32 terms and a few interior 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 0.231 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
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
Find the steady temperature of a rod with a uniform heat source, , , at the midpoint.
Worked solution
, so .
Using RatMath
Integrate the steady equation and apply both boundary conditions to obtain the exact polynomial. Compare its midpoint value to the numerical boundary-value enclosure.
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. Rectangles or disks with simple boundary data; low modes or 4–32 terms and a few interior evaluation points.
For this problem type. Use a scalar ODE or a two-state system with a short time interval. Hand traces use a few steps and classroom comparisons commonly use 10–100.
Focal example. The code above passed its displayed check in 17.11 ms on Node.
Related workload in this unit.analytic.odeMethod · Euler steps. Baseline test points across courses 1, 4, 10, 50. For y′=y and h=1/n, check the floating Euler iterate against exp(n log1p(1/n)) within 10⁻¹¹. Method error relative to e is separate.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 1,000 (292 ms, 90.4 MiB peak process RSS). The first sampled passing call above 100 ms used 300 (117 ms). The runs did not locate a ceiling for this family. Smaller steps reduce Euler truncation error for a suitably stable problem. The teaching trace uses doubles. Stiff equations can require vastly smaller steps.
Measured times, memory and outcomes
Euler steps · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
51.00
90.3
4
Baseline
Passed
34.01
89.8
10
Baseline
Passed
36.24
89.6
50
Baseline
Passed
61.43
89.9
100
Stretch
Passed
66.45
90.3
300
Stretch
Passed
117
89.3
1,000
Stretch
Passed
292
90.4
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.bvp · 3 passing test cases, 4 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. Rectangles or disks with simple boundary data; low modes or 4–32 terms and a few interior 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
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. Rectangles or disks with simple boundary data; low modes or 4–32 terms and a few interior evaluation points.
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 2,795 ms on Node.
Related workload in this unit.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. The cutoff for this lesson’s own code is unmeasured. 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. 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.surfaceIntegral · 1 passing test case, 2 distinct argument descriptions
["0", "0", "z + x"] (n=3), ["x", "y", "z"] (n=3), {x="u", y="w", z="1"}, ["u", "w"] (n=2), {u=[0, 1] (n=2), w=[0, 2] (n=2)} or "1", ["x", "y", "z"] (n=3), {x="cos(u)", y="sin(u)", z="w"}, ["u", "w"] (n=2), {u=[0, 1] (n=2), w=[0, 2] (n=2)}, {digits=4} · flux through a flat patch and the area of a cylinder
Day 31 / 40 · Elliptic problems
Maximum principle
Worked by hand
Problem
Can a nonconstant harmonic temperature on a bounded connected domain attain its maximum strictly inside?
Worked solution
No. The strong maximum principle rules this out. Continuity on the closure allows the boundary to carry the maximum.
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. Rectangles or disks with simple boundary data; low modes or 4–32 terms and a few interior 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.
Day 32 / 40 · Elliptic problems
Neumann uniqueness
Worked by hand
Problem
Why can a pure Neumann Poisson solution be unique only up to a constant on a connected domain?
Worked solution
Adding a constant leaves the Laplacian and normal derivative unchanged. A mean-value condition can select one solution if compatibility holds.
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. Rectangles or disks with simple boundary data; low modes or 4–32 terms and a few interior 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.
Day 33 / 40 · Spectral methods
Sturm–Liouville eigenvalues
Direct calculation@ratmath/analytic
Problem
Find the first two eigenvalues of , .
Worked solution
: and .
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: 2 }).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. Small Sturm–Liouville spectra or Fourier coefficients, typically the first 1–16 modes. Tail bounds depend on data regularity.
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 1,175 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 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.sturmLiouville({ interval: [0, 2], count: 1 })[0].eigenvalue));
Checked output
12337003/5000000:771063/312500
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. Small Sturm–Liouville spectra or Fourier coefficients, typically the first 1–16 modes. Tail bounds depend on data regularity.
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 327 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
A rod at temperature 1 has its ends plunged into ice. What is the first coefficient of its sine series on ?
Worked solution
, so .
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({ initial: "1" }).modes[0].coefficient);
Checked output
1.273239544735[14738003:25132866]
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. Small Sturm–Liouville spectra or Fourier coefficients, typically the first 1–16 modes. Tail bounds depend on data regularity.
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 117 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
Use the data and parameter order shown below. Compare the returned value with the intermediate quantities in the worked solution.
JavaScript module
import * as symbolic from "@ratmath/symbolic";
const PRINT = console.log;
const u = "exp(-t)*sin(x)";
const D = (e, v) => symbolic.format(symbolic.differentiate(symbolic.parse(e), v));
const ut = D(u, "t"), uxx = D(D(u, "x"), "x");
PRINT("u_t =", ut, " u_xx =", uxx);
console.log(String(symbolic.simplify(`(${ut}) - (${uxx})`)));
Checked output
0
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. Small Sturm–Liouville spectra or Fourier coefficients, typically the first 1–16 modes. Tail bounds depend on data regularity.
Focal example. The code above passed its displayed check in 0.821 ms on Node.
Related workload in this unit.symbolic.expand · degree. Baseline test points across courses 1, 2, 4, 8. Sum the expanded coefficients at x=1 by direct substitution; result 2^n. Also check at x=0 and 2.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 128 (47.68 ms, 96.3 MiB peak process RSS). The runs did not locate a ceiling for this family. A univariate binomial has n+1 terms. With several variables the number of monomials can grow combinatorially even at modest degree.
Measured times, memory and outcomes
degree · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
26.10
75.9
2
Baseline
Passed
3.05
75.5
4
Baseline
Passed
2.75
77.3
8
Baseline
Passed
4.23
79.5
16
Stretch
Passed
5.88
82.6
32
Stretch
Passed
6.12
87.9
64
Stretch
Passed
15.73
89.5
128
Stretch
Passed
47.68
96.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.
symbolic.format · 1 passing test case, 2 distinct argument descriptions
{type="var", name="y"} or {type="op", op="*", args=[Object, Object] (n=2)} · matching
symbolic.differentiate · 1 passing test case, 3 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. Small Sturm–Liouville spectra or Fourier coefficients, typically the first 1–16 modes. Tail bounds depend on data regularity.
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
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. Small Sturm–Liouville spectra or Fourier coefficients, typically the first 1–16 modes. Tail bounds depend on data regularity.
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
Which inner product is appropriate for a Sturm–Liouville problem with weight w?
Worked solution
Integrate f(x)g(x)w(x) over the domain for real functions, conjugating one factor for complex functions.
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. Small Sturm–Liouville spectra or Fourier coefficients, typically the first 1–16 modes. Tail bounds depend on data regularity.
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 40 / 40 · Spectral methods
Heat stability
Assisted@ratmath/core
Problem
The explicit centered heat scheme on a uniform one-dimensional grid has r=κΔt/Δx². Does r=3/4 meet the usual stability bound?
Worked solution
No. The standard bound is r≤1/2. The Nyquist amplification factor 1−4r is −2, of magnitude 2.
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`1-4*3/4`));
Checked output
-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. Small Sturm–Liouville spectra or Fourier coefficients, typically the first 1–16 modes. Tail bounds depend on data regularity.
Focal example. The code above passed its displayed check in 0.148 ms on Node.
Same arithmetic expression. Replaced its first numeral 1 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