@classytic/stage 0.3.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.
- package/dist/_virtual/_rolldown/runtime.mjs +18 -0
- package/dist/atomic/aufbau.d.mts +144 -0
- package/dist/atomic/aufbau.mjs +384 -0
- package/dist/atomic/elements.d.mts +67 -0
- package/dist/atomic/elements.mjs +785 -0
- package/dist/atomic/emission.d.mts +112 -0
- package/dist/atomic/emission.mjs +179 -0
- package/dist/atomic/index.d.mts +8 -0
- package/dist/atomic/index.mjs +9 -0
- package/dist/atomic/periodic.d.mts +82 -0
- package/dist/atomic/periodic.mjs +231 -0
- package/dist/atomic/properties.d.mts +100 -0
- package/dist/atomic/properties.mjs +574 -0
- package/dist/atomic/shells.d.mts +137 -0
- package/dist/atomic/shells.mjs +170 -0
- package/dist/atomic/trends.d.mts +148 -0
- package/dist/atomic/trends.mjs +225 -0
- package/dist/chem/chromatography.d.mts +66 -0
- package/dist/chem/chromatography.mjs +63 -0
- package/dist/chem/complex.d.mts +114 -0
- package/dist/chem/complex.mjs +234 -0
- package/dist/chem/cycle.d.mts +75 -0
- package/dist/chem/cycle.mjs +145 -0
- package/dist/chem/equation.d.mts +86 -0
- package/dist/chem/equation.mjs +168 -0
- package/dist/chem/formula.d.mts +90 -0
- package/dist/chem/formula.mjs +201 -0
- package/dist/chem/functional-groups.d.mts +31 -0
- package/dist/chem/functional-groups.mjs +187 -0
- package/dist/chem/hazard.d.mts +94 -0
- package/dist/chem/hazard.mjs +329 -0
- package/dist/chem/index.d.mts +34 -33
- package/dist/chem/index.mjs +34 -28
- package/dist/chem/ionic.d.mts +98 -0
- package/dist/chem/ionic.mjs +156 -0
- package/dist/chem/layout.d.mts +46 -0
- package/dist/chem/layout.mjs +342 -0
- package/dist/chem/lewis.d.mts +79 -0
- package/dist/chem/lewis.mjs +163 -0
- package/dist/chem/molecular-orbital.d.mts +114 -0
- package/dist/chem/molecular-orbital.mjs +201 -0
- package/dist/chem/molecule.d.mts +154 -0
- package/dist/chem/molecule.mjs +282 -0
- package/dist/chem/nmr.d.mts +153 -0
- package/dist/chem/nmr.mjs +165 -0
- package/dist/chem/polymer.d.mts +65 -0
- package/dist/chem/polymer.mjs +179 -0
- package/dist/chem/redox.d.mts +138 -0
- package/dist/chem/redox.mjs +328 -0
- package/dist/chem/relations.d.mts +183 -0
- package/dist/chem/relations.mjs +299 -0
- package/dist/chem/skeleton.d.mts +51 -0
- package/dist/chem/skeleton.mjs +186 -0
- package/dist/chem/solution.d.mts +116 -0
- package/dist/chem/solution.mjs +186 -0
- package/dist/chem/species.d.mts +47 -0
- package/dist/chem/species.mjs +128 -0
- package/dist/chem/stereo.d.mts +108 -0
- package/dist/chem/stereo.mjs +286 -0
- package/dist/chem/stoichiometry.d.mts +95 -0
- package/dist/chem/stoichiometry.mjs +145 -0
- package/dist/chem/synthesis.d.mts +113 -0
- package/dist/chem/synthesis.mjs +281 -0
- package/dist/chem/vsepr.d.mts +80 -0
- package/dist/chem/vsepr.mjs +247 -0
- package/dist/circuit/ac.d.mts +163 -0
- package/dist/circuit/ac.mjs +452 -0
- package/dist/circuit/dc.d.mts +92 -0
- package/dist/circuit/dc.mjs +333 -0
- package/dist/circuit/index.d.mts +5 -92
- package/dist/circuit/index.mjs +5 -332
- package/dist/circuit/network.d.mts +99 -0
- package/dist/circuit/network.mjs +440 -0
- package/dist/circuit/topology.d.mts +102 -0
- package/dist/circuit/topology.mjs +143 -0
- package/dist/colour/absorption.d.mts +79 -0
- package/dist/colour/absorption.mjs +137 -0
- package/dist/colour/index.d.mts +6 -0
- package/dist/colour/index.mjs +7 -0
- package/dist/colour/name.d.mts +14 -0
- package/dist/colour/name.mjs +76 -0
- package/dist/colour/observer.d.mts +31 -0
- package/dist/colour/observer.mjs +46 -0
- package/dist/colour/spectrum.d.mts +61 -0
- package/dist/colour/spectrum.mjs +108 -0
- package/dist/colour/srgb.d.mts +49 -0
- package/dist/colour/srgb.mjs +108 -0
- package/dist/core/constants.d.mts +138 -0
- package/dist/core/constants.mjs +139 -0
- package/dist/core/index.d.mts +3 -1
- package/dist/core/index.mjs +3 -1
- package/dist/core/vec3.d.mts +94 -0
- package/dist/core/vec3.mjs +123 -0
- package/dist/core/worked.d.mts +35 -0
- package/dist/core/worked.mjs +44 -0
- package/dist/electro/cell.d.mts +102 -0
- package/dist/electro/cell.mjs +170 -0
- package/dist/electro/conductivity.d.mts +157 -0
- package/dist/electro/conductivity.mjs +156 -0
- package/dist/electro/couples.d.mts +114 -0
- package/dist/electro/couples.mjs +334 -0
- package/dist/electro/electrolysis.d.mts +96 -0
- package/dist/electro/electrolysis.mjs +274 -0
- package/dist/electro/faraday.d.mts +150 -0
- package/dist/electro/faraday.mjs +118 -0
- package/dist/electro/index.d.mts +6 -0
- package/dist/electro/index.mjs +7 -0
- package/dist/finance/accounting/adjustments.d.mts +17 -0
- package/dist/finance/accounting/adjustments.mjs +202 -0
- package/dist/finance/accounting/analysis.d.mts +8 -0
- package/dist/finance/accounting/analysis.mjs +205 -0
- package/dist/finance/accounting/clubs.d.mts +21 -0
- package/dist/finance/accounting/clubs.mjs +217 -0
- package/dist/finance/accounting/company-statements.d.mts +7 -0
- package/dist/finance/accounting/company-statements.mjs +150 -0
- package/dist/finance/accounting/harness.d.mts +7 -0
- package/dist/finance/accounting/harness.mjs +45 -0
- package/dist/finance/accounting/index.d.mts +18 -0
- package/dist/finance/accounting/index.mjs +18 -0
- package/dist/finance/accounting/journalize.d.mts +16 -0
- package/dist/finance/accounting/journalize.mjs +128 -0
- package/dist/finance/accounting/manufacturing.d.mts +8 -0
- package/dist/finance/accounting/manufacturing.mjs +236 -0
- package/dist/finance/accounting/partnership.d.mts +7 -0
- package/dist/finance/accounting/partnership.mjs +152 -0
- package/dist/finance/accounting/period-case.d.mts +6 -0
- package/dist/finance/accounting/period-case.mjs +71 -0
- package/dist/finance/accounting/post.d.mts +9 -0
- package/dist/finance/accounting/post.mjs +84 -0
- package/dist/finance/accounting/precision.d.mts +9 -0
- package/dist/finance/accounting/precision.mjs +15 -0
- package/dist/finance/accounting/rules.d.mts +21 -0
- package/dist/finance/accounting/rules.mjs +37 -0
- package/dist/finance/accounting/solve.d.mts +28 -0
- package/dist/finance/accounting/solve.mjs +92 -0
- package/dist/finance/accounting/statements.d.mts +7 -0
- package/dist/finance/accounting/statements.mjs +142 -0
- package/dist/finance/accounting/types.d.mts +649 -0
- package/dist/finance/accounting/validate.d.mts +7 -0
- package/dist/finance/accounting/validate.mjs +67 -0
- package/dist/finance/accounting/verification.d.mts +24 -0
- package/dist/finance/accounting/verification.mjs +386 -0
- package/dist/finance/bizsim.d.mts +21 -39
- package/dist/finance/bizsim.mjs +276 -97
- package/dist/finance/index.d.mts +20 -43
- package/dist/finance/index.mjs +19 -77
- package/dist/finance/investment-math.d.mts +7 -0
- package/dist/finance/investment-math.mjs +18 -0
- package/dist/finance/management-accounting/budgeting.d.mts +7 -0
- package/dist/finance/management-accounting/budgeting.mjs +189 -0
- package/dist/finance/management-accounting/cash-budget.d.mts +7 -0
- package/dist/finance/management-accounting/cash-budget.mjs +154 -0
- package/dist/finance/management-accounting/costing.d.mts +8 -0
- package/dist/finance/management-accounting/costing.mjs +175 -0
- package/dist/finance/management-accounting/decisions.d.mts +8 -0
- package/dist/finance/management-accounting/decisions.mjs +164 -0
- package/dist/finance/management-accounting/index.d.mts +13 -0
- package/dist/finance/management-accounting/index.mjs +13 -0
- package/dist/finance/management-accounting/integrated-budget.d.mts +8 -0
- package/dist/finance/management-accounting/integrated-budget.mjs +67 -0
- package/dist/finance/management-accounting/inventory-costing.d.mts +7 -0
- package/dist/finance/management-accounting/inventory-costing.mjs +173 -0
- package/dist/finance/management-accounting/investment-appraisal.d.mts +7 -0
- package/dist/finance/management-accounting/investment-appraisal.mjs +148 -0
- package/dist/finance/management-accounting/management-case.d.mts +8 -0
- package/dist/finance/management-accounting/management-case.mjs +91 -0
- package/dist/finance/management-accounting/master-budget.d.mts +7 -0
- package/dist/finance/management-accounting/master-budget.mjs +137 -0
- package/dist/finance/management-accounting/production-costing.d.mts +8 -0
- package/dist/finance/management-accounting/production-costing.mjs +214 -0
- package/dist/finance/management-accounting/types.d.mts +644 -0
- package/dist/finance/management-accounting/variances.d.mts +7 -0
- package/dist/finance/management-accounting/variances.mjs +150 -0
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +1 -1
- package/dist/math/analysis.d.mts +61 -0
- package/dist/math/analysis.mjs +187 -0
- package/dist/math/answer-check.d.mts +50 -0
- package/dist/math/answer-check.mjs +106 -0
- package/dist/math/calculus.d.mts +4 -9
- package/dist/math/calculus.mjs +216 -7
- package/dist/math/complex.d.mts +93 -0
- package/dist/math/complex.mjs +239 -0
- package/dist/math/expr.d.mts +23 -0
- package/dist/math/expr.mjs +36 -0
- package/dist/math/index.d.mts +8 -22
- package/dist/math/index.mjs +8 -37
- package/dist/math/latex.mjs +2 -1
- package/dist/math/parse.mjs +1 -1
- package/dist/math/poly.d.mts +55 -0
- package/dist/math/poly.mjs +273 -0
- package/dist/math/rearrange.d.mts +14 -0
- package/dist/math/rearrange.mjs +125 -0
- package/dist/math/solve.d.mts +21 -0
- package/dist/math/solve.mjs +75 -0
- package/dist/networking/addressing.d.mts +26 -0
- package/dist/networking/addressing.mjs +33 -0
- package/dist/networking/cloud/access.d.mts +36 -0
- package/dist/networking/cloud/access.mjs +95 -0
- package/dist/networking/cloud/containers.d.mts +43 -0
- package/dist/networking/cloud/containers.mjs +54 -0
- package/dist/networking/cloud/edge.d.mts +17 -0
- package/dist/networking/cloud/edge.mjs +31 -0
- package/dist/networking/cloud/failure-domains.d.mts +19 -0
- package/dist/networking/cloud/failure-domains.mjs +22 -0
- package/dist/networking/cloud/geo-routing.d.mts +22 -0
- package/dist/networking/cloud/geo-routing.mjs +64 -0
- package/dist/networking/cloud/index.d.mts +18 -0
- package/dist/networking/cloud/index.mjs +19 -0
- package/dist/networking/cloud/inference-reliability.d.mts +30 -0
- package/dist/networking/cloud/inference-reliability.mjs +76 -0
- package/dist/networking/cloud/inference.d.mts +118 -0
- package/dist/networking/cloud/inference.mjs +179 -0
- package/dist/networking/cloud/infrastructure.d.mts +45 -0
- package/dist/networking/cloud/infrastructure.mjs +96 -0
- package/dist/networking/cloud/observability.d.mts +24 -0
- package/dist/networking/cloud/observability.mjs +34 -0
- package/dist/networking/cloud/orchestration.d.mts +32 -0
- package/dist/networking/cloud/orchestration.mjs +38 -0
- package/dist/networking/cloud/recovery.d.mts +21 -0
- package/dist/networking/cloud/recovery.mjs +27 -0
- package/dist/networking/cloud/releases.d.mts +42 -0
- package/dist/networking/cloud/releases.mjs +135 -0
- package/dist/networking/cloud/scaling.d.mts +25 -0
- package/dist/networking/cloud/scaling.mjs +65 -0
- package/dist/networking/cloud/secrets.d.mts +39 -0
- package/dist/networking/cloud/secrets.mjs +68 -0
- package/dist/networking/cloud/server-deployment.d.mts +29 -0
- package/dist/networking/cloud/server-deployment.mjs +72 -0
- package/dist/networking/cloud/storage.d.mts +16 -0
- package/dist/networking/cloud/storage.mjs +58 -0
- package/dist/networking/cloud/vpc.d.mts +18 -0
- package/dist/networking/cloud/vpc.mjs +100 -0
- package/dist/networking/delivery.d.mts +34 -0
- package/dist/networking/delivery.mjs +52 -0
- package/dist/networking/index.d.mts +47 -0
- package/dist/networking/index.mjs +47 -0
- package/dist/networking/ipv6.d.mts +28 -0
- package/dist/networking/ipv6.mjs +17 -0
- package/dist/networking/journeys.d.mts +83 -0
- package/dist/networking/journeys.mjs +161 -0
- package/dist/networking/models/airtime.d.mts +87 -0
- package/dist/networking/models/airtime.mjs +130 -0
- package/dist/networking/models/cellular.d.mts +157 -0
- package/dist/networking/models/cellular.mjs +252 -0
- package/dist/networking/models/encapsulation.d.mts +98 -0
- package/dist/networking/models/encapsulation.mjs +132 -0
- package/dist/networking/models/handover.d.mts +116 -0
- package/dist/networking/models/handover.mjs +209 -0
- package/dist/networking/models/handshake.d.mts +90 -0
- package/dist/networking/models/handshake.mjs +122 -0
- package/dist/networking/models/index.d.mts +14 -0
- package/dist/networking/models/index.mjs +15 -0
- package/dist/networking/models/media.d.mts +82 -0
- package/dist/networking/models/media.mjs +188 -0
- package/dist/networking/models/satellite.d.mts +86 -0
- package/dist/networking/models/satellite.mjs +121 -0
- package/dist/networking/models/spectrum.d.mts +83 -0
- package/dist/networking/models/spectrum.mjs +235 -0
- package/dist/networking/models/switch.d.mts +80 -0
- package/dist/networking/models/switch.mjs +155 -0
- package/dist/networking/models/vlan.d.mts +62 -0
- package/dist/networking/models/vlan.mjs +100 -0
- package/dist/networking/models/vpn.d.mts +66 -0
- package/dist/networking/models/vpn.mjs +125 -0
- package/dist/networking/models/wifi-privacy.d.mts +82 -0
- package/dist/networking/models/wifi-privacy.mjs +130 -0
- package/dist/networking/models/wifi.d.mts +240 -0
- package/dist/networking/models/wifi.mjs +562 -0
- package/dist/networking/nat-traversal.d.mts +24 -0
- package/dist/networking/nat-traversal.mjs +38 -0
- package/dist/networking/protocols.d.mts +17 -0
- package/dist/networking/protocols.mjs +57 -0
- package/dist/networking/queue.d.mts +12 -0
- package/dist/networking/queue.mjs +18 -0
- package/dist/networking/route-learning.d.mts +23 -0
- package/dist/networking/route-learning.mjs +43 -0
- package/dist/networking/routing.d.mts +11 -0
- package/dist/networking/routing.mjs +25 -0
- package/dist/networking/signals.d.mts +26 -0
- package/dist/networking/signals.mjs +35 -0
- package/dist/networking/subnet.d.mts +49 -0
- package/dist/networking/subnet.mjs +89 -0
- package/dist/networking/tcp-reliability.d.mts +24 -0
- package/dist/networking/tcp-reliability.mjs +38 -0
- package/dist/networking/topology/contract.d.mts +123 -0
- package/dist/networking/topology/index.d.mts +4 -0
- package/dist/networking/topology/index.mjs +4 -0
- package/dist/networking/topology/presets.d.mts +7 -0
- package/dist/networking/topology/presets.mjs +302 -0
- package/dist/networking/topology/simulation.d.mts +8 -0
- package/dist/networking/topology/simulation.mjs +179 -0
- package/dist/networking/wireless.d.mts +11 -0
- package/dist/networking/wireless.mjs +17 -0
- package/dist/optics/imaging.d.mts +218 -0
- package/dist/optics/imaging.mjs +276 -0
- package/dist/optics/index.d.mts +7 -0
- package/dist/optics/index.mjs +8 -0
- package/dist/optics/laws.d.mts +70 -0
- package/dist/optics/laws.mjs +195 -0
- package/dist/optics/prism.d.mts +148 -0
- package/dist/optics/prism.mjs +197 -0
- package/dist/optics/refraction.d.mts +201 -0
- package/dist/optics/refraction.mjs +270 -0
- package/dist/optics/wave-optics.d.mts +171 -0
- package/dist/optics/wave-optics.mjs +259 -0
- package/dist/physics/ac/index.d.mts +183 -0
- package/dist/physics/ac/index.mjs +203 -0
- package/dist/physics/dynamics/forces.d.mts +98 -0
- package/dist/physics/dynamics/forces.mjs +153 -0
- package/dist/physics/dynamics/friction.d.mts +76 -0
- package/dist/physics/dynamics/friction.mjs +119 -0
- package/dist/physics/dynamics/system.d.mts +68 -0
- package/dist/physics/dynamics/system.mjs +125 -0
- package/dist/physics/electrostatics/index.d.mts +169 -0
- package/dist/physics/electrostatics/index.mjs +249 -0
- package/dist/physics/energy/centre-of-mass.d.mts +115 -0
- package/dist/physics/energy/centre-of-mass.mjs +180 -0
- package/dist/physics/energy/conservation.d.mts +81 -0
- package/dist/physics/energy/conservation.mjs +129 -0
- package/dist/physics/energy/power.d.mts +90 -0
- package/dist/physics/energy/power.mjs +167 -0
- package/dist/physics/energy/spring.d.mts +73 -0
- package/dist/physics/energy/spring.mjs +129 -0
- package/dist/physics/energy/store.d.mts +63 -0
- package/dist/physics/energy/store.mjs +108 -0
- package/dist/physics/energy/theorem.d.mts +65 -0
- package/dist/physics/energy/theorem.mjs +113 -0
- package/dist/physics/energy/work.d.mts +114 -0
- package/dist/physics/energy/work.mjs +219 -0
- package/dist/physics/gravitation/body.d.mts +85 -0
- package/dist/physics/gravitation/body.mjs +168 -0
- package/dist/physics/gravitation/kepler.d.mts +127 -0
- package/dist/physics/gravitation/kepler.mjs +216 -0
- package/dist/physics/gravitation/law.d.mts +117 -0
- package/dist/physics/gravitation/law.mjs +175 -0
- package/dist/physics/gravitation/orbit.d.mts +119 -0
- package/dist/physics/gravitation/orbit.mjs +202 -0
- package/dist/physics/gravitation/potential.d.mts +114 -0
- package/dist/physics/gravitation/potential.mjs +202 -0
- package/dist/physics/gravitation/variation.d.mts +97 -0
- package/dist/physics/gravitation/variation.mjs +175 -0
- package/dist/physics/index.d.mts +35 -0
- package/dist/physics/index.mjs +36 -0
- package/dist/physics/integral-sweep.d.mts +63 -0
- package/dist/physics/integral-sweep.mjs +126 -0
- package/dist/physics/kinematics/equations.d.mts +47 -0
- package/dist/physics/kinematics/equations.mjs +126 -0
- package/dist/physics/kinematics/free-fall.d.mts +53 -0
- package/dist/physics/kinematics/free-fall.mjs +71 -0
- package/dist/physics/kinematics/given.d.mts +16 -0
- package/dist/physics/kinematics/given.mjs +55 -0
- package/dist/physics/kinematics/roots.d.mts +41 -0
- package/dist/physics/kinematics/roots.mjs +72 -0
- package/dist/physics/kinematics/solve.d.mts +52 -0
- package/dist/physics/kinematics/solve.mjs +172 -0
- package/dist/physics/magnetism/biot-savart.d.mts +161 -0
- package/dist/physics/magnetism/biot-savart.mjs +353 -0
- package/dist/physics/magnetism/flux.d.mts +94 -0
- package/dist/physics/magnetism/flux.mjs +313 -0
- package/dist/physics/magnetism/geomagnetism.d.mts +151 -0
- package/dist/physics/magnetism/geomagnetism.mjs +184 -0
- package/dist/physics/magnetism/index.d.mts +12 -0
- package/dist/physics/magnetism/index.mjs +74 -0
- package/dist/physics/magnetism/lorentz.d.mts +28 -0
- package/dist/physics/magnetism/lorentz.mjs +88 -0
- package/dist/physics/magnetism/magnetic-force.d.mts +102 -0
- package/dist/physics/magnetism/magnetic-force.mjs +169 -0
- package/dist/physics/momentum/collide.d.mts +77 -0
- package/dist/physics/momentum/collide.mjs +115 -0
- package/dist/physics/momentum/impulse.d.mts +89 -0
- package/dist/physics/momentum/impulse.mjs +159 -0
- package/dist/physics/momentum/planar.d.mts +60 -0
- package/dist/physics/momentum/planar.mjs +110 -0
- package/dist/physics/projectile.d.mts +107 -0
- package/dist/physics/projectile.mjs +185 -0
- package/dist/physics/rotation/angular.d.mts +85 -0
- package/dist/physics/rotation/angular.mjs +130 -0
- package/dist/physics/rotation/circular.d.mts +79 -0
- package/dist/physics/rotation/circular.mjs +131 -0
- package/dist/physics/rotation/inertia.d.mts +164 -0
- package/dist/physics/rotation/inertia.mjs +332 -0
- package/dist/physics/rotation/torque.d.mts +65 -0
- package/dist/physics/rotation/torque.mjs +134 -0
- package/dist/physics/vectors.d.mts +64 -0
- package/dist/physics/vectors.mjs +114 -0
- package/dist/quantity/index.d.mts +119 -0
- package/dist/quantity/index.mjs +417 -0
- package/dist/relation/derive.d.mts +74 -0
- package/dist/relation/derive.mjs +73 -0
- package/dist/relation/index.d.mts +56 -0
- package/dist/relation/index.mjs +234 -0
- package/dist/scene/evaluators.mjs +1 -1
- package/dist/sim/thermal.mjs +45 -20
- package/dist/thermo/calorimetry.d.mts +207 -0
- package/dist/thermo/calorimetry.mjs +345 -0
- package/dist/thermo/cycles.d.mts +142 -0
- package/dist/thermo/cycles.mjs +256 -0
- package/dist/thermo/entropy.d.mts +87 -0
- package/dist/thermo/entropy.mjs +140 -0
- package/dist/thermo/expansion.d.mts +130 -0
- package/dist/thermo/expansion.mjs +178 -0
- package/dist/thermo/gas.d.mts +197 -0
- package/dist/thermo/gas.mjs +279 -0
- package/dist/thermo/heat-transfer.d.mts +164 -0
- package/dist/thermo/heat-transfer.mjs +217 -0
- package/dist/thermo/index.d.mts +9 -82
- package/dist/thermo/index.mjs +9 -132
- package/dist/thermo/processes.d.mts +95 -0
- package/dist/thermo/processes.mjs +154 -0
- package/dist/thermo/temperature.d.mts +174 -0
- package/dist/thermo/temperature.mjs +236 -0
- package/dist/waves/damping.d.mts +224 -0
- package/dist/waves/damping.mjs +317 -0
- package/dist/waves/doppler.d.mts +72 -0
- package/dist/waves/doppler.mjs +125 -0
- package/dist/waves/index.d.mts +10 -0
- package/dist/waves/index.mjs +10 -0
- package/dist/waves/pendulum.d.mts +130 -0
- package/dist/waves/pendulum.mjs +211 -0
- package/dist/waves/pitch.d.mts +125 -0
- package/dist/waves/pitch.mjs +158 -0
- package/dist/waves/shm.d.mts +170 -0
- package/dist/waves/shm.mjs +279 -0
- package/dist/waves/springs.d.mts +103 -0
- package/dist/waves/springs.mjs +176 -0
- package/dist/waves/superposition.d.mts +124 -0
- package/dist/waves/superposition.mjs +196 -0
- package/dist/waves/wave.d.mts +154 -0
- package/dist/waves/wave.mjs +178 -0
- package/package.json +74 -2
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
//#region src/electro/couples.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Standard electrode potentials: the measured half of electrochemistry.
|
|
4
|
+
*
|
|
5
|
+
* ## One convention, stated once, and never a second table
|
|
6
|
+
*
|
|
7
|
+
* Every value here is a standard REDUCTION potential, written for the half-reaction running as
|
|
8
|
+
*
|
|
9
|
+
* Ox + n e⁻ → Red E° in volts, against the standard hydrogen electrode at 298.15 K
|
|
10
|
+
*
|
|
11
|
+
* That is the IUPAC convention and it is the only one stored. Oxidation potentials are the same
|
|
12
|
+
* numbers with the sign flipped, so {@link oxidationPotential} computes them rather than a second
|
|
13
|
+
* table repeating them. That matters more than it sounds: a table of oxidation potentials beside a
|
|
14
|
+
* table of reduction potentials is the single commonest source of sign errors in this topic, and
|
|
15
|
+
* two tables can disagree while one cannot.
|
|
16
|
+
*
|
|
17
|
+
* Textbooks write the same cell either way. "E°cell = E°anode(ox) + E°cathode(red)" and
|
|
18
|
+
* "E°cell = E°cathode(red) − E°anode(red)" are the same statement, because E°ox = −E°red. Both
|
|
19
|
+
* routes are reachable from what is here, and neither needs its own data.
|
|
20
|
+
*
|
|
21
|
+
* ## Why a couple is not a metal
|
|
22
|
+
*
|
|
23
|
+
* The obvious shape for this data is a list of metals, and it is wrong. Iron has two couples in
|
|
24
|
+
* ordinary use, Fe²⁺/Fe at −0.44 V and Fe³⁺/Fe²⁺ at +0.77 V, and they sit at opposite ends of the
|
|
25
|
+
* series: one of the most readily oxidised metals and a respectable oxidising agent. The same is
|
|
26
|
+
* true of copper, tin and manganese. Keying on the element would make those unreachable or, worse,
|
|
27
|
+
* silently pick one.
|
|
28
|
+
*
|
|
29
|
+
* So the record is the COUPLE, and a half-reaction it can write out.
|
|
30
|
+
*
|
|
31
|
+
* ## Provenance
|
|
32
|
+
*
|
|
33
|
+
* Aqueous standard reduction potentials at 298.15 K, unit activity, from the CRC Handbook's
|
|
34
|
+
* electrochemical series. Values are quoted to the two decimals that data booklets use, because
|
|
35
|
+
* that is the precision a learner is asked to work to and quoting more would imply an agreement
|
|
36
|
+
* between sources that does not exist at the third decimal.
|
|
37
|
+
*
|
|
38
|
+
* Pure: no React, no pixels.
|
|
39
|
+
*/
|
|
40
|
+
/** Which electrode a half-cell ends up as in a given cell. */
|
|
41
|
+
type Role = 'cathode' | 'anode';
|
|
42
|
+
interface Couple {
|
|
43
|
+
/** Stable key, e.g. `Zn2+/Zn`. */
|
|
44
|
+
readonly id: string;
|
|
45
|
+
/**
|
|
46
|
+
* The BALANCED reduction half-equation, written out.
|
|
47
|
+
*
|
|
48
|
+
* Stored rather than assembled, because assembling it needs stoichiometry this record does not
|
|
49
|
+
* carry. A template of `oxidised + ne⁻ → reduced` is right only for a metal and its own ion, and
|
|
50
|
+
* it was quietly wrong for most of this table: it produced `Cl₂ + 2e⁻ → Cl⁻`, missing the 2 on
|
|
51
|
+
* the chloride, and `OH⁻ → O₂ + 4e⁻` with no water in it at all. Both look like half-equations
|
|
52
|
+
* and neither balances.
|
|
53
|
+
*
|
|
54
|
+
* A rendered lab caught it, because a wrong equation printed under a beaker is still a
|
|
55
|
+
* perfectly plausible-looking string.
|
|
56
|
+
*/
|
|
57
|
+
readonly halfEquation: string;
|
|
58
|
+
/** The oxidised form, as written in the half-equation. */
|
|
59
|
+
readonly oxidised: string;
|
|
60
|
+
/** The reduced form. */
|
|
61
|
+
readonly reduced: string;
|
|
62
|
+
/** Electrons transferred in the half-reaction as written. */
|
|
63
|
+
readonly electrons: number;
|
|
64
|
+
/** Standard REDUCTION potential, volts against the standard hydrogen electrode. */
|
|
65
|
+
readonly standardPotential: number;
|
|
66
|
+
/**
|
|
67
|
+
* Species whose concentration enters the reaction quotient, with the power it is raised to.
|
|
68
|
+
*
|
|
69
|
+
* Positive powers for the oxidised side, negative for the reduced side, and solids and the
|
|
70
|
+
* solvent omitted entirely. A solid has unit activity, so including copper metal in Q as though
|
|
71
|
+
* it had a concentration is exactly the error that makes a learner's Nernst answer drift.
|
|
72
|
+
*/
|
|
73
|
+
readonly quotient: Readonly<Record<string, number>>;
|
|
74
|
+
/** True where the electrode is inert and only carries electrons (platinum, graphite). */
|
|
75
|
+
readonly inertElectrode?: boolean;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The electrochemical series, most negative first.
|
|
79
|
+
*
|
|
80
|
+
* Ordering is by potential rather than by insertion, so "more readily oxidised" is a position in
|
|
81
|
+
* this array and never a separate claim that could drift out of step with the numbers.
|
|
82
|
+
*/
|
|
83
|
+
declare const COUPLES: readonly Couple[];
|
|
84
|
+
/** A couple by id, case-insensitively. Undefined rather than a guess when it is not in the series. */
|
|
85
|
+
declare const coupleById: (id: string) => Couple | undefined;
|
|
86
|
+
/**
|
|
87
|
+
* The standard OXIDATION potential, which is the reduction potential with its sign reversed.
|
|
88
|
+
*
|
|
89
|
+
* Computed rather than stored. See the note at the top of this file on why a second table would be
|
|
90
|
+
* a liability rather than a convenience.
|
|
91
|
+
*/
|
|
92
|
+
declare const oxidationPotential: (couple: Couple) => number;
|
|
93
|
+
/** The balanced half-equation as written for reduction, e.g. `Cu²⁺ + 2e⁻ → Cu`. */
|
|
94
|
+
declare const reductionEquation: (couple: Couple) => string;
|
|
95
|
+
/**
|
|
96
|
+
* The same half-reaction run backwards, which is what happens at an anode.
|
|
97
|
+
*
|
|
98
|
+
* Derived from the reduction equation by swapping the sides and carrying the electrons across,
|
|
99
|
+
* rather than stored a second time. Two strings for one reaction could disagree; this cannot, and
|
|
100
|
+
* it keeps whatever stoichiometry and spectator water the reduction form already got right.
|
|
101
|
+
*/
|
|
102
|
+
declare function oxidationEquation(couple: Couple): string;
|
|
103
|
+
/**
|
|
104
|
+
* Is the reduced form of `a` able to reduce the oxidised form of `b`?
|
|
105
|
+
*
|
|
106
|
+
* The whole predictive content of the series in one comparison: a couple lower in the table has
|
|
107
|
+
* the stronger reducing agent on its reduced side, so zinc metal reduces copper(II) and copper
|
|
108
|
+
* metal does not reduce zinc(II).
|
|
109
|
+
*/
|
|
110
|
+
declare const canReduce: (a: Couple, b: Couple) => boolean;
|
|
111
|
+
/** The stronger oxidising agent of two oxidised forms, which is the one higher in the series. */
|
|
112
|
+
declare const strongerOxidant: (a: Couple, b: Couple) => Couple;
|
|
113
|
+
//#endregion
|
|
114
|
+
export { COUPLES, Couple, Role, canReduce, coupleById, oxidationEquation, oxidationPotential, reductionEquation, strongerOxidant };
|
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
//#region src/electro/couples.ts
|
|
2
|
+
/**
|
|
3
|
+
* The electrochemical series, most negative first.
|
|
4
|
+
*
|
|
5
|
+
* Ordering is by potential rather than by insertion, so "more readily oxidised" is a position in
|
|
6
|
+
* this array and never a separate claim that could drift out of step with the numbers.
|
|
7
|
+
*/
|
|
8
|
+
const COUPLES = [
|
|
9
|
+
{
|
|
10
|
+
id: "Li+/Li",
|
|
11
|
+
halfEquation: "Li⁺ + e⁻ → Li",
|
|
12
|
+
oxidised: "Li⁺",
|
|
13
|
+
reduced: "Li",
|
|
14
|
+
electrons: 1,
|
|
15
|
+
standardPotential: -3.04,
|
|
16
|
+
quotient: { "Li+": 1 }
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
id: "K+/K",
|
|
20
|
+
halfEquation: "K⁺ + e⁻ → K",
|
|
21
|
+
oxidised: "K⁺",
|
|
22
|
+
reduced: "K",
|
|
23
|
+
electrons: 1,
|
|
24
|
+
standardPotential: -2.93,
|
|
25
|
+
quotient: { "K+": 1 }
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: "Ca2+/Ca",
|
|
29
|
+
halfEquation: "Ca²⁺ + 2e⁻ → Ca",
|
|
30
|
+
oxidised: "Ca²⁺",
|
|
31
|
+
reduced: "Ca",
|
|
32
|
+
electrons: 2,
|
|
33
|
+
standardPotential: -2.87,
|
|
34
|
+
quotient: { "Ca2+": 1 }
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
id: "Na+/Na",
|
|
38
|
+
halfEquation: "Na⁺ + e⁻ → Na",
|
|
39
|
+
oxidised: "Na⁺",
|
|
40
|
+
reduced: "Na",
|
|
41
|
+
electrons: 1,
|
|
42
|
+
standardPotential: -2.71,
|
|
43
|
+
quotient: { "Na+": 1 }
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
id: "Mg2+/Mg",
|
|
47
|
+
halfEquation: "Mg²⁺ + 2e⁻ → Mg",
|
|
48
|
+
oxidised: "Mg²⁺",
|
|
49
|
+
reduced: "Mg",
|
|
50
|
+
electrons: 2,
|
|
51
|
+
standardPotential: -2.37,
|
|
52
|
+
quotient: { "Mg2+": 1 }
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: "Al3+/Al",
|
|
56
|
+
halfEquation: "Al³⁺ + 3e⁻ → Al",
|
|
57
|
+
oxidised: "Al³⁺",
|
|
58
|
+
reduced: "Al",
|
|
59
|
+
electrons: 3,
|
|
60
|
+
standardPotential: -1.66,
|
|
61
|
+
quotient: { "Al3+": 1 }
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
id: "Mn2+/Mn",
|
|
65
|
+
halfEquation: "Mn²⁺ + 2e⁻ → Mn",
|
|
66
|
+
oxidised: "Mn²⁺",
|
|
67
|
+
reduced: "Mn",
|
|
68
|
+
electrons: 2,
|
|
69
|
+
standardPotential: -1.18,
|
|
70
|
+
quotient: { "Mn2+": 1 }
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: "Zn2+/Zn",
|
|
74
|
+
halfEquation: "Zn²⁺ + 2e⁻ → Zn",
|
|
75
|
+
oxidised: "Zn²⁺",
|
|
76
|
+
reduced: "Zn",
|
|
77
|
+
electrons: 2,
|
|
78
|
+
standardPotential: -.76,
|
|
79
|
+
quotient: { "Zn2+": 1 }
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: "Cr3+/Cr",
|
|
83
|
+
halfEquation: "Cr³⁺ + 3e⁻ → Cr",
|
|
84
|
+
oxidised: "Cr³⁺",
|
|
85
|
+
reduced: "Cr",
|
|
86
|
+
electrons: 3,
|
|
87
|
+
standardPotential: -.74,
|
|
88
|
+
quotient: { "Cr3+": 1 }
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "Fe2+/Fe",
|
|
92
|
+
halfEquation: "Fe²⁺ + 2e⁻ → Fe",
|
|
93
|
+
oxidised: "Fe²⁺",
|
|
94
|
+
reduced: "Fe",
|
|
95
|
+
electrons: 2,
|
|
96
|
+
standardPotential: -.44,
|
|
97
|
+
quotient: { "Fe2+": 1 }
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
id: "Cd2+/Cd",
|
|
101
|
+
halfEquation: "Cd²⁺ + 2e⁻ → Cd",
|
|
102
|
+
oxidised: "Cd²⁺",
|
|
103
|
+
reduced: "Cd",
|
|
104
|
+
electrons: 2,
|
|
105
|
+
standardPotential: -.4,
|
|
106
|
+
quotient: { "Cd2+": 1 }
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
id: "Co2+/Co",
|
|
110
|
+
halfEquation: "Co²⁺ + 2e⁻ → Co",
|
|
111
|
+
oxidised: "Co²⁺",
|
|
112
|
+
reduced: "Co",
|
|
113
|
+
electrons: 2,
|
|
114
|
+
standardPotential: -.28,
|
|
115
|
+
quotient: { "Co2+": 1 }
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
id: "Ni2+/Ni",
|
|
119
|
+
halfEquation: "Ni²⁺ + 2e⁻ → Ni",
|
|
120
|
+
oxidised: "Ni²⁺",
|
|
121
|
+
reduced: "Ni",
|
|
122
|
+
electrons: 2,
|
|
123
|
+
standardPotential: -.25,
|
|
124
|
+
quotient: { "Ni2+": 1 }
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
id: "Sn2+/Sn",
|
|
128
|
+
halfEquation: "Sn²⁺ + 2e⁻ → Sn",
|
|
129
|
+
oxidised: "Sn²⁺",
|
|
130
|
+
reduced: "Sn",
|
|
131
|
+
electrons: 2,
|
|
132
|
+
standardPotential: -.14,
|
|
133
|
+
quotient: { "Sn2+": 1 }
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
id: "Pb2+/Pb",
|
|
137
|
+
halfEquation: "Pb²⁺ + 2e⁻ → Pb",
|
|
138
|
+
oxidised: "Pb²⁺",
|
|
139
|
+
reduced: "Pb",
|
|
140
|
+
electrons: 2,
|
|
141
|
+
standardPotential: -.13,
|
|
142
|
+
quotient: { "Pb2+": 1 }
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
id: "H+/H2",
|
|
146
|
+
halfEquation: "2H⁺ + 2e⁻ → H₂",
|
|
147
|
+
oxidised: "H⁺",
|
|
148
|
+
reduced: "H₂",
|
|
149
|
+
electrons: 2,
|
|
150
|
+
standardPotential: 0,
|
|
151
|
+
quotient: {
|
|
152
|
+
"H+": 2,
|
|
153
|
+
H2: -1
|
|
154
|
+
},
|
|
155
|
+
inertElectrode: true
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
id: "Sn4+/Sn2+",
|
|
159
|
+
halfEquation: "Sn⁴⁺ + 2e⁻ → Sn²⁺",
|
|
160
|
+
oxidised: "Sn⁴⁺",
|
|
161
|
+
reduced: "Sn²⁺",
|
|
162
|
+
electrons: 2,
|
|
163
|
+
standardPotential: .15,
|
|
164
|
+
quotient: {
|
|
165
|
+
"Sn4+": 1,
|
|
166
|
+
"Sn2+": -1
|
|
167
|
+
},
|
|
168
|
+
inertElectrode: true
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
id: "Cu2+/Cu",
|
|
172
|
+
halfEquation: "Cu²⁺ + 2e⁻ → Cu",
|
|
173
|
+
oxidised: "Cu²⁺",
|
|
174
|
+
reduced: "Cu",
|
|
175
|
+
electrons: 2,
|
|
176
|
+
standardPotential: .34,
|
|
177
|
+
quotient: { "Cu2+": 1 }
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
id: "O2/OH-",
|
|
181
|
+
halfEquation: "O₂ + 2H₂O + 4e⁻ → 4OH⁻",
|
|
182
|
+
oxidised: "O₂",
|
|
183
|
+
reduced: "OH⁻",
|
|
184
|
+
electrons: 4,
|
|
185
|
+
standardPotential: .4,
|
|
186
|
+
quotient: {
|
|
187
|
+
O2: 1,
|
|
188
|
+
"OH-": -4
|
|
189
|
+
},
|
|
190
|
+
inertElectrode: true
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
id: "I2/I-",
|
|
194
|
+
halfEquation: "I₂ + 2e⁻ → 2I⁻",
|
|
195
|
+
oxidised: "I₂",
|
|
196
|
+
reduced: "I⁻",
|
|
197
|
+
electrons: 2,
|
|
198
|
+
standardPotential: .54,
|
|
199
|
+
quotient: { "I-": -2 },
|
|
200
|
+
inertElectrode: true
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
id: "Fe3+/Fe2+",
|
|
204
|
+
halfEquation: "Fe³⁺ + e⁻ → Fe²⁺",
|
|
205
|
+
oxidised: "Fe³⁺",
|
|
206
|
+
reduced: "Fe²⁺",
|
|
207
|
+
electrons: 1,
|
|
208
|
+
standardPotential: .77,
|
|
209
|
+
quotient: {
|
|
210
|
+
"Fe3+": 1,
|
|
211
|
+
"Fe2+": -1
|
|
212
|
+
},
|
|
213
|
+
inertElectrode: true
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
id: "Ag+/Ag",
|
|
217
|
+
halfEquation: "Ag⁺ + e⁻ → Ag",
|
|
218
|
+
oxidised: "Ag⁺",
|
|
219
|
+
reduced: "Ag",
|
|
220
|
+
electrons: 1,
|
|
221
|
+
standardPotential: .8,
|
|
222
|
+
quotient: { "Ag+": 1 }
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
id: "Br2/Br-",
|
|
226
|
+
halfEquation: "Br₂ + 2e⁻ → 2Br⁻",
|
|
227
|
+
oxidised: "Br₂",
|
|
228
|
+
reduced: "Br⁻",
|
|
229
|
+
electrons: 2,
|
|
230
|
+
standardPotential: 1.07,
|
|
231
|
+
quotient: { "Br-": -2 },
|
|
232
|
+
inertElectrode: true
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
id: "O2/H2O",
|
|
236
|
+
halfEquation: "O₂ + 4H⁺ + 4e⁻ → 2H₂O",
|
|
237
|
+
oxidised: "O₂",
|
|
238
|
+
reduced: "H₂O",
|
|
239
|
+
electrons: 4,
|
|
240
|
+
standardPotential: 1.23,
|
|
241
|
+
quotient: {
|
|
242
|
+
O2: 1,
|
|
243
|
+
"H+": 4
|
|
244
|
+
},
|
|
245
|
+
inertElectrode: true
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
id: "Cr2O7^2-/Cr3+",
|
|
249
|
+
halfEquation: "Cr₂O₇²⁻ + 14H⁺ + 6e⁻ → 2Cr³⁺ + 7H₂O",
|
|
250
|
+
oxidised: "Cr₂O₇²⁻",
|
|
251
|
+
reduced: "Cr³⁺",
|
|
252
|
+
electrons: 6,
|
|
253
|
+
standardPotential: 1.33,
|
|
254
|
+
quotient: {
|
|
255
|
+
"Cr2O7^2-": 1,
|
|
256
|
+
"H+": 14,
|
|
257
|
+
"Cr3+": -2
|
|
258
|
+
},
|
|
259
|
+
inertElectrode: true
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
id: "Cl2/Cl-",
|
|
263
|
+
halfEquation: "Cl₂ + 2e⁻ → 2Cl⁻",
|
|
264
|
+
oxidised: "Cl₂",
|
|
265
|
+
reduced: "Cl⁻",
|
|
266
|
+
electrons: 2,
|
|
267
|
+
standardPotential: 1.36,
|
|
268
|
+
quotient: { "Cl-": -2 },
|
|
269
|
+
inertElectrode: true
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
id: "MnO4-/Mn2+",
|
|
273
|
+
halfEquation: "MnO₄⁻ + 8H⁺ + 5e⁻ → Mn²⁺ + 4H₂O",
|
|
274
|
+
oxidised: "MnO₄⁻",
|
|
275
|
+
reduced: "Mn²⁺",
|
|
276
|
+
electrons: 5,
|
|
277
|
+
standardPotential: 1.51,
|
|
278
|
+
quotient: {
|
|
279
|
+
"MnO4-": 1,
|
|
280
|
+
"H+": 8,
|
|
281
|
+
"Mn2+": -1
|
|
282
|
+
},
|
|
283
|
+
inertElectrode: true
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
id: "F2/F-",
|
|
287
|
+
halfEquation: "F₂ + 2e⁻ → 2F⁻",
|
|
288
|
+
oxidised: "F₂",
|
|
289
|
+
reduced: "F⁻",
|
|
290
|
+
electrons: 2,
|
|
291
|
+
standardPotential: 2.87,
|
|
292
|
+
quotient: { "F-": -2 },
|
|
293
|
+
inertElectrode: true
|
|
294
|
+
}
|
|
295
|
+
];
|
|
296
|
+
const BY_ID = new Map(COUPLES.map((c) => [c.id.toLowerCase(), c]));
|
|
297
|
+
/** A couple by id, case-insensitively. Undefined rather than a guess when it is not in the series. */
|
|
298
|
+
const coupleById = (id) => BY_ID.get(id.toLowerCase());
|
|
299
|
+
/**
|
|
300
|
+
* The standard OXIDATION potential, which is the reduction potential with its sign reversed.
|
|
301
|
+
*
|
|
302
|
+
* Computed rather than stored. See the note at the top of this file on why a second table would be
|
|
303
|
+
* a liability rather than a convenience.
|
|
304
|
+
*/
|
|
305
|
+
const oxidationPotential = (couple) => -couple.standardPotential;
|
|
306
|
+
/** The balanced half-equation as written for reduction, e.g. `Cu²⁺ + 2e⁻ → Cu`. */
|
|
307
|
+
const reductionEquation = (couple) => couple.halfEquation;
|
|
308
|
+
/**
|
|
309
|
+
* The same half-reaction run backwards, which is what happens at an anode.
|
|
310
|
+
*
|
|
311
|
+
* Derived from the reduction equation by swapping the sides and carrying the electrons across,
|
|
312
|
+
* rather than stored a second time. Two strings for one reaction could disagree; this cannot, and
|
|
313
|
+
* it keeps whatever stoichiometry and spectator water the reduction form already got right.
|
|
314
|
+
*/
|
|
315
|
+
function oxidationEquation(couple) {
|
|
316
|
+
const [left, right] = couple.halfEquation.split("→");
|
|
317
|
+
if (left === void 0 || right === void 0) return couple.halfEquation;
|
|
318
|
+
const electrons = couple.electrons === 1 ? "e⁻" : `${couple.electrons}e⁻`;
|
|
319
|
+
const withoutElectrons = left.split("+").map((part) => part.trim()).filter((part) => part !== electrons).join(" + ");
|
|
320
|
+
return `${right.trim()} → ${withoutElectrons} + ${electrons}`;
|
|
321
|
+
}
|
|
322
|
+
/**
|
|
323
|
+
* Is the reduced form of `a` able to reduce the oxidised form of `b`?
|
|
324
|
+
*
|
|
325
|
+
* The whole predictive content of the series in one comparison: a couple lower in the table has
|
|
326
|
+
* the stronger reducing agent on its reduced side, so zinc metal reduces copper(II) and copper
|
|
327
|
+
* metal does not reduce zinc(II).
|
|
328
|
+
*/
|
|
329
|
+
const canReduce = (a, b) => a.standardPotential < b.standardPotential;
|
|
330
|
+
/** The stronger oxidising agent of two oxidised forms, which is the one higher in the series. */
|
|
331
|
+
const strongerOxidant = (a, b) => a.standardPotential >= b.standardPotential ? a : b;
|
|
332
|
+
|
|
333
|
+
//#endregion
|
|
334
|
+
export { COUPLES, canReduce, coupleById, oxidationEquation, oxidationPotential, reductionEquation, strongerOxidant };
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
//#region src/electro/electrolysis.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Electrolysis: deciding what comes off each electrode, rather than remembering it.
|
|
4
|
+
*
|
|
5
|
+
* ## Why this is a decision and not a table
|
|
6
|
+
*
|
|
7
|
+
* The usual way this is taught is a table of electrolytes with their products written beside them,
|
|
8
|
+
* and it fails the first time a learner is asked about a solution that is not in the table. The
|
|
9
|
+
* worst case is the one most examined: CONCENTRATED sodium chloride gives chlorine at the anode
|
|
10
|
+
* and DILUTE sodium chloride gives oxygen, from the same two ions in the same solution. A table
|
|
11
|
+
* with one row for "NaCl(aq)" cannot express that, and a learner holding one will get it wrong.
|
|
12
|
+
*
|
|
13
|
+
* So nothing here stores a product. Three competitions are resolved:
|
|
14
|
+
*
|
|
15
|
+
* 1. At the cathode, which cation is reduced: the one lower in the reactivity series, meaning
|
|
16
|
+
* the higher standard potential. Water, supplying H⁺, is always a candidate in solution, so a
|
|
17
|
+
* metal more reactive than hydrogen never plates out of an aqueous solution.
|
|
18
|
+
* 2. At the anode, which anion is oxidised. Oxoanions such as sulfate and nitrate are never
|
|
19
|
+
* discharged: their central atom is already fully oxidised, so OH⁻ from the water goes
|
|
20
|
+
* instead and oxygen comes off. A halide competes with OH⁻ and wins when concentrated.
|
|
21
|
+
* 3. Whether the anode is inert at all. A copper anode in copper sulfate dissolves rather than
|
|
22
|
+
* releasing oxygen, because oxidising the electrode itself is easier than oxidising anything
|
|
23
|
+
* in the solution. That is not a special case to memorise, it is the same "easiest oxidation
|
|
24
|
+
* wins" rule with one more candidate.
|
|
25
|
+
*
|
|
26
|
+
* ## Concentration, and being honest about a rule of thumb
|
|
27
|
+
*
|
|
28
|
+
* Whether chloride beats hydroxide is not decided by standard potentials: on those alone, OH⁻
|
|
29
|
+
* (+0.40 V) should always win over Cl⁻ (+1.36 V), and in concentrated brine it plainly does not.
|
|
30
|
+
* The real reasons are the overpotential for oxygen on most anode materials and the concentration
|
|
31
|
+
* term, and neither is examined at this level. The threshold used here is the teaching rule, and
|
|
32
|
+
* it is labelled as one rather than dressed up as a computed result.
|
|
33
|
+
*
|
|
34
|
+
* Pure: no React, no pixels.
|
|
35
|
+
*/
|
|
36
|
+
/** How the electrolyte is presented to the cell. */
|
|
37
|
+
type Phase = 'molten' | 'aqueous';
|
|
38
|
+
/** What the electrodes are made of. */
|
|
39
|
+
type ElectrodeMaterial = 'inert' | 'copper' | 'silver' | 'nickel';
|
|
40
|
+
interface Electrolyte {
|
|
41
|
+
readonly formula: string;
|
|
42
|
+
readonly cation: string;
|
|
43
|
+
readonly anion: string;
|
|
44
|
+
/** The couple that would reduce this cation. */
|
|
45
|
+
readonly cationCouple: string;
|
|
46
|
+
/** The couple that would oxidise this anion, or undefined for an oxoanion that never is. */
|
|
47
|
+
readonly anionCouple?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* The electrolytes a syllabus actually asks about.
|
|
51
|
+
*
|
|
52
|
+
* This IS a table, and it is a table of what is dissolved rather than of what comes out. The
|
|
53
|
+
* distinction is the whole point: composition is a fact about the beaker, products are a
|
|
54
|
+
* consequence to be worked out.
|
|
55
|
+
*/
|
|
56
|
+
declare const ELECTROLYTES: readonly Electrolyte[];
|
|
57
|
+
declare const electrolyteByFormula: (formula: string) => Electrolyte | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Above this concentration a halide is discharged in preference to hydroxide.
|
|
60
|
+
*
|
|
61
|
+
* A teaching threshold, not a measured boundary. See the note at the top of this file: the real
|
|
62
|
+
* crossover depends on the anode material's oxygen overpotential and moves with it. Half a mole
|
|
63
|
+
* per cubic decimetre sits between the "dilute" and "concentrated" of every question that asks.
|
|
64
|
+
*/
|
|
65
|
+
declare const HALIDE_DISCHARGE_THRESHOLD = 0.5;
|
|
66
|
+
interface Discharge {
|
|
67
|
+
/** The species that reacts at this electrode. */
|
|
68
|
+
readonly species: string;
|
|
69
|
+
/** What comes off, or what happens to the electrode. */
|
|
70
|
+
readonly product: string;
|
|
71
|
+
/** The half-equation, written in the direction it runs. */
|
|
72
|
+
readonly equation: string;
|
|
73
|
+
/** Electrons per formula unit of product. */
|
|
74
|
+
readonly electrons: number;
|
|
75
|
+
/** Why this one and not the alternative. */
|
|
76
|
+
readonly because: string;
|
|
77
|
+
/** The alternative that lost, where there was one. */
|
|
78
|
+
readonly insteadOf?: string;
|
|
79
|
+
}
|
|
80
|
+
interface ElectrolysisConditions {
|
|
81
|
+
readonly electrolyte: Electrolyte;
|
|
82
|
+
readonly phase: Phase;
|
|
83
|
+
/** Concentration in mol/dm³. Ignored when molten. */
|
|
84
|
+
readonly concentration?: number;
|
|
85
|
+
readonly anodeMaterial?: ElectrodeMaterial;
|
|
86
|
+
}
|
|
87
|
+
interface ElectrolysisResult {
|
|
88
|
+
readonly cathode: Discharge;
|
|
89
|
+
readonly anode: Discharge;
|
|
90
|
+
/** What happens to the solution while it runs. */
|
|
91
|
+
readonly solution: string;
|
|
92
|
+
}
|
|
93
|
+
/** Run the three competitions and report what each electrode does. */
|
|
94
|
+
declare function electrolyse(conditions: ElectrolysisConditions): ElectrolysisResult;
|
|
95
|
+
//#endregion
|
|
96
|
+
export { Discharge, ELECTROLYTES, ElectrodeMaterial, ElectrolysisConditions, ElectrolysisResult, Electrolyte, HALIDE_DISCHARGE_THRESHOLD, Phase, electrolyse, electrolyteByFormula };
|