LearnAI optional engineering calculation specification Version: engineering-computing-spec-v1 Model contract: engineering-device-v1 Purpose Implement and test a small thermal-device calculation in a language of your choice. This is optional coding practice, separate from guided lesson completion. No browser execution service or paid API is required. These are original synthetic fixtures, not physical measurements or a certification of a real heater. 1. Pure thermal step Inputs: temperatureC T, ambientC Ta (each -50..100 degrees C); powerW P (0..300 W); conductanceWPerK G (0.1..15 W/K); capacityJPerK C (10..3000 J/K); durationSeconds dt (0..120 s). Reject nonfinite numbers, out-of-domain inputs and unexpected fields. Do not mutate the caller's record. Uniform temperature, constant ambient, G and C, and held heater input are assumed. There is no evaporation, spatial gradient, active cooling or separate radiation law. T_eq = Ta + P/G fraction = -expm1(-G*dt/C) T_next = T + (T_eq-T)*fraction input_J = P*dt stored_J = C*(T_next-T) ambient_J = input_J-stored_J residual_J = input_J-stored_J-ambient_J Positive ambient_J means outward transfer; a body colder than ambient can have negative ambient_J. A zero residual from this subtraction is an accounting identity, not independent confirmation. Check the independent integral too: ambient_J = P*dt + (G*(T-Ta)-P)*(C/G)*(1-exp(-G*dt/C)). Fixture 1: T=20, Ta=20, P=20, G=1, C=100, dt=10. Expected T_next=21.90325163928081 C; input=200 J; stored=190.325163928081 J; ambient=9.674836071919 J. A forward Euler step gives 22 C, exceeding the exact endpoint by 0.09674836071919 C. Fixture 2: same inputs with dt=100: T_next=32.64241117657115 C. Fixture 3: same inputs with dt=0: unchanged T, zero energy transfers. Fixture 4: T=10, Ta=20, P=0, G=1, C=100, dt=10: stored energy is positive and ambient transfer negative. Compare two exact 5-second steps with one exact 10-second step under the same held input. Compare Euler steps at decreasing widths and explain error convergence. Do not refresh the controller midway through a held-input comparison. 2. Sampled controller Initial T=20 C; ambient=20 C; target=30 C; C=100 J/K. Standard enclosure G=1 W/K, assigned cost=3 tokens. Insulated enclosure G=0.5 W/K, assigned cost=5 tokens. Choose gain K from 2,6,12 W/K and fixed subtracted correction c from 0,2 C. For sample i=0..11 at t=10*i seconds, use j=max(0,i-delaySamples). Raw indication=T[j]+biasC; corrected indication=raw-c. Requested P=10+K*(30-corrected); applied P=max(0,min(capW,requested)). Hold this applied input for 10 seconds and propagate exactly. Store 13 true states at 0..120 s and 12 complete observation/command/energy receipts. Negative requested observation times use the held initial state, not measured prehistory. No new command is issued at 120 s. Scenarios: nominal (delay=0,bias=0,cap=20); delayed (delay=2,bias=0,cap=20); offset (delay=0,bias=2,cap=20); limited (delay=0,bias=0,cap=8). Requirements, evaluated without display rounding: All states at 90,100,110,120 s in inclusive 29..31 C; peak no more than 32 C; total applied input no more than 2000 J; assigned cost no more than 6 tokens. Energy is an acceptance criterion, not an automatic cutoff. Endpoints bound within-interval peaks only under the stipulated monotonic exact one-node propagation. Standard enclosure, zero correction fixtures (final C, peak C, input J): Gain 2 nominal: 29.766220, 29.766220, 1821.035488 Gain 6 nominal: 29.998648, 29.998648, 1887.808894 Gain 6 delayed: 29.694914, 31.474386, 1905.207928 Gain 12 nominal: 29.999949, 30.068294, 1893.370525 Gain 6 offset: 28.285453, 28.285453, 1615.244830 Any listed gain limited: 25.590446, 25.590446, 960 Insulated enclosure, gain 12, zero correction, nominal: 30.399996, 30.407176, 1515.220813. The first standard/gain6/nominal request is 70 W, clipped to20 W. The first delayed requested/effective observation times are -20/0,-10/0,0/0,10/10 seconds. Use absolute tolerances 1e-6 C and 1e-5 J for these rounded run fixtures. Explain tolerances for your numeric implementation; never round internally to force a criterion pass. Nominal standard gain2 and insulated gain12 are nondominated on assigned cost/input among feasible candidates. No supplied candidate meets all four scenarios. This finite suite is public development evidence, not a reliability probability. 3. Optional ideal circuit diagnosis Series source -> R1=100 ohm -> junction -> R2=200 ohm -> return. Ideal probes: source-terminal voltage V, junction-to-return voltage V, loop current mA. A healthy 6 V: (6,4,20) B open R1, 6 V: (6,0,0) C open R2, 6 V: (6,6,0) D bypassed R2, 6 V: (6,0,60) E healthy resistors, weak 3 V source: (3,2,10) Compute compatible hypotheses from at most two distinct readings. Terminal6/current0 leaves both B and C; a junction measurement distinguishes them. An unmatched reading produces no compatible supplied hypothesis, not an invented diagnosis. These ideal, noiseless hypotheses do not cover every real fault. Evidence to submit for optional implementation review Provide your source, units/input validation, independent fixture tests, a saved trace, an error/convergence plot or table, and a short explanation of one failed requirement. Include one counterexample not used while implementing. State help, source/code exposure and remaining limitations. Passing supplied fixtures does not establish independent implementation proficiency; a human reviews the code and unfamiliar task. This optional work changes no core completion percentage.