@classytic/stage 0.2.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (458) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +5 -1
  3. package/dist/_virtual/_rolldown/runtime.mjs +18 -0
  4. package/dist/assets/index.mjs +0 -1
  5. package/dist/atomic/aufbau.d.mts +144 -0
  6. package/dist/atomic/aufbau.mjs +384 -0
  7. package/dist/atomic/elements.d.mts +67 -0
  8. package/dist/atomic/elements.mjs +785 -0
  9. package/dist/atomic/emission.d.mts +112 -0
  10. package/dist/atomic/emission.mjs +179 -0
  11. package/dist/atomic/index.d.mts +8 -0
  12. package/dist/atomic/index.mjs +9 -0
  13. package/dist/atomic/periodic.d.mts +82 -0
  14. package/dist/atomic/periodic.mjs +231 -0
  15. package/dist/atomic/properties.d.mts +100 -0
  16. package/dist/atomic/properties.mjs +574 -0
  17. package/dist/atomic/shells.d.mts +137 -0
  18. package/dist/atomic/shells.mjs +170 -0
  19. package/dist/atomic/trends.d.mts +148 -0
  20. package/dist/atomic/trends.mjs +225 -0
  21. package/dist/builder/Palette.mjs +50 -89
  22. package/dist/builder/SceneBuilder.mjs +15 -73
  23. package/dist/chem/chromatography.d.mts +66 -0
  24. package/dist/chem/chromatography.mjs +63 -0
  25. package/dist/chem/complex.d.mts +114 -0
  26. package/dist/chem/complex.mjs +234 -0
  27. package/dist/chem/cycle.d.mts +75 -0
  28. package/dist/chem/cycle.mjs +145 -0
  29. package/dist/chem/equation.d.mts +86 -0
  30. package/dist/chem/equation.mjs +168 -0
  31. package/dist/chem/formula.d.mts +90 -0
  32. package/dist/chem/formula.mjs +201 -0
  33. package/dist/chem/functional-groups.d.mts +31 -0
  34. package/dist/chem/functional-groups.mjs +187 -0
  35. package/dist/chem/hazard.d.mts +94 -0
  36. package/dist/chem/hazard.mjs +329 -0
  37. package/dist/chem/index.d.mts +34 -33
  38. package/dist/chem/index.mjs +34 -28
  39. package/dist/chem/ionic.d.mts +98 -0
  40. package/dist/chem/ionic.mjs +156 -0
  41. package/dist/chem/layout.d.mts +46 -0
  42. package/dist/chem/layout.mjs +342 -0
  43. package/dist/chem/lewis.d.mts +79 -0
  44. package/dist/chem/lewis.mjs +163 -0
  45. package/dist/chem/molecular-orbital.d.mts +114 -0
  46. package/dist/chem/molecular-orbital.mjs +201 -0
  47. package/dist/chem/molecule.d.mts +154 -0
  48. package/dist/chem/molecule.mjs +282 -0
  49. package/dist/chem/nmr.d.mts +153 -0
  50. package/dist/chem/nmr.mjs +165 -0
  51. package/dist/chem/polymer.d.mts +65 -0
  52. package/dist/chem/polymer.mjs +179 -0
  53. package/dist/chem/redox.d.mts +138 -0
  54. package/dist/chem/redox.mjs +328 -0
  55. package/dist/chem/relations.d.mts +183 -0
  56. package/dist/chem/relations.mjs +299 -0
  57. package/dist/chem/skeleton.d.mts +51 -0
  58. package/dist/chem/skeleton.mjs +186 -0
  59. package/dist/chem/solution.d.mts +116 -0
  60. package/dist/chem/solution.mjs +186 -0
  61. package/dist/chem/species.d.mts +47 -0
  62. package/dist/chem/species.mjs +128 -0
  63. package/dist/chem/stereo.d.mts +108 -0
  64. package/dist/chem/stereo.mjs +286 -0
  65. package/dist/chem/stoichiometry.d.mts +95 -0
  66. package/dist/chem/stoichiometry.mjs +145 -0
  67. package/dist/chem/synthesis.d.mts +113 -0
  68. package/dist/chem/synthesis.mjs +281 -0
  69. package/dist/chem/vsepr.d.mts +80 -0
  70. package/dist/chem/vsepr.mjs +247 -0
  71. package/dist/circuit/ac.d.mts +163 -0
  72. package/dist/circuit/ac.mjs +452 -0
  73. package/dist/circuit/dc.d.mts +92 -0
  74. package/dist/circuit/dc.mjs +333 -0
  75. package/dist/circuit/index.d.mts +5 -92
  76. package/dist/circuit/index.mjs +5 -332
  77. package/dist/circuit/network.d.mts +99 -0
  78. package/dist/circuit/network.mjs +440 -0
  79. package/dist/circuit/topology.d.mts +102 -0
  80. package/dist/circuit/topology.mjs +143 -0
  81. package/dist/colour/absorption.d.mts +79 -0
  82. package/dist/colour/absorption.mjs +137 -0
  83. package/dist/colour/index.d.mts +6 -0
  84. package/dist/colour/index.mjs +7 -0
  85. package/dist/colour/name.d.mts +14 -0
  86. package/dist/colour/name.mjs +76 -0
  87. package/dist/colour/observer.d.mts +31 -0
  88. package/dist/colour/observer.mjs +46 -0
  89. package/dist/colour/spectrum.d.mts +61 -0
  90. package/dist/colour/spectrum.mjs +108 -0
  91. package/dist/colour/srgb.d.mts +49 -0
  92. package/dist/colour/srgb.mjs +108 -0
  93. package/dist/core/constants.d.mts +138 -0
  94. package/dist/core/constants.mjs +139 -0
  95. package/dist/core/index.d.mts +4 -1
  96. package/dist/core/index.mjs +4 -1
  97. package/dist/core/math.d.mts +26 -0
  98. package/dist/core/math.mjs +37 -0
  99. package/dist/core/vec3.d.mts +94 -0
  100. package/dist/core/vec3.mjs +123 -0
  101. package/dist/core/worked.d.mts +35 -0
  102. package/dist/core/worked.mjs +44 -0
  103. package/dist/electro/cell.d.mts +102 -0
  104. package/dist/electro/cell.mjs +170 -0
  105. package/dist/electro/conductivity.d.mts +157 -0
  106. package/dist/electro/conductivity.mjs +156 -0
  107. package/dist/electro/couples.d.mts +114 -0
  108. package/dist/electro/couples.mjs +334 -0
  109. package/dist/electro/electrolysis.d.mts +96 -0
  110. package/dist/electro/electrolysis.mjs +274 -0
  111. package/dist/electro/faraday.d.mts +150 -0
  112. package/dist/electro/faraday.mjs +118 -0
  113. package/dist/electro/index.d.mts +6 -0
  114. package/dist/electro/index.mjs +7 -0
  115. package/dist/finance/accounting/adjustments.d.mts +17 -0
  116. package/dist/finance/accounting/adjustments.mjs +202 -0
  117. package/dist/finance/accounting/analysis.d.mts +8 -0
  118. package/dist/finance/accounting/analysis.mjs +205 -0
  119. package/dist/finance/accounting/clubs.d.mts +21 -0
  120. package/dist/finance/accounting/clubs.mjs +217 -0
  121. package/dist/finance/accounting/company-statements.d.mts +7 -0
  122. package/dist/finance/accounting/company-statements.mjs +150 -0
  123. package/dist/finance/accounting/harness.d.mts +7 -0
  124. package/dist/finance/accounting/harness.mjs +45 -0
  125. package/dist/finance/accounting/index.d.mts +18 -0
  126. package/dist/finance/accounting/index.mjs +18 -0
  127. package/dist/finance/accounting/journalize.d.mts +16 -0
  128. package/dist/finance/accounting/journalize.mjs +128 -0
  129. package/dist/finance/accounting/manufacturing.d.mts +8 -0
  130. package/dist/finance/accounting/manufacturing.mjs +236 -0
  131. package/dist/finance/accounting/partnership.d.mts +7 -0
  132. package/dist/finance/accounting/partnership.mjs +152 -0
  133. package/dist/finance/accounting/period-case.d.mts +6 -0
  134. package/dist/finance/accounting/period-case.mjs +71 -0
  135. package/dist/finance/accounting/post.d.mts +9 -0
  136. package/dist/finance/accounting/post.mjs +84 -0
  137. package/dist/finance/accounting/precision.d.mts +9 -0
  138. package/dist/finance/accounting/precision.mjs +15 -0
  139. package/dist/finance/accounting/rules.d.mts +21 -0
  140. package/dist/finance/accounting/rules.mjs +37 -0
  141. package/dist/finance/accounting/solve.d.mts +28 -0
  142. package/dist/finance/accounting/solve.mjs +92 -0
  143. package/dist/finance/accounting/statements.d.mts +7 -0
  144. package/dist/finance/accounting/statements.mjs +142 -0
  145. package/dist/finance/accounting/types.d.mts +649 -0
  146. package/dist/finance/accounting/validate.d.mts +7 -0
  147. package/dist/finance/accounting/validate.mjs +67 -0
  148. package/dist/finance/accounting/verification.d.mts +24 -0
  149. package/dist/finance/accounting/verification.mjs +386 -0
  150. package/dist/finance/bizsim.d.mts +75 -0
  151. package/dist/finance/bizsim.mjs +296 -0
  152. package/dist/finance/index.d.mts +95 -0
  153. package/dist/finance/index.mjs +145 -0
  154. package/dist/finance/investment-math.d.mts +7 -0
  155. package/dist/finance/investment-math.mjs +18 -0
  156. package/dist/finance/management-accounting/budgeting.d.mts +7 -0
  157. package/dist/finance/management-accounting/budgeting.mjs +189 -0
  158. package/dist/finance/management-accounting/cash-budget.d.mts +7 -0
  159. package/dist/finance/management-accounting/cash-budget.mjs +154 -0
  160. package/dist/finance/management-accounting/costing.d.mts +8 -0
  161. package/dist/finance/management-accounting/costing.mjs +175 -0
  162. package/dist/finance/management-accounting/decisions.d.mts +8 -0
  163. package/dist/finance/management-accounting/decisions.mjs +164 -0
  164. package/dist/finance/management-accounting/index.d.mts +13 -0
  165. package/dist/finance/management-accounting/index.mjs +13 -0
  166. package/dist/finance/management-accounting/integrated-budget.d.mts +8 -0
  167. package/dist/finance/management-accounting/integrated-budget.mjs +67 -0
  168. package/dist/finance/management-accounting/inventory-costing.d.mts +7 -0
  169. package/dist/finance/management-accounting/inventory-costing.mjs +173 -0
  170. package/dist/finance/management-accounting/investment-appraisal.d.mts +7 -0
  171. package/dist/finance/management-accounting/investment-appraisal.mjs +148 -0
  172. package/dist/finance/management-accounting/management-case.d.mts +8 -0
  173. package/dist/finance/management-accounting/management-case.mjs +91 -0
  174. package/dist/finance/management-accounting/master-budget.d.mts +7 -0
  175. package/dist/finance/management-accounting/master-budget.mjs +137 -0
  176. package/dist/finance/management-accounting/production-costing.d.mts +8 -0
  177. package/dist/finance/management-accounting/production-costing.mjs +214 -0
  178. package/dist/finance/management-accounting/types.d.mts +644 -0
  179. package/dist/finance/management-accounting/variances.d.mts +7 -0
  180. package/dist/finance/management-accounting/variances.mjs +150 -0
  181. package/dist/index.d.mts +9 -8
  182. package/dist/index.mjs +5 -5
  183. package/dist/interaction/MovableDot.mjs +19 -0
  184. package/dist/interaction/useDraggable.mjs +24 -4
  185. package/dist/math/analysis.d.mts +61 -0
  186. package/dist/math/analysis.mjs +187 -0
  187. package/dist/math/answer-check.d.mts +50 -0
  188. package/dist/math/answer-check.mjs +106 -0
  189. package/dist/math/calculus.d.mts +17 -1
  190. package/dist/math/calculus.mjs +365 -2
  191. package/dist/math/complex.d.mts +93 -0
  192. package/dist/math/complex.mjs +239 -0
  193. package/dist/math/expr.d.mts +23 -0
  194. package/dist/math/expr.mjs +36 -0
  195. package/dist/math/index.d.mts +9 -23
  196. package/dist/math/index.mjs +9 -38
  197. package/dist/math/latex.mjs +10 -1
  198. package/dist/math/parse.mjs +1 -1
  199. package/dist/math/poly.d.mts +55 -0
  200. package/dist/math/poly.mjs +273 -0
  201. package/dist/math/rearrange.d.mts +14 -0
  202. package/dist/math/rearrange.mjs +125 -0
  203. package/dist/math/solve.d.mts +21 -0
  204. package/dist/math/solve.mjs +75 -0
  205. package/dist/networking/addressing.d.mts +26 -0
  206. package/dist/networking/addressing.mjs +33 -0
  207. package/dist/networking/cloud/access.d.mts +36 -0
  208. package/dist/networking/cloud/access.mjs +95 -0
  209. package/dist/networking/cloud/containers.d.mts +43 -0
  210. package/dist/networking/cloud/containers.mjs +54 -0
  211. package/dist/networking/cloud/edge.d.mts +17 -0
  212. package/dist/networking/cloud/edge.mjs +31 -0
  213. package/dist/networking/cloud/failure-domains.d.mts +19 -0
  214. package/dist/networking/cloud/failure-domains.mjs +22 -0
  215. package/dist/networking/cloud/geo-routing.d.mts +22 -0
  216. package/dist/networking/cloud/geo-routing.mjs +64 -0
  217. package/dist/networking/cloud/index.d.mts +18 -0
  218. package/dist/networking/cloud/index.mjs +19 -0
  219. package/dist/networking/cloud/inference-reliability.d.mts +30 -0
  220. package/dist/networking/cloud/inference-reliability.mjs +76 -0
  221. package/dist/networking/cloud/inference.d.mts +118 -0
  222. package/dist/networking/cloud/inference.mjs +179 -0
  223. package/dist/networking/cloud/infrastructure.d.mts +45 -0
  224. package/dist/networking/cloud/infrastructure.mjs +96 -0
  225. package/dist/networking/cloud/observability.d.mts +24 -0
  226. package/dist/networking/cloud/observability.mjs +34 -0
  227. package/dist/networking/cloud/orchestration.d.mts +32 -0
  228. package/dist/networking/cloud/orchestration.mjs +38 -0
  229. package/dist/networking/cloud/recovery.d.mts +21 -0
  230. package/dist/networking/cloud/recovery.mjs +27 -0
  231. package/dist/networking/cloud/releases.d.mts +42 -0
  232. package/dist/networking/cloud/releases.mjs +135 -0
  233. package/dist/networking/cloud/scaling.d.mts +25 -0
  234. package/dist/networking/cloud/scaling.mjs +65 -0
  235. package/dist/networking/cloud/secrets.d.mts +39 -0
  236. package/dist/networking/cloud/secrets.mjs +68 -0
  237. package/dist/networking/cloud/server-deployment.d.mts +29 -0
  238. package/dist/networking/cloud/server-deployment.mjs +72 -0
  239. package/dist/networking/cloud/storage.d.mts +16 -0
  240. package/dist/networking/cloud/storage.mjs +58 -0
  241. package/dist/networking/cloud/vpc.d.mts +18 -0
  242. package/dist/networking/cloud/vpc.mjs +100 -0
  243. package/dist/networking/delivery.d.mts +34 -0
  244. package/dist/networking/delivery.mjs +52 -0
  245. package/dist/networking/index.d.mts +47 -0
  246. package/dist/networking/index.mjs +47 -0
  247. package/dist/networking/ipv6.d.mts +28 -0
  248. package/dist/networking/ipv6.mjs +17 -0
  249. package/dist/networking/journeys.d.mts +83 -0
  250. package/dist/networking/journeys.mjs +161 -0
  251. package/dist/networking/models/airtime.d.mts +87 -0
  252. package/dist/networking/models/airtime.mjs +130 -0
  253. package/dist/networking/models/cellular.d.mts +157 -0
  254. package/dist/networking/models/cellular.mjs +252 -0
  255. package/dist/networking/models/encapsulation.d.mts +98 -0
  256. package/dist/networking/models/encapsulation.mjs +132 -0
  257. package/dist/networking/models/handover.d.mts +116 -0
  258. package/dist/networking/models/handover.mjs +209 -0
  259. package/dist/networking/models/handshake.d.mts +90 -0
  260. package/dist/networking/models/handshake.mjs +122 -0
  261. package/dist/networking/models/index.d.mts +14 -0
  262. package/dist/networking/models/index.mjs +15 -0
  263. package/dist/networking/models/media.d.mts +82 -0
  264. package/dist/networking/models/media.mjs +188 -0
  265. package/dist/networking/models/satellite.d.mts +86 -0
  266. package/dist/networking/models/satellite.mjs +121 -0
  267. package/dist/networking/models/spectrum.d.mts +83 -0
  268. package/dist/networking/models/spectrum.mjs +235 -0
  269. package/dist/networking/models/switch.d.mts +80 -0
  270. package/dist/networking/models/switch.mjs +155 -0
  271. package/dist/networking/models/vlan.d.mts +62 -0
  272. package/dist/networking/models/vlan.mjs +100 -0
  273. package/dist/networking/models/vpn.d.mts +66 -0
  274. package/dist/networking/models/vpn.mjs +125 -0
  275. package/dist/networking/models/wifi-privacy.d.mts +82 -0
  276. package/dist/networking/models/wifi-privacy.mjs +130 -0
  277. package/dist/networking/models/wifi.d.mts +240 -0
  278. package/dist/networking/models/wifi.mjs +562 -0
  279. package/dist/networking/nat-traversal.d.mts +24 -0
  280. package/dist/networking/nat-traversal.mjs +38 -0
  281. package/dist/networking/protocols.d.mts +17 -0
  282. package/dist/networking/protocols.mjs +57 -0
  283. package/dist/networking/queue.d.mts +12 -0
  284. package/dist/networking/queue.mjs +18 -0
  285. package/dist/networking/route-learning.d.mts +23 -0
  286. package/dist/networking/route-learning.mjs +43 -0
  287. package/dist/networking/routing.d.mts +11 -0
  288. package/dist/networking/routing.mjs +25 -0
  289. package/dist/networking/signals.d.mts +26 -0
  290. package/dist/networking/signals.mjs +35 -0
  291. package/dist/networking/subnet.d.mts +49 -0
  292. package/dist/networking/subnet.mjs +89 -0
  293. package/dist/networking/tcp-reliability.d.mts +24 -0
  294. package/dist/networking/tcp-reliability.mjs +38 -0
  295. package/dist/networking/topology/contract.d.mts +123 -0
  296. package/dist/networking/topology/index.d.mts +4 -0
  297. package/dist/networking/topology/index.mjs +4 -0
  298. package/dist/networking/topology/presets.d.mts +7 -0
  299. package/dist/networking/topology/presets.mjs +302 -0
  300. package/dist/networking/topology/simulation.d.mts +8 -0
  301. package/dist/networking/topology/simulation.mjs +179 -0
  302. package/dist/networking/wireless.d.mts +11 -0
  303. package/dist/networking/wireless.mjs +17 -0
  304. package/dist/optics/imaging.d.mts +218 -0
  305. package/dist/optics/imaging.mjs +276 -0
  306. package/dist/optics/index.d.mts +7 -0
  307. package/dist/optics/index.mjs +8 -0
  308. package/dist/optics/laws.d.mts +70 -0
  309. package/dist/optics/laws.mjs +195 -0
  310. package/dist/optics/prism.d.mts +148 -0
  311. package/dist/optics/prism.mjs +197 -0
  312. package/dist/optics/refraction.d.mts +201 -0
  313. package/dist/optics/refraction.mjs +270 -0
  314. package/dist/optics/wave-optics.d.mts +171 -0
  315. package/dist/optics/wave-optics.mjs +259 -0
  316. package/dist/physics/ac/index.d.mts +183 -0
  317. package/dist/physics/ac/index.mjs +203 -0
  318. package/dist/physics/dynamics/forces.d.mts +98 -0
  319. package/dist/physics/dynamics/forces.mjs +153 -0
  320. package/dist/physics/dynamics/friction.d.mts +76 -0
  321. package/dist/physics/dynamics/friction.mjs +119 -0
  322. package/dist/physics/dynamics/system.d.mts +68 -0
  323. package/dist/physics/dynamics/system.mjs +125 -0
  324. package/dist/physics/electrostatics/index.d.mts +169 -0
  325. package/dist/physics/electrostatics/index.mjs +249 -0
  326. package/dist/physics/energy/centre-of-mass.d.mts +115 -0
  327. package/dist/physics/energy/centre-of-mass.mjs +180 -0
  328. package/dist/physics/energy/conservation.d.mts +81 -0
  329. package/dist/physics/energy/conservation.mjs +129 -0
  330. package/dist/physics/energy/power.d.mts +90 -0
  331. package/dist/physics/energy/power.mjs +167 -0
  332. package/dist/physics/energy/spring.d.mts +73 -0
  333. package/dist/physics/energy/spring.mjs +129 -0
  334. package/dist/physics/energy/store.d.mts +63 -0
  335. package/dist/physics/energy/store.mjs +108 -0
  336. package/dist/physics/energy/theorem.d.mts +65 -0
  337. package/dist/physics/energy/theorem.mjs +113 -0
  338. package/dist/physics/energy/work.d.mts +114 -0
  339. package/dist/physics/energy/work.mjs +219 -0
  340. package/dist/physics/gravitation/body.d.mts +85 -0
  341. package/dist/physics/gravitation/body.mjs +168 -0
  342. package/dist/physics/gravitation/kepler.d.mts +127 -0
  343. package/dist/physics/gravitation/kepler.mjs +216 -0
  344. package/dist/physics/gravitation/law.d.mts +117 -0
  345. package/dist/physics/gravitation/law.mjs +175 -0
  346. package/dist/physics/gravitation/orbit.d.mts +119 -0
  347. package/dist/physics/gravitation/orbit.mjs +202 -0
  348. package/dist/physics/gravitation/potential.d.mts +114 -0
  349. package/dist/physics/gravitation/potential.mjs +202 -0
  350. package/dist/physics/gravitation/variation.d.mts +97 -0
  351. package/dist/physics/gravitation/variation.mjs +175 -0
  352. package/dist/physics/index.d.mts +35 -0
  353. package/dist/physics/index.mjs +36 -0
  354. package/dist/physics/integral-sweep.d.mts +63 -0
  355. package/dist/physics/integral-sweep.mjs +126 -0
  356. package/dist/physics/kinematics/equations.d.mts +47 -0
  357. package/dist/physics/kinematics/equations.mjs +126 -0
  358. package/dist/physics/kinematics/free-fall.d.mts +53 -0
  359. package/dist/physics/kinematics/free-fall.mjs +71 -0
  360. package/dist/physics/kinematics/given.d.mts +16 -0
  361. package/dist/physics/kinematics/given.mjs +55 -0
  362. package/dist/physics/kinematics/roots.d.mts +41 -0
  363. package/dist/physics/kinematics/roots.mjs +72 -0
  364. package/dist/physics/kinematics/solve.d.mts +52 -0
  365. package/dist/physics/kinematics/solve.mjs +172 -0
  366. package/dist/physics/magnetism/biot-savart.d.mts +161 -0
  367. package/dist/physics/magnetism/biot-savart.mjs +353 -0
  368. package/dist/physics/magnetism/flux.d.mts +94 -0
  369. package/dist/physics/magnetism/flux.mjs +313 -0
  370. package/dist/physics/magnetism/geomagnetism.d.mts +151 -0
  371. package/dist/physics/magnetism/geomagnetism.mjs +184 -0
  372. package/dist/physics/magnetism/index.d.mts +12 -0
  373. package/dist/physics/magnetism/index.mjs +74 -0
  374. package/dist/physics/magnetism/lorentz.d.mts +28 -0
  375. package/dist/physics/magnetism/lorentz.mjs +88 -0
  376. package/dist/physics/magnetism/magnetic-force.d.mts +102 -0
  377. package/dist/physics/magnetism/magnetic-force.mjs +169 -0
  378. package/dist/physics/momentum/collide.d.mts +77 -0
  379. package/dist/physics/momentum/collide.mjs +115 -0
  380. package/dist/physics/momentum/impulse.d.mts +89 -0
  381. package/dist/physics/momentum/impulse.mjs +159 -0
  382. package/dist/physics/momentum/planar.d.mts +60 -0
  383. package/dist/physics/momentum/planar.mjs +110 -0
  384. package/dist/physics/projectile.d.mts +107 -0
  385. package/dist/physics/projectile.mjs +185 -0
  386. package/dist/physics/rotation/angular.d.mts +85 -0
  387. package/dist/physics/rotation/angular.mjs +130 -0
  388. package/dist/physics/rotation/circular.d.mts +79 -0
  389. package/dist/physics/rotation/circular.mjs +131 -0
  390. package/dist/physics/rotation/inertia.d.mts +164 -0
  391. package/dist/physics/rotation/inertia.mjs +332 -0
  392. package/dist/physics/rotation/torque.d.mts +65 -0
  393. package/dist/physics/rotation/torque.mjs +134 -0
  394. package/dist/physics/vectors.d.mts +64 -0
  395. package/dist/physics/vectors.mjs +114 -0
  396. package/dist/primitives/Dot.d.mts +2 -15
  397. package/dist/primitives/Dot.mjs +6 -4
  398. package/dist/primitives/Grid.d.mts +33 -17
  399. package/dist/primitives/Grid.mjs +89 -17
  400. package/dist/primitives/Label.d.mts +1 -14
  401. package/dist/primitives/Label.mjs +3 -2
  402. package/dist/primitives/Lines.d.mts +4 -32
  403. package/dist/primitives/Lines.mjs +10 -8
  404. package/dist/primitives/Shapes.d.mts +5 -43
  405. package/dist/primitives/Shapes.mjs +12 -10
  406. package/dist/primitives/index.d.mts +2 -2
  407. package/dist/primitives/index.mjs +2 -2
  408. package/dist/primitives/props.mjs +31 -0
  409. package/dist/quantity/index.d.mts +119 -0
  410. package/dist/quantity/index.mjs +417 -0
  411. package/dist/relation/derive.d.mts +74 -0
  412. package/dist/relation/derive.mjs +73 -0
  413. package/dist/relation/index.d.mts +56 -0
  414. package/dist/relation/index.mjs +234 -0
  415. package/dist/scene/Scene.d.mts +6 -1
  416. package/dist/scene/Scene.mjs +15 -40
  417. package/dist/scene/evaluators.mjs +1 -1
  418. package/dist/sim/thermal.mjs +45 -20
  419. package/dist/thermo/calorimetry.d.mts +207 -0
  420. package/dist/thermo/calorimetry.mjs +345 -0
  421. package/dist/thermo/cycles.d.mts +142 -0
  422. package/dist/thermo/cycles.mjs +256 -0
  423. package/dist/thermo/entropy.d.mts +87 -0
  424. package/dist/thermo/entropy.mjs +140 -0
  425. package/dist/thermo/expansion.d.mts +130 -0
  426. package/dist/thermo/expansion.mjs +178 -0
  427. package/dist/thermo/gas.d.mts +197 -0
  428. package/dist/thermo/gas.mjs +279 -0
  429. package/dist/thermo/heat-transfer.d.mts +164 -0
  430. package/dist/thermo/heat-transfer.mjs +217 -0
  431. package/dist/thermo/index.d.mts +9 -82
  432. package/dist/thermo/index.mjs +9 -132
  433. package/dist/thermo/processes.d.mts +95 -0
  434. package/dist/thermo/processes.mjs +154 -0
  435. package/dist/thermo/temperature.d.mts +174 -0
  436. package/dist/thermo/temperature.mjs +236 -0
  437. package/dist/view/Stage.mjs +4 -11
  438. package/dist/waves/damping.d.mts +224 -0
  439. package/dist/waves/damping.mjs +317 -0
  440. package/dist/waves/doppler.d.mts +72 -0
  441. package/dist/waves/doppler.mjs +125 -0
  442. package/dist/waves/index.d.mts +10 -0
  443. package/dist/waves/index.mjs +10 -0
  444. package/dist/waves/pendulum.d.mts +130 -0
  445. package/dist/waves/pendulum.mjs +211 -0
  446. package/dist/waves/pitch.d.mts +125 -0
  447. package/dist/waves/pitch.mjs +158 -0
  448. package/dist/waves/shm.d.mts +170 -0
  449. package/dist/waves/shm.mjs +279 -0
  450. package/dist/waves/springs.d.mts +103 -0
  451. package/dist/waves/springs.mjs +176 -0
  452. package/dist/waves/superposition.d.mts +124 -0
  453. package/dist/waves/superposition.mjs +196 -0
  454. package/dist/waves/wave.d.mts +154 -0
  455. package/dist/waves/wave.mjs +178 -0
  456. package/package.json +103 -23
  457. package/styles.css +125 -8
  458. package/dist/assets/kit/index.mjs +0 -4
@@ -0,0 +1,164 @@
1
+ //#region src/thermo/heat-transfer.d.ts
2
+ /**
3
+ * Heat transfer: conduction, convection and radiation, as three rates with
4
+ * three different dependences on temperature.
5
+ *
6
+ * THE MODEL.
7
+ *
8
+ * conduction P = k·A·Δθ / L linear in Δθ
9
+ * convection P = h·A·Δθ linear in Δθ (Newton's law of cooling)
10
+ * radiation P = ε·σ·A·(T⁴ − T_s⁴) FOURTH POWER of absolute temperature
11
+ *
12
+ * The fourth power is the one worth stopping on. Doubling the absolute
13
+ * temperature multiplies conduction by two and radiation by SIXTEEN, which is
14
+ * why a radiator is mostly convection, a fire is mostly radiation, and the only
15
+ * way the Earth loses heat at all is the third row.
16
+ *
17
+ * WHAT MAKES CONDUCTION A NETWORK. Δθ/L over a uniform slab generalises to a
18
+ * THERMAL RESISTANCE R = L/kA, and resistances in series add exactly as
19
+ * electrical ones do, because both are a flow driven by a potential difference
20
+ * against an opposition. `compositeWall` solves a layered wall that way and
21
+ * returns the interface temperatures, which is the part a single overall
22
+ * U-value throws away and the part that tells you where the condensation
23
+ * forms.
24
+ *
25
+ * RADIATION IS NET, NOT ONE-WAY. A body at T in surroundings at T_s emits εσAT⁴
26
+ * and absorbs εσAT_s⁴, and only the difference is a transfer. Modelling
27
+ * emission alone gives a body that cools below its surroundings, which is the
28
+ * second law violated by a missing term.
29
+ *
30
+ * UNITS: SI. Power in watts, area in m², thickness in m, conductivity in
31
+ * W/(m·K), temperatures in KELVIN for radiation (a fourth power of a Celsius
32
+ * reading is meaningless) and in either scale for conduction and convection,
33
+ * where only a difference appears.
34
+ */
35
+ /** Stefan-Boltzmann constant, W/(m²·K⁴), under its physics name. */
36
+ declare const SIGMA = 5.670374419e-8;
37
+ /**
38
+ * Thermal conductivity k, W/(m·K).
39
+ *
40
+ * The span is the lesson: copper conducts about 25,000 times better than still
41
+ * air. That single ratio explains fur, feathers, double glazing, string vests
42
+ * and cavity walls, all of which work by trapping air so it cannot convect, and
43
+ * none of which would work if air were merely a middling conductor.
44
+ */
45
+ declare const THERMAL_CONDUCTIVITY: Record<string, number>;
46
+ /**
47
+ * Rate of conduction through a uniform slab, W: P = k·A·Δθ/L.
48
+ *
49
+ * `deltaT` may be in kelvin or Celsius: only a difference appears, and the two
50
+ * scales have the same degree size.
51
+ */
52
+ declare function conductionRateW(conductivity: number, areaM2: number, deltaT: number, thicknessM: number): number;
53
+ /** Thermal resistance of a slab, K/W: R = L/(k·A). The conduction analogue of ohms. */
54
+ declare function thermalResistanceKPerW(thicknessM: number, conductivity: number, areaM2: number): number;
55
+ /** One layer of a composite wall. */
56
+ interface WallLayer {
57
+ label: string;
58
+ /** Thickness, m. */
59
+ thicknessM: number;
60
+ /** Thermal conductivity, W/(m·K). */
61
+ conductivity: number;
62
+ }
63
+ interface CompositeWallResult {
64
+ /** Heat flow through the whole wall, W. The same through every layer, in the steady state. */
65
+ rateW: number;
66
+ /** Total thermal resistance, K/W. */
67
+ totalResistanceKPerW: number;
68
+ /** Overall heat transfer coefficient (U-value), W/(m²·K). */
69
+ uValue: number;
70
+ /**
71
+ * Temperatures at every boundary, °C, from the hot face to the cold one:
72
+ * one more entry than there are layers.
73
+ */
74
+ boundaryTemperaturesC: number[];
75
+ /** Per-layer share of the total temperature drop. */
76
+ layers: {
77
+ label: string;
78
+ resistanceKPerW: number;
79
+ dropK: number;
80
+ shareOfDrop: number;
81
+ }[];
82
+ }
83
+ /**
84
+ * Steady-state conduction through a layered wall, with the interface
85
+ * temperatures.
86
+ *
87
+ * In the steady state the same power crosses every layer, so the temperature
88
+ * drop across each is in proportion to its resistance. That single sentence is
89
+ * the whole solve, and it is why the interface temperatures come out for free
90
+ * once the total resistance is known.
91
+ *
92
+ * The interface temperatures are the point. A wall's U-value tells you the heat
93
+ * loss; only the profile tells you whether the inside face of the insulation
94
+ * sits below the dew point, which is where a wall grows mould.
95
+ */
96
+ declare function compositeWall(layers: readonly WallLayer[], areaM2: number, hotFaceC: number, coldFaceC: number): CompositeWallResult;
97
+ /**
98
+ * Rate of convective loss, W: P = h·A·Δθ.
99
+ *
100
+ * `h` bundles everything about the fluid, the geometry and whether the flow is
101
+ * natural or forced into one empirical number, which is why it is a
102
+ * coefficient rather than a property: still air over a flat plate is about
103
+ * 5 W/(m²·K), the same air blown across it can be ten times that.
104
+ */
105
+ declare function convectionRateW(coefficient: number, areaM2: number, deltaT: number): number;
106
+ /**
107
+ * NET radiated power, W: P = ε·σ·A·(T⁴ − T_surr⁴).
108
+ *
109
+ * Negative when the surroundings are hotter, which is correct and is the whole
110
+ * reason the surroundings term is not optional: without it a body would radiate
111
+ * itself colder than its own oven.
112
+ *
113
+ * `emissivity` runs 0 to 1 and is the same number for absorbing as for
114
+ * emitting, by Kirchhoff's law. A good emitter is a good absorber, which is why
115
+ * a matt black surface both loses heat fastest and warms fastest in the sun.
116
+ */
117
+ declare function radiatedPowerW(emissivity: number, areaM2: number, temperatureK: number, surroundingsK?: number): number;
118
+ /**
119
+ * Wien's displacement law: the wavelength a black body radiates most strongly
120
+ * at, in metres, λ_max = b/T.
121
+ *
122
+ * Why hot things glow red and hotter things glow white, and how the temperature
123
+ * of a star is read off its colour without going there.
124
+ */
125
+ declare function wienPeakWavelengthM(temperatureK: number): number;
126
+ /**
127
+ * The equilibrium temperature of a body absorbing a radiant flux, K.
128
+ *
129
+ * Solves εσT⁴ = (1 − albedo)·flux·(absorbing area / radiating area). The
130
+ * default ratio of 1/4 is a SPHERE: it intercepts sunlight over its disc πr²
131
+ * but radiates from its whole surface 4πr², and that factor of four is why the
132
+ * Earth's effective temperature is 255 K rather than 279 K.
133
+ */
134
+ declare function radiativeEquilibriumK(fluxWm2: number, albedo?: number, emissivity?: number, areaRatio?: number): number;
135
+ /**
136
+ * Newton's law of cooling, solved: θ(t) = θ_env + (θ₀ − θ_env)·e^(−t/τ).
137
+ *
138
+ * The exponential is what you get when the rate of loss is proportional to the
139
+ * excess temperature, which is true for convection and for small excesses in
140
+ * general. τ is the time to fall to 1/e of the initial excess, and it bundles
141
+ * the mass, the specific heat and the surface into one measurable number.
142
+ *
143
+ * Note the body approaches the environment and never passes it, whichever side
144
+ * it started on: the same equation warms a cold drink and cools a hot one.
145
+ */
146
+ declare function newtonCoolingC(startC: number, environmentC: number, timeConstantS: number, timeS: number): number;
147
+ /**
148
+ * The time to cool from one temperature to another under Newton's law, s.
149
+ *
150
+ * Throws when the target is on the far side of the environment temperature,
151
+ * because that never happens and returning a NaN or a negative time would let
152
+ * it look as though it merely takes a while.
153
+ */
154
+ declare function newtonCoolingTimeS(startC: number, environmentC: number, timeConstantS: number, targetC: number): number;
155
+ /**
156
+ * The time constant of a body cooling by convection, s: τ = m·c / (h·A).
157
+ *
158
+ * Connects the empirical τ above to the physical properties behind it, which is
159
+ * what turns a fitted curve into a prediction: double the mass and the cooling
160
+ * takes twice as long, double the surface and it halves.
161
+ */
162
+ declare function coolingTimeConstantS(massKg: number, specificHeat: number, coefficient: number, areaM2: number): number;
163
+ //#endregion
164
+ export { CompositeWallResult, SIGMA, THERMAL_CONDUCTIVITY, WallLayer, compositeWall, conductionRateW, convectionRateW, coolingTimeConstantS, newtonCoolingC, newtonCoolingTimeS, radiatedPowerW, radiativeEquilibriumK, thermalResistanceKPerW, wienPeakWavelengthM };
@@ -0,0 +1,217 @@
1
+ import { STEFAN_BOLTZMANN, WIEN_DISPLACEMENT } from "../core/constants.mjs";
2
+
3
+ //#region src/thermo/heat-transfer.ts
4
+ /**
5
+ * Heat transfer: conduction, convection and radiation, as three rates with
6
+ * three different dependences on temperature.
7
+ *
8
+ * THE MODEL.
9
+ *
10
+ * conduction P = k·A·Δθ / L linear in Δθ
11
+ * convection P = h·A·Δθ linear in Δθ (Newton's law of cooling)
12
+ * radiation P = ε·σ·A·(T⁴ − T_s⁴) FOURTH POWER of absolute temperature
13
+ *
14
+ * The fourth power is the one worth stopping on. Doubling the absolute
15
+ * temperature multiplies conduction by two and radiation by SIXTEEN, which is
16
+ * why a radiator is mostly convection, a fire is mostly radiation, and the only
17
+ * way the Earth loses heat at all is the third row.
18
+ *
19
+ * WHAT MAKES CONDUCTION A NETWORK. Δθ/L over a uniform slab generalises to a
20
+ * THERMAL RESISTANCE R = L/kA, and resistances in series add exactly as
21
+ * electrical ones do, because both are a flow driven by a potential difference
22
+ * against an opposition. `compositeWall` solves a layered wall that way and
23
+ * returns the interface temperatures, which is the part a single overall
24
+ * U-value throws away and the part that tells you where the condensation
25
+ * forms.
26
+ *
27
+ * RADIATION IS NET, NOT ONE-WAY. A body at T in surroundings at T_s emits εσAT⁴
28
+ * and absorbs εσAT_s⁴, and only the difference is a transfer. Modelling
29
+ * emission alone gives a body that cools below its surroundings, which is the
30
+ * second law violated by a missing term.
31
+ *
32
+ * UNITS: SI. Power in watts, area in m², thickness in m, conductivity in
33
+ * W/(m·K), temperatures in KELVIN for radiation (a fourth power of a Celsius
34
+ * reading is meaningless) and in either scale for conduction and convection,
35
+ * where only a difference appears.
36
+ */
37
+ /** Stefan-Boltzmann constant, W/(m²·K⁴), under its physics name. */
38
+ const SIGMA = STEFAN_BOLTZMANN;
39
+ const finite = (value, what) => {
40
+ if (!Number.isFinite(value)) throw new RangeError(`${what} must be a finite number.`);
41
+ return value;
42
+ };
43
+ const positive = (value, what) => {
44
+ if (!Number.isFinite(value) || value <= 0) throw new RangeError(`${what} must be positive.`);
45
+ return value;
46
+ };
47
+ const kelvin = (value, what = "Temperature") => {
48
+ if (!Number.isFinite(value) || value < 0) throw new RangeError(`${what} must be a non-negative number of kelvin (got ${value}).`);
49
+ return value;
50
+ };
51
+ /**
52
+ * Thermal conductivity k, W/(m·K).
53
+ *
54
+ * The span is the lesson: copper conducts about 25,000 times better than still
55
+ * air. That single ratio explains fur, feathers, double glazing, string vests
56
+ * and cavity walls, all of which work by trapping air so it cannot convect, and
57
+ * none of which would work if air were merely a middling conductor.
58
+ */
59
+ const THERMAL_CONDUCTIVITY = {
60
+ silver: 429,
61
+ copper: 401,
62
+ gold: 314,
63
+ aluminium: 237,
64
+ steel: 50,
65
+ ice: 2.2,
66
+ glass: 1.05,
67
+ concrete: .8,
68
+ brick: .72,
69
+ water: .6,
70
+ wood: .13,
71
+ fibreglass: .04,
72
+ polystyrene: .033,
73
+ air: .026
74
+ };
75
+ /**
76
+ * Rate of conduction through a uniform slab, W: P = k·A·Δθ/L.
77
+ *
78
+ * `deltaT` may be in kelvin or Celsius: only a difference appears, and the two
79
+ * scales have the same degree size.
80
+ */
81
+ function conductionRateW(conductivity, areaM2, deltaT, thicknessM) {
82
+ return positive(conductivity, "Thermal conductivity") * positive(areaM2, "Area") * finite(deltaT, "A temperature difference") / positive(thicknessM, "Thickness");
83
+ }
84
+ /** Thermal resistance of a slab, K/W: R = L/(k·A). The conduction analogue of ohms. */
85
+ function thermalResistanceKPerW(thicknessM, conductivity, areaM2) {
86
+ return positive(thicknessM, "Thickness") / (positive(conductivity, "Thermal conductivity") * positive(areaM2, "Area"));
87
+ }
88
+ /**
89
+ * Steady-state conduction through a layered wall, with the interface
90
+ * temperatures.
91
+ *
92
+ * In the steady state the same power crosses every layer, so the temperature
93
+ * drop across each is in proportion to its resistance. That single sentence is
94
+ * the whole solve, and it is why the interface temperatures come out for free
95
+ * once the total resistance is known.
96
+ *
97
+ * The interface temperatures are the point. A wall's U-value tells you the heat
98
+ * loss; only the profile tells you whether the inside face of the insulation
99
+ * sits below the dew point, which is where a wall grows mould.
100
+ */
101
+ function compositeWall(layers, areaM2, hotFaceC, coldFaceC) {
102
+ if (layers.length === 0) throw new RangeError("A wall needs at least one layer.");
103
+ const A = positive(areaM2, "Area");
104
+ const resistances = layers.map((l) => thermalResistanceKPerW(l.thicknessM, l.conductivity, A));
105
+ const totalResistanceKPerW = resistances.reduce((sum, r) => sum + r, 0);
106
+ const rateW = (finite(hotFaceC, "The hot face temperature") - finite(coldFaceC, "The cold face temperature")) / totalResistanceKPerW;
107
+ const boundaryTemperaturesC = [hotFaceC];
108
+ let running = hotFaceC;
109
+ for (const r of resistances) {
110
+ running -= rateW * r;
111
+ boundaryTemperaturesC.push(running);
112
+ }
113
+ return {
114
+ rateW,
115
+ totalResistanceKPerW,
116
+ uValue: 1 / (totalResistanceKPerW * A),
117
+ boundaryTemperaturesC,
118
+ layers: layers.map((l, i) => ({
119
+ label: l.label,
120
+ resistanceKPerW: resistances[i],
121
+ dropK: rateW * resistances[i],
122
+ shareOfDrop: resistances[i] / totalResistanceKPerW
123
+ }))
124
+ };
125
+ }
126
+ /**
127
+ * Rate of convective loss, W: P = h·A·Δθ.
128
+ *
129
+ * `h` bundles everything about the fluid, the geometry and whether the flow is
130
+ * natural or forced into one empirical number, which is why it is a
131
+ * coefficient rather than a property: still air over a flat plate is about
132
+ * 5 W/(m²·K), the same air blown across it can be ten times that.
133
+ */
134
+ function convectionRateW(coefficient, areaM2, deltaT) {
135
+ return positive(coefficient, "The convection coefficient") * positive(areaM2, "Area") * finite(deltaT, "A temperature difference");
136
+ }
137
+ /**
138
+ * NET radiated power, W: P = ε·σ·A·(T⁴ − T_surr⁴).
139
+ *
140
+ * Negative when the surroundings are hotter, which is correct and is the whole
141
+ * reason the surroundings term is not optional: without it a body would radiate
142
+ * itself colder than its own oven.
143
+ *
144
+ * `emissivity` runs 0 to 1 and is the same number for absorbing as for
145
+ * emitting, by Kirchhoff's law. A good emitter is a good absorber, which is why
146
+ * a matt black surface both loses heat fastest and warms fastest in the sun.
147
+ */
148
+ function radiatedPowerW(emissivity, areaM2, temperatureK, surroundingsK = 0) {
149
+ if (emissivity < 0 || emissivity > 1) throw new RangeError("Emissivity runs from 0 to 1.");
150
+ return emissivity * SIGMA * positive(areaM2, "Area") * (kelvin(temperatureK) ** 4 - kelvin(surroundingsK, "The surroundings temperature") ** 4);
151
+ }
152
+ /**
153
+ * Wien's displacement law: the wavelength a black body radiates most strongly
154
+ * at, in metres, λ_max = b/T.
155
+ *
156
+ * Why hot things glow red and hotter things glow white, and how the temperature
157
+ * of a star is read off its colour without going there.
158
+ */
159
+ function wienPeakWavelengthM(temperatureK) {
160
+ return WIEN_DISPLACEMENT / positive(temperatureK, "Temperature");
161
+ }
162
+ /**
163
+ * The equilibrium temperature of a body absorbing a radiant flux, K.
164
+ *
165
+ * Solves εσT⁴ = (1 − albedo)·flux·(absorbing area / radiating area). The
166
+ * default ratio of 1/4 is a SPHERE: it intercepts sunlight over its disc πr²
167
+ * but radiates from its whole surface 4πr², and that factor of four is why the
168
+ * Earth's effective temperature is 255 K rather than 279 K.
169
+ */
170
+ function radiativeEquilibriumK(fluxWm2, albedo = 0, emissivity = 1, areaRatio = .25) {
171
+ if (albedo < 0 || albedo >= 1) throw new RangeError("Albedo runs from 0 to just under 1.");
172
+ if (emissivity <= 0 || emissivity > 1) throw new RangeError("Emissivity runs from just above 0 to 1.");
173
+ return ((1 - albedo) * positive(fluxWm2, "The incident flux") * areaRatio / (emissivity * SIGMA)) ** .25;
174
+ }
175
+ /**
176
+ * Newton's law of cooling, solved: θ(t) = θ_env + (θ₀ − θ_env)·e^(−t/τ).
177
+ *
178
+ * The exponential is what you get when the rate of loss is proportional to the
179
+ * excess temperature, which is true for convection and for small excesses in
180
+ * general. τ is the time to fall to 1/e of the initial excess, and it bundles
181
+ * the mass, the specific heat and the surface into one measurable number.
182
+ *
183
+ * Note the body approaches the environment and never passes it, whichever side
184
+ * it started on: the same equation warms a cold drink and cools a hot one.
185
+ */
186
+ function newtonCoolingC(startC, environmentC, timeConstantS, timeS) {
187
+ return finite(environmentC, "The environment temperature") + (finite(startC, "The starting temperature") - environmentC) * Math.exp(-Math.max(0, finite(timeS, "A time")) / positive(timeConstantS, "The time constant"));
188
+ }
189
+ /**
190
+ * The time to cool from one temperature to another under Newton's law, s.
191
+ *
192
+ * Throws when the target is on the far side of the environment temperature,
193
+ * because that never happens and returning a NaN or a negative time would let
194
+ * it look as though it merely takes a while.
195
+ */
196
+ function newtonCoolingTimeS(startC, environmentC, timeConstantS, targetC) {
197
+ const excess0 = finite(startC, "The starting temperature") - finite(environmentC, "The environment temperature");
198
+ const excess = finite(targetC, "The target temperature") - environmentC;
199
+ if (excess0 === 0) throw new RangeError("The body already sits at the environment temperature.");
200
+ const ratio = excess / excess0;
201
+ if (ratio <= 0) throw new RangeError("That target is past the environment temperature, which Newton cooling never reaches.");
202
+ if (ratio > 1) throw new RangeError("That target is further from the environment than the start, so the body never reaches it.");
203
+ return -positive(timeConstantS, "The time constant") * Math.log(ratio);
204
+ }
205
+ /**
206
+ * The time constant of a body cooling by convection, s: τ = m·c / (h·A).
207
+ *
208
+ * Connects the empirical τ above to the physical properties behind it, which is
209
+ * what turns a fitted curve into a prediction: double the mass and the cooling
210
+ * takes twice as long, double the surface and it halves.
211
+ */
212
+ function coolingTimeConstantS(massKg, specificHeat, coefficient, areaM2) {
213
+ return positive(massKg, "Mass") * positive(specificHeat, "Specific heat capacity") / (positive(coefficient, "The convection coefficient") * positive(areaM2, "Area"));
214
+ }
215
+
216
+ //#endregion
217
+ export { SIGMA, THERMAL_CONDUCTIVITY, compositeWall, conductionRateW, convectionRateW, coolingTimeConstantS, newtonCoolingC, newtonCoolingTimeS, radiatedPowerW, radiativeEquilibriumK, thermalResistanceKPerW, wienPeakWavelengthM };
@@ -1,82 +1,9 @@
1
- //#region src/thermo/index.d.ts
2
- /**
3
- * `thermo`, ideal-gas thermodynamic processes, as a PURE kernel (like `field`:
4
- * no React, no pixels, no time-stepping). A lab drives it with a slider/progress
5
- * fraction; the kernel returns the full P–V path of a quasi-static process plus the
6
- * first-law bookkeeping along it (work, heat, internal energy, entropy).
7
- *
8
- * Everything is one ideal gas, PV = nRT, with a degrees-of-freedom ratio γ = Cp/Cv
9
- * (monatomic 5/3, diatomic 7/5). The four canonical processes and the Carnot cycle
10
- * all compose from `runProcess`:
11
- *
12
- * isothermal T const PV = const W = nRT·ln(V₂/V₁), Q = W, ΔU = 0
13
- * adiabatic Q = 0 PVᵞ = const W = (P₁V₁−P₂V₂)/(γ−1) = −ΔU, ΔS = 0
14
- * isobaric P const V/T = const W = PΔV, Q = nCpΔT, ΔU = nCvΔT
15
- * isochoric V const P/T = const W = 0, Q = ΔU = nCvΔT
16
- *
17
- * SI units throughout: P in pascals, V in m³, T in kelvin, energy in joules,
18
- * entropy in J/K. (Labs convert to kPa / litres for display.)
19
- */
20
- /** Universal gas constant, J/(mol·K). */
21
- declare const R = 8.314462618;
22
- type ProcessKind = 'isothermal' | 'adiabatic' | 'isobaric' | 'isochoric';
23
- interface GasState {
24
- /** Pressure, Pa. */
25
- P: number;
26
- /** Volume, m³. */
27
- V: number;
28
- /** Temperature, K. */
29
- T: number;
30
- /** Amount, mol. */
31
- n: number;
32
- }
33
- interface ProcessResult {
34
- kind: ProcessKind;
35
- start: GasState;
36
- end: GasState;
37
- /** Sampled states from start→end (for drawing the P–V curve). */
38
- path: GasState[];
39
- /** Work done BY the gas, J ( = ∫P dV, the area under the P–V curve). */
40
- W: number;
41
- /** Heat added TO the gas, J. */
42
- Q: number;
43
- /** Change in internal energy, J ( = nCvΔT). */
44
- dU: number;
45
- /** Change in entropy, J/K. */
46
- dS: number;
47
- }
48
- /**
49
- * Run one quasi-static process from `start` to a target. Give exactly one target
50
- * coordinate that the process can reach (e.g. a target volume for an isothermal or
51
- * adiabatic expansion, a target temperature for isobaric/isochoric heating).
52
- */
53
- declare function runProcess(start: GasState, kind: ProcessKind, target: {
54
- V?: number;
55
- P?: number;
56
- T?: number;
57
- }, gamma?: number, samples?: number): ProcessResult;
58
- interface CarnotResult {
59
- /** The four legs in order: hot isothermal expansion, adiabatic expansion,
60
- * cold isothermal compression, adiabatic compression (back to start). */
61
- legs: ProcessResult[];
62
- Th: number;
63
- Tc: number;
64
- /** Heat absorbed from the hot reservoir, J (>0). */
65
- Qh: number;
66
- /** Heat rejected to the cold reservoir, J (>0). */
67
- Qc: number;
68
- /** Net work done by the engine over the cycle, J ( = Qh − Qc = enclosed P–V area). */
69
- Wnet: number;
70
- /** Thermal efficiency = 1 − Tc/Th = Wnet/Qh. */
71
- efficiency: number;
72
- }
73
- /**
74
- * A Carnot cycle starting at `(V1, Th)`: isothermal expansion V1→V2 at Th, then
75
- * adiabatic expansion to Tc, isothermal compression at Tc, and adiabatic
76
- * compression back to the start. V3/V4 are fixed by the closure condition.
77
- */
78
- declare function carnotCycle(n: number, Th: number, Tc: number, V1: number, V2: number, gamma?: number): CarnotResult;
79
- declare const gammaMonatomic: number;
80
- declare const gammaDiatomic: number;
81
- //#endregion
82
- export { CarnotResult, GasState, ProcessKind, ProcessResult, R, carnotCycle, gammaDiatomic, gammaMonatomic, runProcess };
1
+ import { FixedPointCalibration, ScaleDefinition, TEMPERATURE_SCALES, TemperatureScale, convertTemperature, convertTemperatureInterval, fromKelvin, fundamentalInterval, icePointOn, resistanceAtC, scaleReadingsAgree, steamPointOn, thermocoupleEmf, thermocoupleInversionTemperatureC, thermocoupleNeutralTemperatureC, thermometricTemperatureC, thermometricValue, toKelvin, triplePointTemperatureK } from "./temperature.mjs";
2
+ import { MATERIALS, Material, MixtureBody, MixtureBodyResult, MixtureResult, PhaseName, caloriesToJoules, enthalpyJ, heatToChangeStateJ, heatToWarmJ, joulesToCalories, massMeltedFromDropKg, mixtureEquilibrium, phaseAt, specificHeatFromJ, temperatureRiseFromDropK, temperatureRiseFromSpeedK, temperatureRiseK, waterEquivalentKg } from "./calorimetry.mjs";
3
+ import { GasStateSpec, MolarHeatCapacities, N_A, R, SolvedGasState, combinedGasLaw, gammaDiatomic, gammaFromDegreesOfFreedom, gammaMonatomic, gammaPolyatomic, internalEnergyJ, k_B, kineticPressurePa, maxwellBoltzmannPdf, meanFreePathM, meanSpeedMs, meanSquareSpeed, meanTranslationalEnergyJ, molarHeatCapacities, mostProbableSpeedMs, rmsOf, rmsSpeedMs, solveIdealGas, vanDerWaalsPressurePa } from "./gas.mjs";
4
+ import { GasState, ProcessKind, ProcessResult, firstLawResidualJ, runProcess, workAlongPathJ } from "./processes.mjs";
5
+ import { CarnotResult, CycleDirection, CycleSummary, carnotCycle, carnotEfficiency, cycleSummary, dieselEfficiency, efficiencyFromHeat, heatPumpCOP, ottoCycle, ottoEfficiency, refrigeratorCOP, stateInternalEnergyJ, stirlingCycle } from "./cycles.mjs";
6
+ import { EntropyBalance, MixtureEntropyResult, entropyChangeIsothermalGasJPerK, entropyChangePhaseJPerK, entropyChangeReservoirJPerK, entropyChangeWarmingJPerK, heatTransferEntropy, mixtureEntropyChange } from "./entropy.mjs";
7
+ import { BimetallicBend, LINEAR_EXPANSIVITY, WATER_DENSITY_PEAK_C, areaCoefficient, bimetallicBend, densityAfterExpansionKgM3, expandedAreaM2, expandedLengthM, expandedVolumeM3, lengthChangeM, realExpansivity, thermalStressPa, volumeCoefficient, waterDensityKgM3 } from "./expansion.mjs";
8
+ import { CompositeWallResult, SIGMA, THERMAL_CONDUCTIVITY, WallLayer, compositeWall, conductionRateW, convectionRateW, coolingTimeConstantS, newtonCoolingC, newtonCoolingTimeS, radiatedPowerW, radiativeEquilibriumK, thermalResistanceKPerW, wienPeakWavelengthM } from "./heat-transfer.mjs";
9
+ export { BimetallicBend, CarnotResult, CompositeWallResult, CycleDirection, CycleSummary, EntropyBalance, FixedPointCalibration, GasState, GasStateSpec, LINEAR_EXPANSIVITY, MATERIALS, Material, MixtureBody, MixtureBodyResult, MixtureEntropyResult, MixtureResult, MolarHeatCapacities, N_A, PhaseName, ProcessKind, ProcessResult, R, SIGMA, ScaleDefinition, SolvedGasState, TEMPERATURE_SCALES, THERMAL_CONDUCTIVITY, TemperatureScale, WATER_DENSITY_PEAK_C, WallLayer, areaCoefficient, bimetallicBend, caloriesToJoules, carnotCycle, carnotEfficiency, combinedGasLaw, compositeWall, conductionRateW, convectionRateW, convertTemperature, convertTemperatureInterval, coolingTimeConstantS, cycleSummary, densityAfterExpansionKgM3, dieselEfficiency, efficiencyFromHeat, enthalpyJ, entropyChangeIsothermalGasJPerK, entropyChangePhaseJPerK, entropyChangeReservoirJPerK, entropyChangeWarmingJPerK, expandedAreaM2, expandedLengthM, expandedVolumeM3, firstLawResidualJ, fromKelvin, fundamentalInterval, gammaDiatomic, gammaFromDegreesOfFreedom, gammaMonatomic, gammaPolyatomic, heatPumpCOP, heatToChangeStateJ, heatToWarmJ, heatTransferEntropy, icePointOn, internalEnergyJ, joulesToCalories, k_B, kineticPressurePa, lengthChangeM, massMeltedFromDropKg, maxwellBoltzmannPdf, meanFreePathM, meanSpeedMs, meanSquareSpeed, meanTranslationalEnergyJ, mixtureEntropyChange, mixtureEquilibrium, molarHeatCapacities, mostProbableSpeedMs, newtonCoolingC, newtonCoolingTimeS, ottoCycle, ottoEfficiency, phaseAt, radiatedPowerW, radiativeEquilibriumK, realExpansivity, refrigeratorCOP, resistanceAtC, rmsOf, rmsSpeedMs, runProcess, scaleReadingsAgree, solveIdealGas, specificHeatFromJ, stateInternalEnergyJ, steamPointOn, stirlingCycle, temperatureRiseFromDropK, temperatureRiseFromSpeedK, temperatureRiseK, thermalResistanceKPerW, thermalStressPa, thermocoupleEmf, thermocoupleInversionTemperatureC, thermocoupleNeutralTemperatureC, thermometricTemperatureC, thermometricValue, toKelvin, triplePointTemperatureK, vanDerWaalsPressurePa, volumeCoefficient, waterDensityKgM3, waterEquivalentKg, wienPeakWavelengthM, workAlongPathJ };
@@ -1,133 +1,10 @@
1
- //#region src/thermo/index.ts
2
- /**
3
- * `thermo`, ideal-gas thermodynamic processes, as a PURE kernel (like `field`:
4
- * no React, no pixels, no time-stepping). A lab drives it with a slider/progress
5
- * fraction; the kernel returns the full P–V path of a quasi-static process plus the
6
- * first-law bookkeeping along it (work, heat, internal energy, entropy).
7
- *
8
- * Everything is one ideal gas, PV = nRT, with a degrees-of-freedom ratio γ = Cp/Cv
9
- * (monatomic 5/3, diatomic 7/5). The four canonical processes and the Carnot cycle
10
- * all compose from `runProcess`:
11
- *
12
- * isothermal T const PV = const W = nRT·ln(V₂/V₁), Q = W, ΔU = 0
13
- * adiabatic Q = 0 PVᵞ = const W = (P₁V₁−P₂V₂)/(γ−1) = −ΔU, ΔS = 0
14
- * isobaric P const V/T = const W = PΔV, Q = nCpΔT, ΔU = nCvΔT
15
- * isochoric V const P/T = const W = 0, Q = ΔU = nCvΔT
16
- *
17
- * SI units throughout: P in pascals, V in m³, T in kelvin, energy in joules,
18
- * entropy in J/K. (Labs convert to kPa / litres for display.)
19
- */
20
- /** Universal gas constant, J/(mol·K). */
21
- const R = 8.314462618;
22
- const cv = (gamma) => R / (gamma - 1);
23
- const cp = (gamma) => gamma * R / (gamma - 1);
24
- /** State completed from any two of (P,V,T) via PV = nRT. */
25
- const fromPV = (P, V, n) => ({
26
- P,
27
- V,
28
- n,
29
- T: P * V / (n * R)
30
- });
31
- /**
32
- * Run one quasi-static process from `start` to a target. Give exactly one target
33
- * coordinate that the process can reach (e.g. a target volume for an isothermal or
34
- * adiabatic expansion, a target temperature for isobaric/isochoric heating).
35
- */
36
- function runProcess(start, kind, target, gamma = 5 / 3, samples = 64) {
37
- const { n } = start;
38
- const Cv = cv(gamma), Cp = cp(gamma);
39
- let end;
40
- if (kind === "isothermal") {
41
- const T = start.T;
42
- const V2 = target.V ?? (target.P != null ? n * 8.314462618 * T / target.P : start.V);
43
- end = fromPV(n * R * T / V2, V2, n);
44
- } else if (kind === "adiabatic") {
45
- const K = start.P * start.V ** gamma;
46
- const V2 = target.V ?? (target.T != null ? start.V * (start.T / target.T) ** (1 / (gamma - 1)) : start.V);
47
- end = fromPV(K / V2 ** gamma, V2, n);
48
- } else if (kind === "isobaric") {
49
- const P = start.P;
50
- end = fromPV(P, target.V ?? (target.T != null ? n * 8.314462618 * target.T / P : start.V), n);
51
- } else {
52
- const V = start.V;
53
- end = fromPV(target.P ?? (target.T != null ? n * 8.314462618 * target.T / V : start.P), V, n);
54
- }
55
- const path = [];
56
- for (let i = 0; i <= samples; i++) {
57
- const u = i / samples;
58
- let s;
59
- if (kind === "isochoric") s = fromPV(start.P + (end.P - start.P) * u, start.V, n);
60
- else {
61
- const V = start.V + (end.V - start.V) * u;
62
- if (kind === "isothermal") s = fromPV(n * R * start.T / V, V, n);
63
- else if (kind === "adiabatic") s = fromPV(start.P * start.V ** gamma / V ** gamma, V, n);
64
- else s = fromPV(start.P, V, n);
65
- }
66
- path.push(s);
67
- }
68
- const dU = n * Cv * (end.T - start.T);
69
- let W, Q, dS;
70
- if (kind === "isothermal") {
71
- W = n * R * start.T * Math.log(end.V / start.V);
72
- Q = W;
73
- dS = n * R * Math.log(end.V / start.V);
74
- } else if (kind === "adiabatic") {
75
- W = (start.P * start.V - end.P * end.V) / (gamma - 1);
76
- Q = 0;
77
- dS = 0;
78
- } else if (kind === "isobaric") {
79
- W = start.P * (end.V - start.V);
80
- Q = n * Cp * (end.T - start.T);
81
- dS = n * Cp * Math.log(end.T / start.T);
82
- } else {
83
- W = 0;
84
- Q = dU;
85
- dS = n * Cv * Math.log(end.T / start.T);
86
- }
87
- return {
88
- kind,
89
- start,
90
- end,
91
- path,
92
- W,
93
- Q,
94
- dU,
95
- dS
96
- };
97
- }
98
- /**
99
- * A Carnot cycle starting at `(V1, Th)`: isothermal expansion V1→V2 at Th, then
100
- * adiabatic expansion to Tc, isothermal compression at Tc, and adiabatic
101
- * compression back to the start. V3/V4 are fixed by the closure condition.
102
- */
103
- function carnotCycle(n, Th, Tc, V1, V2, gamma = 5 / 3) {
104
- const ratio = (Th / Tc) ** (1 / (gamma - 1));
105
- const V3 = V2 * ratio;
106
- const V4 = V1 * ratio;
107
- const legHot = runProcess(fromPV(n * R * Th / V1, V1, n), "isothermal", { V: V2 }, gamma);
108
- const legExp = runProcess(legHot.end, "adiabatic", { V: V3 }, gamma);
109
- const legCold = runProcess(legExp.end, "isothermal", { V: V4 }, gamma);
110
- const legComp = runProcess(legCold.end, "adiabatic", { V: V1 }, gamma);
111
- const Qh = legHot.Q;
112
- const Qc = -legCold.Q;
113
- const Wnet = Qh - Qc;
114
- return {
115
- legs: [
116
- legHot,
117
- legExp,
118
- legCold,
119
- legComp
120
- ],
121
- Th,
122
- Tc,
123
- Qh,
124
- Qc,
125
- Wnet,
126
- efficiency: 1 - Tc / Th
127
- };
128
- }
129
- const gammaMonatomic = 5 / 3;
130
- const gammaDiatomic = 7 / 5;
1
+ import { MATERIALS, caloriesToJoules, enthalpyJ, heatToChangeStateJ, heatToWarmJ, joulesToCalories, massMeltedFromDropKg, mixtureEquilibrium, phaseAt, specificHeatFromJ, temperatureRiseFromDropK, temperatureRiseFromSpeedK, temperatureRiseK, waterEquivalentKg } from "./calorimetry.mjs";
2
+ import { TEMPERATURE_SCALES, convertTemperature, convertTemperatureInterval, fromKelvin, fundamentalInterval, icePointOn, resistanceAtC, scaleReadingsAgree, steamPointOn, thermocoupleEmf, thermocoupleInversionTemperatureC, thermocoupleNeutralTemperatureC, thermometricTemperatureC, thermometricValue, toKelvin, triplePointTemperatureK } from "./temperature.mjs";
3
+ import { N_A, R, combinedGasLaw, gammaDiatomic, gammaFromDegreesOfFreedom, gammaMonatomic, gammaPolyatomic, internalEnergyJ, k_B, kineticPressurePa, maxwellBoltzmannPdf, meanFreePathM, meanSpeedMs, meanSquareSpeed, meanTranslationalEnergyJ, molarHeatCapacities, mostProbableSpeedMs, rmsOf, rmsSpeedMs, solveIdealGas, vanDerWaalsPressurePa } from "./gas.mjs";
4
+ import { firstLawResidualJ, runProcess, workAlongPathJ } from "./processes.mjs";
5
+ import { carnotCycle, carnotEfficiency, cycleSummary, dieselEfficiency, efficiencyFromHeat, heatPumpCOP, ottoCycle, ottoEfficiency, refrigeratorCOP, stateInternalEnergyJ, stirlingCycle } from "./cycles.mjs";
6
+ import { entropyChangeIsothermalGasJPerK, entropyChangePhaseJPerK, entropyChangeReservoirJPerK, entropyChangeWarmingJPerK, heatTransferEntropy, mixtureEntropyChange } from "./entropy.mjs";
7
+ import { LINEAR_EXPANSIVITY, WATER_DENSITY_PEAK_C, areaCoefficient, bimetallicBend, densityAfterExpansionKgM3, expandedAreaM2, expandedLengthM, expandedVolumeM3, lengthChangeM, realExpansivity, thermalStressPa, volumeCoefficient, waterDensityKgM3 } from "./expansion.mjs";
8
+ import { SIGMA, THERMAL_CONDUCTIVITY, compositeWall, conductionRateW, convectionRateW, coolingTimeConstantS, newtonCoolingC, newtonCoolingTimeS, radiatedPowerW, radiativeEquilibriumK, thermalResistanceKPerW, wienPeakWavelengthM } from "./heat-transfer.mjs";
131
9
 
132
- //#endregion
133
- export { R, carnotCycle, gammaDiatomic, gammaMonatomic, runProcess };
10
+ export { LINEAR_EXPANSIVITY, MATERIALS, N_A, R, SIGMA, TEMPERATURE_SCALES, THERMAL_CONDUCTIVITY, WATER_DENSITY_PEAK_C, areaCoefficient, bimetallicBend, caloriesToJoules, carnotCycle, carnotEfficiency, combinedGasLaw, compositeWall, conductionRateW, convectionRateW, convertTemperature, convertTemperatureInterval, coolingTimeConstantS, cycleSummary, densityAfterExpansionKgM3, dieselEfficiency, efficiencyFromHeat, enthalpyJ, entropyChangeIsothermalGasJPerK, entropyChangePhaseJPerK, entropyChangeReservoirJPerK, entropyChangeWarmingJPerK, expandedAreaM2, expandedLengthM, expandedVolumeM3, firstLawResidualJ, fromKelvin, fundamentalInterval, gammaDiatomic, gammaFromDegreesOfFreedom, gammaMonatomic, gammaPolyatomic, heatPumpCOP, heatToChangeStateJ, heatToWarmJ, heatTransferEntropy, icePointOn, internalEnergyJ, joulesToCalories, k_B, kineticPressurePa, lengthChangeM, massMeltedFromDropKg, maxwellBoltzmannPdf, meanFreePathM, meanSpeedMs, meanSquareSpeed, meanTranslationalEnergyJ, mixtureEntropyChange, mixtureEquilibrium, molarHeatCapacities, mostProbableSpeedMs, newtonCoolingC, newtonCoolingTimeS, ottoCycle, ottoEfficiency, phaseAt, radiatedPowerW, radiativeEquilibriumK, realExpansivity, refrigeratorCOP, resistanceAtC, rmsOf, rmsSpeedMs, runProcess, scaleReadingsAgree, solveIdealGas, specificHeatFromJ, stateInternalEnergyJ, steamPointOn, stirlingCycle, temperatureRiseFromDropK, temperatureRiseFromSpeedK, temperatureRiseK, thermalResistanceKPerW, thermalStressPa, thermocoupleEmf, thermocoupleInversionTemperatureC, thermocoupleNeutralTemperatureC, thermometricTemperatureC, thermometricValue, toKelvin, triplePointTemperatureK, vanDerWaalsPressurePa, volumeCoefficient, waterDensityKgM3, waterEquivalentKg, wienPeakWavelengthM, workAlongPathJ };