31 of 40 focal problems use RatMath for a calculation or a substantive step.
Direct calculation
28 · 70%
Assisted
3 · 7.5%
Worked by hand
9 · 22.5%
Using the packages
Classifying the equation and carrying initial data are distinct steps. Symbolic formulas help with standard families, while analytic routines expose intervals for numerical solutions.
Calculator interface
Ask for dependent variable, independent variable and initial data explicitly. Pair a slope field with a symbolic solution and show a residual and interval of existence.
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
31 of 40 days include a checked executable example. On 5 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 · First-order models. Scalar first-order equations with one initial value, a small number of parameters and a real interval where the formula is defined.
Unit benchmark · analytic.odeMethod, Euler steps. 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.
Days 9–16 · Second-order equations. Second-order constant-coefficient equations, two initial conditions and forcing from a short polynomial, exponential or sinusoid.
Unit benchmark · analytic.odeMethod, Euler steps. 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.
Days 17–24 · Transforms and series. Short transform pairs and power-series orders around 3–10; respect the convergence region and shift conventions.
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 25–32 · Systems and geometry. Two- or three-dimensional autonomous systems with a few equilibria and a 2×2 or 3×3 linearization.
Unit benchmark · linalg.eigenvalues.exact, matrix side. Largest passing sample 18 (18.30 ms, 87.1 MiB peak process RSS). The runs did not locate a ceiling for this family.
Days 33–40 · Numerical and boundary problems. Scalar or two-state problems; roughly 4–100 steps for a teaching calculation and a bounded time interval.
Unit benchmark · analytic.odeMethod, Euler steps. 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.
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. Scalar first-order equations with one initial value, a small number of parameters and a real interval where the formula is defined.
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
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("exp(-x) - 2*y").through(0, 0).solution);
Checked output
exp(-x) - exp(-2*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. Scalar first-order equations with one initial value, a small number of parameters and a real interval where the formula is defined.
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.37 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
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.exactEquation("2*x*y + 3", "x^2 - 1").implicit);
Checked output
y*x^2 + 3*x - y = C
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. Scalar first-order equations with one initial value, a small number of parameters and a real interval where the formula is defined.
Focal example. The code above passed its displayed check in 1.44 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.exactEquation · 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.firstOrder("y^2 - y").general);
Checked output
y = 1/(C*exp(x) + 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. Scalar first-order equations with one initial value, a small number of parameters and a real interval where the formula is defined.
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.83 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
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)/x").general);
Checked output
y = log(abs(x))*x + C*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. Scalar first-order equations with one initial value, a small number of parameters and a real interval where the formula is defined.
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 2.46 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
Coffee at 90° cools in a 20° room, . After 10 minutes it is 60°. What is it after 20 minutes?
Worked solution
, . At 20 minutes: .
Using RatMath
Model the temperature excess above ambient and infer its ten-minute multiplier from the observations.
JavaScript module
import * as analytic from "@ratmath/analytic";
import * as symbolic from "@ratmath/symbolic";
const PRINT = console.log;
PRINT(analytic.firstOrder("-k*(T - 20)", { y: "T", x: "t" }).general); // T = 20 + C e^(−kt), and C = 70 from T(0) = 90
const k = symbolic.solve("70*exp(-10*k) = 40", "k").solutions[0].value;
PRINT("k =", k);
console.log(String(symbolic.simplify(`20 + 70*exp(-20*(${k}))`)));
Checked output
300/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. Scalar first-order equations with one initial value, a small number of parameters and a real interval where the formula is defined.
For this problem type. Start with one unknown, small signed coefficients and degree one or two. Higher-degree or parameter-dependent equations need separate cases.
Focal example. The code above passed its displayed check in 22.51 ms on Node.
Same API, measured input family.symbolic.solve · absolute coefficient. Baseline test points across courses 1, 2, 10, 100. Solve n·x+1=3n+1; the unique root is 3.
Practical limit. Largest passing sample 1,000,000,000 (6.48 ms, 75.9 MiB peak process RSS). The runs did not locate a ceiling for this family. One linear unknown has a simple root here. A vanishing coefficient may produce no solution or infinitely many. Multiple parameters require case analysis.
Measured times, memory and outcomes
absolute coefficient · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
16.76
75.8
2
Baseline
Passed
7.72
74.9
10
Baseline
Passed
29.10
75.2
100
Baseline
Passed
12.79
74.6
10,000
Stretch
Passed
28.50
76.3
1,000,000,000
Stretch
Passed
6.48
75.9
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.firstOrder · 3 passing test cases, 9 distinct argument descriptions
Which solution of y′=y² is lost on dividing by y²?
Worked solution
The constant solution y=0 satisfies the original equation. Check equilibria before dividing.
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. Scalar first-order equations with one initial value, a small number of parameters and a real interval where the formula is defined.
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 · First-order models
Finite-time blow-up
Direct calculation@ratmath/core
Problem
For y′=y² and y(0)=2, when does the positive solution cease to exist forward in time?
Worked solution
Integration gives y=2/(1−2t). Its first forward pole is at t=1/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/2`));
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. Scalar first-order equations with one initial value, a small number of parameters and a real interval where the formula is defined.
Focal example. The code above passed its displayed check in 0.121 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
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, -5, 6]).general);
Checked output
y = C1*exp(2*x) + C2*exp(3*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. Second-order constant-coefficient equations, two initial conditions and forcing from a short polynomial, exponential or sinusoid.
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.62 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
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, 4, 4]).initial([1, 0]).solution);
Checked output
y = 2*x*exp(-2*x) + exp(-2*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. Second-order constant-coefficient equations, two initial conditions and forcing from a short polynomial, exponential or sinusoid.
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 2.07 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
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. Second-order constant-coefficient equations, two initial conditions and forcing from a short polynomial, exponential or sinusoid.
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
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, -3, 2], "4*x").particular);
Checked output
2*x + 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. Second-order constant-coefficient equations, two initial conditions and forcing from a short polynomial, exponential or sinusoid.
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.19 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
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, 0, 1], "cos(x)").particular);
Checked output
1/2*x*sin(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. Second-order constant-coefficient equations, two initial conditions and forcing from a short polynomial, exponential or sinusoid.
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 0.780 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
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, 0, 1], "sec(x)").particular);
Checked output
log(abs(cos(x)))*cos(x) + x*sin(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. Second-order constant-coefficient equations, two initial conditions and forcing from a short polynomial, exponential or sinusoid.
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 5.91 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
One is twice the other, so their Wronskian is identically zero and they span one dimension.
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. Second-order constant-coefficient equations, two initial conditions and forcing from a short polynomial, exponential or sinusoid.
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 16 / 40 · Second-order equations
Damped oscillation
Worked by hand
Problem
What type of motion does y″+2y′+5y=0 describe?
Worked solution
The roots are −1±2i, yielding decaying oscillation with angular frequency 2.
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. Second-order constant-coefficient equations, two initial conditions and forcing from a short polynomial, exponential or sinusoid.
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 · Transforms and series
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.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. Short transform pairs and power-series orders around 3–10; respect the convergence region and shift conventions.
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
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. Short transform pairs and power-series orders around 3–10; respect the convergence region and shift conventions.
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.laplaceSolve([1, 1], "heaviside(t - 1)", [0]).solution);
Checked output
heaviside(t - 1)*(1 - exp(-t + 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. Short transform pairs and power-series orders around 3–10; respect the convergence region and shift conventions.
Focal example. The code above passed its displayed check in 3.04 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.laplaceSolve · 1 passing test case, 2 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. Short transform pairs and power-series orders around 3–10; respect the convergence region and shift conventions.
For this problem type. Typical hand calculations keep 2–10 nonzero terms. Specify the expansion center and distance of the evaluation point from it.
Focal example. The code above passed its displayed check in 1.16 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.seriesSolution · 3 passing test cases, 15 distinct argument descriptions
A unit impulse acts at t=a in y″+y=δ(t−a) on an initially resting oscillator. What jumps across a?
Worked solution
The displacement stays continuous. Integrating the equation across a vanishing interval shows that velocity jumps up by one. Subsequently y=sin(t−a) until any further forcing.
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. Short transform pairs and power-series orders around 3–10; respect the convergence region and shift conventions.
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 22 / 40 · Transforms and series
Convolution response
Worked by hand
Problem
Find y(t) when y′+y=1 and y(0)=0 using the impulse response.
Worked solution
For t≥0 integrate exp(−(t−s)) from s=0 to t. This gives 1−exp(−t), which begins at zero and tends to one.
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. Short transform pairs and power-series orders around 3–10; respect the convergence region and shift conventions.
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 23 / 40 · Transforms and series
Transforming initial data
Worked by hand
Problem
Write the Laplace transform of y′ when y(0)=3.
Worked solution
Integration by parts gives sY(s)−3. The initial-value term matters when solving for Y.
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. Short transform pairs and power-series orders around 3–10; respect the convergence region and shift conventions.
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.
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*2*1)`));
Checked output
1/24
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. Short transform pairs and power-series orders around 3–10; respect the convergence region and shift conventions.
Focal example. The code above passed its displayed check in 0.166 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
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. Two- or three-dimensional autonomous systems with a few equilibria and a 2×2 or 3×3 linearization.
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 2.42 ms on Node.
Related workload in this unit.linalg.solve.exact · unknowns. Baseline test points across courses 1, 2, 4, 8. For dense I+J and b=(n+1)·1 every component of x must be one.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 128 (64.25 ms, 90.7 MiB peak process RSS). The runs did not locate a ceiling for this family. Solving a nonsingular system checks one solution. Singular or inconsistent systems require rank and consistency checks. Large denominators increase exact cost.
Measured times, memory and outcomes
unknowns · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
22.32
75.6
2
Baseline
Passed
2.28
75.3
4
Baseline
Passed
7.02
75.1
8
Baseline
Passed
2.47
75.3
16
Stretch
Passed
4.34
77.1
32
Stretch
Passed
8.06
79.4
64
Stretch
Passed
63.87
89.9
128
Stretch
Passed
64.25
90.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.linearSystem · 2 passing test cases, 9 distinct argument descriptions
Trace , determinant 1, discriminant : a stable spiral.
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 L = analytic.linearSystem([[0, 1], [-1, -1]]);
console.log([L.kind, L.stability]);
Checked output
["stable spiral", "asymptotically stable"]
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. Two- or three-dimensional autonomous systems with a few equilibria and a 2×2 or 3×3 linearization.
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.26 ms on Node.
Related workload in this unit.linalg.solve.exact · unknowns. Baseline test points across courses 1, 2, 4, 8. For dense I+J and b=(n+1)·1 every component of x must be one.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 128 (64.25 ms, 90.7 MiB peak process RSS). The runs did not locate a ceiling for this family. Solving a nonsingular system checks one solution. Singular or inconsistent systems require rank and consistency checks. Large denominators increase exact cost.
Measured times, memory and outcomes
unknowns · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
22.32
75.6
2
Baseline
Passed
2.28
75.3
4
Baseline
Passed
7.02
75.1
8
Baseline
Passed
2.47
75.3
16
Stretch
Passed
4.34
77.1
32
Stretch
Passed
8.06
79.4
64
Stretch
Passed
63.87
89.9
128
Stretch
Passed
64.25
90.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.linearSystem · 2 passing test cases, 9 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. Two- or three-dimensional autonomous systems with a few equilibria and a 2×2 or 3×3 linearization.
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 53.33 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.planarSystem · 1 passing test case, 2 distinct argument descriptions
Supply the matrix in row order. Keep exact roots in algebraic form when comparing multiplicities or reporting a stretch factor.
JavaScript module
import * as linalg from "@ratmath/linalg";
console.log(
linalg.eigenvectors([[4, 1], [2, 3]]).exact().map((e) => [e.value.toString(), e.vectors])
);
Checked output
[["2", [[[-1/2], [1]]]], ["5", [[[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. Two- or three-dimensional autonomous systems with a few equilibria and a 2×2 or 3×3 linearization.
For this problem type. Use 2×2 through 4×4 matrices for hand spectra, including repeated eigenvalues. An entry’s size alone gives little indication of root-isolation cost.
Focal example. The code above passed its displayed check in 1.68 ms on Node.
Related workload in this unit.linalg.eigenvalues.exact · matrix side. Baseline test points across courses 1, 2, 3, 4. An upper bidiagonal matrix has diagonal entries 1 through n as its full spectrum.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 18 (18.30 ms, 87.1 MiB peak process RSS). The runs did not locate a ceiling for this family. The triangular example has rational eigenvalues. General characteristic polynomials, repeated roots and algebraic root isolation are harder.
Measured times, memory and outcomes
matrix side · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.92
75.5
2
Baseline
Passed
6.14
75.2
3
Baseline
Passed
3.11
75
4
Baseline
Passed
7.05
76.1
6
Stretch
Passed
4.26
75.4
10
Stretch
Passed
7.90
78.4
18
Stretch
Passed
18.30
87.1
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.eigenvectors · 6 passing test cases, 4 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 linalg from "@ratmath/linalg";
console.log(String(linalg.power([[1, 1], [1, 0]], 10).exact()));
Checked output
[89, 55]
[55, 34]
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. Two- or three-dimensional autonomous systems with a few equilibria and a 2×2 or 3×3 linearization.
Focal example. The code above passed its displayed check in 0.360 ms on Node.
Related workload in this unit.linalg.eigenvalues.exact · matrix side. Baseline test points across courses 1, 2, 3, 4. An upper bidiagonal matrix has diagonal entries 1 through n as its full spectrum.
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 18 (18.30 ms, 87.1 MiB peak process RSS). The runs did not locate a ceiling for this family. The triangular example has rational eigenvalues. General characteristic polynomials, repeated roots and algebraic root isolation are harder.
Measured times, memory and outcomes
matrix side · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
1
Baseline
Passed
1.92
75.5
2
Baseline
Passed
6.14
75.2
3
Baseline
Passed
3.11
75
4
Baseline
Passed
7.05
76.1
6
Stretch
Passed
4.26
75.4
10
Stretch
Passed
7.90
78.4
18
Stretch
Passed
18.30
87.1
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.power · 1 passing test case, 6 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. Two- or three-dimensional autonomous systems with a few equilibria and a 2×2 or 3×3 linearization.
Focal example. The code above passed its displayed check in 8.30 ms on Node.
Related workload in this unit.chaos.logistic.orbit · exact iterations. Baseline test points across courses 0, 1, 3, 6, 10. At r=4 and x₀=1/3, compare with the unreduced integer recurrence p′=4p(q−p), q′=q².
Practical limit. The cutoff for this lesson’s own code is unmeasured. Largest passing sample 15 (174 ms, 88.4 MiB peak process RSS). Library refusal at 18, 20. The first sampled passing call above 100 ms used 15 (174 ms). For r=4 from 1/3 the reduced denominator squares each iterate. Exact integer growth can end a computation long before the orbit leaves [0,1].
Measured times, memory and outcomes
exact iterations · one run per input
Input
Sample
Result
Call (ms)
Peak RSS (MiB)
0
Baseline
Passed
1.16
75.6
1
Baseline
Passed
0.793
75.7
3
Baseline
Passed
0.797
74.5
6
Baseline
Passed
0.889
74.8
10
Baseline
Passed
1.28
77.4
12
Stretch
Passed
3.36
76.7
15
Stretch
Passed
174
88.4
18
Stretch
Library refusal · ChaosError: the exact orbit needs more than 200000 binary digits by step 16; use enclosedOrbit for long orbits
772
89
20
Stretch
Library refusal · ChaosError: the exact orbit needs more than 200000 binary digits by step 16; use enclosedOrbit for long orbits
712
88.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.
chaos.pendulum · 1 passing test case, 1 distinct argument description
For x′=y and y′=−x, where is the velocity horizontal?
Worked solution
A horizontal nonzero arrow requires y′=0 and x′≠0. Thus x=0 and y≠0.
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. Two- or three-dimensional autonomous systems with a few equilibria and a 2×2 or 3×3 linearization.
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 · Systems and geometry
Linearization at zero eigenvalues
Worked by hand
Problem
Does the linearization of y′=−y³ at zero determine stability?
Worked solution
Its linearization vanishes. The sign of the nonlinear field points toward zero from both sides.
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. Two- or three-dimensional autonomous systems with a few equilibria and a 2×2 or 3×3 linearization.
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 · Numerical and boundary problems
Euler's method
Direct calculation@ratmath/analytic
Problem
Use Euler's method with on , to estimate .
Worked solution
: (true value ).
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.odeMethod("y", { method: "euler", y0: 1, until: 1, steps: 4 }).steps.at(-1).y
);
Checked output
2.44140625
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. Scalar or two-state problems; roughly 4–100 steps for a teaching calculation and a bounded time interval.
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 20.19 ms on Node.
Same API, measured input family.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. 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. 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.odeMethod · 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.odeMethod("y", { y0: 1, until: "0.5", steps: 5 }).steps.at(-1).y);
Checked output
1.61051
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. Scalar or two-state problems; roughly 4–100 steps for a teaching calculation and a bounded time interval.
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 6.11 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Same API, measured input family.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. 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. 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.odeMethod · 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.odeMethod("y", { y0: 1, until: "0.1", steps: 1, method: "rk4" }).steps.at(-1).y
);
Checked output
1.1051708333333332
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. Scalar or two-state problems; roughly 4–100 steps for a teaching calculation and a bounded time interval.
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 2.77 ms on Node. Both enclosure endpoints also met the lesson’s stated numerical tolerance.
Same API, measured input family.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. 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. 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.odeMethod · 1 passing test case, 1 distinct argument description
For , what is the largest step for which Euler's method does not grow?
Worked solution
Each step multiplies by ; needs . The stability interval for is .
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 s = analytic.stability("euler");
console.log([s.interval, s.largestStep(-10)]);
Checked output
[[-2, 0], 1/5]
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. Scalar or two-state problems; roughly 4–100 steps for a teaching calculation and a bounded time interval.
Focal example. The code above passed its displayed check in 0.323 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.stability · 1 passing test case, 2 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. Scalar or two-state problems; roughly 4–100 steps for a teaching calculation and a bounded time interval.
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
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. Scalar or two-state problems; roughly 4–100 steps for a teaching calculation and a bounded time interval.
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
For y′=y, y(0)=1, compare one step of size 1 with two half steps at t=1.
Worked solution
The approximations are 2 and 9/4. Refinement gives a different answer but this comparison alone is no rigorous error bound.
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+1/2)^2`));
Checked output
9/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. Scalar or two-state problems; roughly 4–100 steps for a teaching calculation and a bounded time interval.
Focal example. The code above passed its displayed check in 0.139 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.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
Can y″=0 with y(0)=0 and y(1)=1 have more than one solution?
Worked solution
Solutions are ax+b. The two independent boundary conditions give b=0 and a=1.
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. Scalar or two-state problems; roughly 4–100 steps for a teaching calculation and a bounded time interval.
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.