@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,274 @@
|
|
|
1
|
+
import { coupleById, oxidationEquation, reductionEquation } from "./couples.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/electro/electrolysis.ts
|
|
4
|
+
/**
|
|
5
|
+
* Electrolysis: deciding what comes off each electrode, rather than remembering it.
|
|
6
|
+
*
|
|
7
|
+
* ## Why this is a decision and not a table
|
|
8
|
+
*
|
|
9
|
+
* The usual way this is taught is a table of electrolytes with their products written beside them,
|
|
10
|
+
* and it fails the first time a learner is asked about a solution that is not in the table. The
|
|
11
|
+
* worst case is the one most examined: CONCENTRATED sodium chloride gives chlorine at the anode
|
|
12
|
+
* and DILUTE sodium chloride gives oxygen, from the same two ions in the same solution. A table
|
|
13
|
+
* with one row for "NaCl(aq)" cannot express that, and a learner holding one will get it wrong.
|
|
14
|
+
*
|
|
15
|
+
* So nothing here stores a product. Three competitions are resolved:
|
|
16
|
+
*
|
|
17
|
+
* 1. At the cathode, which cation is reduced: the one lower in the reactivity series, meaning
|
|
18
|
+
* the higher standard potential. Water, supplying H⁺, is always a candidate in solution, so a
|
|
19
|
+
* metal more reactive than hydrogen never plates out of an aqueous solution.
|
|
20
|
+
* 2. At the anode, which anion is oxidised. Oxoanions such as sulfate and nitrate are never
|
|
21
|
+
* discharged: their central atom is already fully oxidised, so OH⁻ from the water goes
|
|
22
|
+
* instead and oxygen comes off. A halide competes with OH⁻ and wins when concentrated.
|
|
23
|
+
* 3. Whether the anode is inert at all. A copper anode in copper sulfate dissolves rather than
|
|
24
|
+
* releasing oxygen, because oxidising the electrode itself is easier than oxidising anything
|
|
25
|
+
* in the solution. That is not a special case to memorise, it is the same "easiest oxidation
|
|
26
|
+
* wins" rule with one more candidate.
|
|
27
|
+
*
|
|
28
|
+
* ## Concentration, and being honest about a rule of thumb
|
|
29
|
+
*
|
|
30
|
+
* Whether chloride beats hydroxide is not decided by standard potentials: on those alone, OH⁻
|
|
31
|
+
* (+0.40 V) should always win over Cl⁻ (+1.36 V), and in concentrated brine it plainly does not.
|
|
32
|
+
* The real reasons are the overpotential for oxygen on most anode materials and the concentration
|
|
33
|
+
* term, and neither is examined at this level. The threshold used here is the teaching rule, and
|
|
34
|
+
* it is labelled as one rather than dressed up as a computed result.
|
|
35
|
+
*
|
|
36
|
+
* Pure: no React, no pixels.
|
|
37
|
+
*/
|
|
38
|
+
/**
|
|
39
|
+
* The symbol and ion an active electrode dissolves to.
|
|
40
|
+
*
|
|
41
|
+
* A capitalised material name is NOT a chemical symbol, and treating it as one produced
|
|
42
|
+
* "Copper²⁺" in a half-equation. Silver would have been worse: it dissolves to Ag⁺, one electron,
|
|
43
|
+
* not the two every other entry here takes, so a rule that guessed the charge from the shape of
|
|
44
|
+
* the word would have been wrong about the arithmetic and not just the spelling.
|
|
45
|
+
*/
|
|
46
|
+
const ACTIVE_ELECTRODE = {
|
|
47
|
+
copper: {
|
|
48
|
+
symbol: "Cu",
|
|
49
|
+
ion: "Cu²⁺",
|
|
50
|
+
electrons: 2
|
|
51
|
+
},
|
|
52
|
+
silver: {
|
|
53
|
+
symbol: "Ag",
|
|
54
|
+
ion: "Ag⁺",
|
|
55
|
+
electrons: 1
|
|
56
|
+
},
|
|
57
|
+
nickel: {
|
|
58
|
+
symbol: "Ni",
|
|
59
|
+
ion: "Ni²⁺",
|
|
60
|
+
electrons: 2
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* The electrolytes a syllabus actually asks about.
|
|
65
|
+
*
|
|
66
|
+
* This IS a table, and it is a table of what is dissolved rather than of what comes out. The
|
|
67
|
+
* distinction is the whole point: composition is a fact about the beaker, products are a
|
|
68
|
+
* consequence to be worked out.
|
|
69
|
+
*/
|
|
70
|
+
const ELECTROLYTES = [
|
|
71
|
+
{
|
|
72
|
+
formula: "NaCl",
|
|
73
|
+
cation: "Na⁺",
|
|
74
|
+
anion: "Cl⁻",
|
|
75
|
+
cationCouple: "Na+/Na",
|
|
76
|
+
anionCouple: "Cl2/Cl-"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
formula: "PbCl2",
|
|
80
|
+
cation: "Pb²⁺",
|
|
81
|
+
anion: "Cl⁻",
|
|
82
|
+
cationCouple: "Pb2+/Pb",
|
|
83
|
+
anionCouple: "Cl2/Cl-"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
formula: "PbBr2",
|
|
87
|
+
cation: "Pb²⁺",
|
|
88
|
+
anion: "Br⁻",
|
|
89
|
+
cationCouple: "Pb2+/Pb",
|
|
90
|
+
anionCouple: "Br2/Br-"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
formula: "KI",
|
|
94
|
+
cation: "K⁺",
|
|
95
|
+
anion: "I⁻",
|
|
96
|
+
cationCouple: "K+/K",
|
|
97
|
+
anionCouple: "I2/I-"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
formula: "MgBr2",
|
|
101
|
+
cation: "Mg²⁺",
|
|
102
|
+
anion: "Br⁻",
|
|
103
|
+
cationCouple: "Mg2+/Mg",
|
|
104
|
+
anionCouple: "Br2/Br-"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
formula: "CuSO4",
|
|
108
|
+
cation: "Cu²⁺",
|
|
109
|
+
anion: "SO₄²⁻",
|
|
110
|
+
cationCouple: "Cu2+/Cu"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
formula: "H2SO4",
|
|
114
|
+
cation: "H⁺",
|
|
115
|
+
anion: "SO₄²⁻",
|
|
116
|
+
cationCouple: "H+/H2"
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
formula: "KNO3",
|
|
120
|
+
cation: "K⁺",
|
|
121
|
+
anion: "NO₃⁻",
|
|
122
|
+
cationCouple: "K+/K"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
formula: "NaOH",
|
|
126
|
+
cation: "Na⁺",
|
|
127
|
+
anion: "OH⁻",
|
|
128
|
+
cationCouple: "Na+/Na"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
formula: "AgNO3",
|
|
132
|
+
cation: "Ag⁺",
|
|
133
|
+
anion: "NO₃⁻",
|
|
134
|
+
cationCouple: "Ag+/Ag"
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
formula: "CuCl2",
|
|
138
|
+
cation: "Cu²⁺",
|
|
139
|
+
anion: "Cl⁻",
|
|
140
|
+
cationCouple: "Cu2+/Cu",
|
|
141
|
+
anionCouple: "Cl2/Cl-"
|
|
142
|
+
}
|
|
143
|
+
];
|
|
144
|
+
const electrolyteByFormula = (formula) => ELECTROLYTES.find((e) => e.formula.toLowerCase() === formula.toLowerCase());
|
|
145
|
+
/**
|
|
146
|
+
* Above this concentration a halide is discharged in preference to hydroxide.
|
|
147
|
+
*
|
|
148
|
+
* A teaching threshold, not a measured boundary. See the note at the top of this file: the real
|
|
149
|
+
* crossover depends on the anode material's oxygen overpotential and moves with it. Half a mole
|
|
150
|
+
* per cubic decimetre sits between the "dilute" and "concentrated" of every question that asks.
|
|
151
|
+
*/
|
|
152
|
+
const HALIDE_DISCHARGE_THRESHOLD = .5;
|
|
153
|
+
const half = (couple, direction) => direction === "reduce" ? reductionEquation(couple) : oxidationEquation(couple);
|
|
154
|
+
/** The couple for hydrogen, which is always a candidate in water. */
|
|
155
|
+
const HYDROGEN = coupleById("H+/H2");
|
|
156
|
+
/** Oxygen from hydroxide, the default anode reaction in any aqueous solution. */
|
|
157
|
+
const OXYGEN = coupleById("O2/OH-");
|
|
158
|
+
/**
|
|
159
|
+
* What is reduced at the cathode.
|
|
160
|
+
*
|
|
161
|
+
* Molten salt has only one cation, so there is no competition and the metal always forms. In water
|
|
162
|
+
* the metal ion competes with H⁺, and the winner is simply whichever couple has the higher
|
|
163
|
+
* standard potential. That single comparison reproduces the whole "metals above hydrogen in the
|
|
164
|
+
* reactivity series are not deposited from solution" rule without stating it separately.
|
|
165
|
+
*/
|
|
166
|
+
function cathodeOf(conditions) {
|
|
167
|
+
const couple = coupleById(conditions.electrolyte.cationCouple);
|
|
168
|
+
if (conditions.phase === "molten") return {
|
|
169
|
+
species: conditions.electrolyte.cation,
|
|
170
|
+
product: couple.reduced,
|
|
171
|
+
equation: half(couple, "reduce"),
|
|
172
|
+
electrons: couple.electrons,
|
|
173
|
+
because: "Molten salt contains no water, so the metal ion is the only cation present."
|
|
174
|
+
};
|
|
175
|
+
if (couple.standardPotential > HYDROGEN.standardPotential) return {
|
|
176
|
+
species: conditions.electrolyte.cation,
|
|
177
|
+
product: couple.reduced,
|
|
178
|
+
equation: half(couple, "reduce"),
|
|
179
|
+
electrons: couple.electrons,
|
|
180
|
+
because: `${couple.oxidised} is reduced more readily than H⁺ (${couple.standardPotential.toFixed(2)} V against 0.00 V), so the metal plates out.`,
|
|
181
|
+
insteadOf: "H₂"
|
|
182
|
+
};
|
|
183
|
+
return {
|
|
184
|
+
species: "water",
|
|
185
|
+
product: "H₂",
|
|
186
|
+
equation: "2H₂O + 2e⁻ → H₂ + 2OH⁻",
|
|
187
|
+
electrons: HYDROGEN.electrons,
|
|
188
|
+
because: `${couple.oxidised} holds its electrons harder than H⁺ does (${couple.standardPotential.toFixed(2)} V against 0.00 V), so water is reduced instead and the metal stays in solution.`,
|
|
189
|
+
insteadOf: couple.reduced
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* What is oxidised at the anode.
|
|
194
|
+
*
|
|
195
|
+
* Three candidates in order of how easily they give electrons up: the electrode itself if it is
|
|
196
|
+
* not inert, then a halide if there is one and it is concentrated enough, then hydroxide from the
|
|
197
|
+
* water. An oxoanion is never a candidate at all.
|
|
198
|
+
*/
|
|
199
|
+
function anodeOf(conditions) {
|
|
200
|
+
const material = conditions.anodeMaterial ?? "inert";
|
|
201
|
+
const active = ACTIVE_ELECTRODE[material];
|
|
202
|
+
if (active) {
|
|
203
|
+
const electrons = active.electrons === 1 ? "e⁻" : `${active.electrons}e⁻`;
|
|
204
|
+
return {
|
|
205
|
+
species: `the ${material} anode`,
|
|
206
|
+
product: active.ion,
|
|
207
|
+
equation: `${active.symbol}(s) → ${active.ion}(aq) + ${electrons}`,
|
|
208
|
+
electrons: active.electrons,
|
|
209
|
+
because: "Oxidising the electrode itself is easier than oxidising anything dissolved, so the anode dissolves instead of releasing a gas.",
|
|
210
|
+
insteadOf: "O₂"
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
const anionCouple = conditions.electrolyte.anionCouple ? coupleById(conditions.electrolyte.anionCouple) : void 0;
|
|
214
|
+
if (!anionCouple) return {
|
|
215
|
+
species: "OH⁻ from water",
|
|
216
|
+
product: "O₂",
|
|
217
|
+
equation: half(OXYGEN, "oxidise"),
|
|
218
|
+
electrons: OXYGEN.electrons,
|
|
219
|
+
because: `${conditions.electrolyte.anion} is an oxoanion whose central atom is already fully oxidised, so it cannot be oxidised further and water goes instead.`,
|
|
220
|
+
insteadOf: conditions.electrolyte.anion
|
|
221
|
+
};
|
|
222
|
+
if (conditions.phase === "molten") return {
|
|
223
|
+
species: conditions.electrolyte.anion,
|
|
224
|
+
product: anionCouple.oxidised,
|
|
225
|
+
equation: half(anionCouple, "oxidise"),
|
|
226
|
+
electrons: anionCouple.electrons,
|
|
227
|
+
because: "Molten salt contains no water, so the halide is the only thing available to oxidise."
|
|
228
|
+
};
|
|
229
|
+
const concentration = conditions.concentration ?? 1;
|
|
230
|
+
if (concentration >= .5) return {
|
|
231
|
+
species: conditions.electrolyte.anion,
|
|
232
|
+
product: anionCouple.oxidised,
|
|
233
|
+
equation: half(anionCouple, "oxidise"),
|
|
234
|
+
electrons: anionCouple.electrons,
|
|
235
|
+
because: `At ${concentration} mol/dm³ the halide is concentrated enough to be discharged ahead of water.`,
|
|
236
|
+
insteadOf: "O₂"
|
|
237
|
+
};
|
|
238
|
+
return {
|
|
239
|
+
species: "OH⁻ from water",
|
|
240
|
+
product: "O₂",
|
|
241
|
+
equation: half(OXYGEN, "oxidise"),
|
|
242
|
+
electrons: OXYGEN.electrons,
|
|
243
|
+
because: `At ${concentration} mol/dm³ there is too little ${conditions.electrolyte.anion} to compete, so water is oxidised and oxygen comes off instead.`,
|
|
244
|
+
insteadOf: anionCouple.oxidised
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
/** Run the three competitions and report what each electrode does. */
|
|
248
|
+
function electrolyse(conditions) {
|
|
249
|
+
const cathode = cathodeOf(conditions);
|
|
250
|
+
const anode = anodeOf(conditions);
|
|
251
|
+
return {
|
|
252
|
+
cathode,
|
|
253
|
+
anode,
|
|
254
|
+
solution: solutionChange(conditions, cathode, anode)
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* What the solution becomes, which is the part a practical question asks about.
|
|
259
|
+
*
|
|
260
|
+
* The observable is usually here rather than at the electrodes: brine turning alkaline is how the
|
|
261
|
+
* chlor-alkali industry makes sodium hydroxide, and copper sulfate keeping its blue with copper
|
|
262
|
+
* electrodes but losing it with inert ones is the standard "explain the observation" question.
|
|
263
|
+
*/
|
|
264
|
+
function solutionChange(conditions, cathode, anode) {
|
|
265
|
+
if (conditions.phase === "molten") return "The melt is consumed as both elements are released.";
|
|
266
|
+
const metalStays = cathode.product === "H₂";
|
|
267
|
+
if (anode.species.includes("anode") && !metalStays) return "Unchanged: the anode dissolves at the same rate as the cathode plates, so the concentration holds steady.";
|
|
268
|
+
if (metalStays && anode.product !== "O₂") return `${conditions.electrolyte.cation} and OH⁻ are left behind, so the solution turns alkaline.`;
|
|
269
|
+
if (metalStays) return "Water is removed from both electrodes, so the solution becomes more concentrated.";
|
|
270
|
+
return `${conditions.electrolyte.cation} is removed from the solution, so its colour fades and the solution turns acidic.`;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
//#endregion
|
|
274
|
+
export { ELECTROLYTES, HALIDE_DISCHARGE_THRESHOLD, electrolyse, electrolyteByFormula };
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
//#region src/electro/faraday.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Faraday's laws: how much stuff a given amount of charge moves.
|
|
4
|
+
*
|
|
5
|
+
* ## The whole topic is one conversion
|
|
6
|
+
*
|
|
7
|
+
* Q = I t charge is current times time
|
|
8
|
+
* n(e⁻) = Q / F one mole of electrons carries one faraday
|
|
9
|
+
* n(substance) = n(e⁻) / z where z is electrons per formula unit
|
|
10
|
+
* m = n M
|
|
11
|
+
*
|
|
12
|
+
* Faraday's first law ("mass is proportional to charge") and second law ("equal charge deposits
|
|
13
|
+
* masses in the ratio of their equivalent weights") are both consequences of that chain, not extra
|
|
14
|
+
* rules. They were discovered before anyone knew electrons existed, which is why they are stated
|
|
15
|
+
* as proportionalities with an experimental constant; the chain above is the same content once you
|
|
16
|
+
* know what the constant counts.
|
|
17
|
+
*
|
|
18
|
+
* Both laws are still exposed, because a learner is asked for them by name, but they are computed
|
|
19
|
+
* from the chain so they cannot drift from it.
|
|
20
|
+
*
|
|
21
|
+
* ## z is per formula unit, and it is where the marks go
|
|
22
|
+
*
|
|
23
|
+
* Depositing one mole of copper from Cu²⁺ takes two moles of electrons; one mole of silver from
|
|
24
|
+
* Ag⁺ takes one; one mole of aluminium from Al³⁺ takes three. Passing one faraday through three
|
|
25
|
+
* cells in series therefore deposits 1 mol Ag, ½ mol Cu and ⅓ mol Al, which looks like three
|
|
26
|
+
* different answers and is one.
|
|
27
|
+
*
|
|
28
|
+
* ## The constant
|
|
29
|
+
*
|
|
30
|
+
* F = N_A · e = 96485.3 C/mol exactly by definition of the two. Books use 96500, which is a
|
|
31
|
+
* rounding of 0.015% and cannot be seen in a three-figure answer. This file uses the exact value.
|
|
32
|
+
*
|
|
33
|
+
* Pure: no React, no pixels.
|
|
34
|
+
*/
|
|
35
|
+
/** Charge in coulombs from a steady current. */
|
|
36
|
+
declare const charge: (current: number, seconds: number) => number;
|
|
37
|
+
/** Moles of electrons carried by a charge. */
|
|
38
|
+
declare const molesOfElectrons: (coulombs: number) => number;
|
|
39
|
+
/** The charge needed to move a given number of moles of electrons. */
|
|
40
|
+
declare const chargeForElectrons: (moles: number) => number;
|
|
41
|
+
interface Deposit {
|
|
42
|
+
/** Moles of electrons that passed. */
|
|
43
|
+
readonly electronMoles: number;
|
|
44
|
+
/** Moles of the substance deposited or dissolved. */
|
|
45
|
+
readonly moles: number;
|
|
46
|
+
/** Mass in grams. */
|
|
47
|
+
readonly mass: number;
|
|
48
|
+
/** Charge passed, coulombs. */
|
|
49
|
+
readonly charge: number;
|
|
50
|
+
}
|
|
51
|
+
interface DepositRequest {
|
|
52
|
+
/** Relative atomic or formula mass, g/mol. */
|
|
53
|
+
readonly molarMass: number;
|
|
54
|
+
/** Electrons per formula unit, e.g. 2 for Cu²⁺ → Cu. */
|
|
55
|
+
readonly electrons: number;
|
|
56
|
+
readonly current: number;
|
|
57
|
+
readonly seconds: number;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* What a current deposits, in one pass.
|
|
61
|
+
*
|
|
62
|
+
* The four quantities are returned together rather than one at a time, because a question almost
|
|
63
|
+
* never asks for the mass alone: it asks for the mass and then the number of atoms, or the mass
|
|
64
|
+
* and then the change in solution concentration.
|
|
65
|
+
*/
|
|
66
|
+
declare function deposit({
|
|
67
|
+
molarMass,
|
|
68
|
+
electrons,
|
|
69
|
+
current,
|
|
70
|
+
seconds
|
|
71
|
+
}: DepositRequest): Deposit;
|
|
72
|
+
/**
|
|
73
|
+
* The current needed to deposit a given mass in a given time.
|
|
74
|
+
*
|
|
75
|
+
* The same relation solved the other way, which is how about half of these questions are set.
|
|
76
|
+
*/
|
|
77
|
+
declare const currentForMass: (mass: number, {
|
|
78
|
+
molarMass,
|
|
79
|
+
electrons,
|
|
80
|
+
seconds
|
|
81
|
+
}: {
|
|
82
|
+
molarMass: number;
|
|
83
|
+
electrons: number;
|
|
84
|
+
seconds: number;
|
|
85
|
+
}) => number;
|
|
86
|
+
/** The time needed to deposit a given mass at a given current. */
|
|
87
|
+
declare const timeForMass: (mass: number, {
|
|
88
|
+
molarMass,
|
|
89
|
+
electrons,
|
|
90
|
+
current
|
|
91
|
+
}: {
|
|
92
|
+
molarMass: number;
|
|
93
|
+
electrons: number;
|
|
94
|
+
current: number;
|
|
95
|
+
}) => number;
|
|
96
|
+
/**
|
|
97
|
+
* Equivalent weight: the mass moved by one faraday.
|
|
98
|
+
*
|
|
99
|
+
* The quantity Faraday's second law is stated in, and the reason the law works without anyone
|
|
100
|
+
* knowing about electrons. It is just M/z.
|
|
101
|
+
*/
|
|
102
|
+
declare const equivalentWeight: (molarMass: number, electrons: number) => number;
|
|
103
|
+
/**
|
|
104
|
+
* Electrochemical equivalent Z: grams per coulomb, so that m = Z Q.
|
|
105
|
+
*
|
|
106
|
+
* The first law's constant of proportionality. Worth having by name because older papers ask for
|
|
107
|
+
* it directly, and because it makes the first law a one-line check rather than a re-derivation.
|
|
108
|
+
*/
|
|
109
|
+
declare const electrochemicalEquivalent: (molarMass: number, electrons: number) => number;
|
|
110
|
+
/**
|
|
111
|
+
* Faraday's second law as a ratio: equal charge moves masses in proportion to equivalent weights.
|
|
112
|
+
*
|
|
113
|
+
* This is the calculation for cells wired in SERIES, where the same charge necessarily passes
|
|
114
|
+
* through every one of them. That "necessarily" is the physics: series means one current, so the
|
|
115
|
+
* comparison needs no extra assumption.
|
|
116
|
+
*/
|
|
117
|
+
declare const massRatio: (a: {
|
|
118
|
+
molarMass: number;
|
|
119
|
+
electrons: number;
|
|
120
|
+
}, b: {
|
|
121
|
+
molarMass: number;
|
|
122
|
+
electrons: number;
|
|
123
|
+
}) => number;
|
|
124
|
+
/**
|
|
125
|
+
* Volume of gas released, at a stated molar volume.
|
|
126
|
+
*
|
|
127
|
+
* Defaults to STP. A gas electrode's product is asked for as a volume far more often than as a
|
|
128
|
+
* mass, and converting through the mass loses the point: the electrons count particles, and a
|
|
129
|
+
* volume of gas is a count of particles.
|
|
130
|
+
*/
|
|
131
|
+
declare const gasVolume: (moles: number, molarVolume?: number) => number;
|
|
132
|
+
/**
|
|
133
|
+
* Current efficiency: how much of the charge did the reaction you wanted.
|
|
134
|
+
*
|
|
135
|
+
* Rarely 100%. Plating nickel from an aqueous bath also reduces some water to hydrogen, so the
|
|
136
|
+
* metal actually deposited falls short of what the charge could have deposited. The gap is not
|
|
137
|
+
* experimental error, it is a second reaction sharing the current, which is why a real plating
|
|
138
|
+
* line is specified by efficiency as well as by current.
|
|
139
|
+
*/
|
|
140
|
+
declare const currentEfficiency: (actualMass: number, theoreticalMass: number) => number;
|
|
141
|
+
/**
|
|
142
|
+
* The plated thickness a deposit corresponds to, in centimetres.
|
|
143
|
+
*
|
|
144
|
+
* Mass is what the charge determines and thickness is what the specification is written in, so
|
|
145
|
+
* this conversion through density and area is the last step of most real plating questions.
|
|
146
|
+
* Area in cm², density in g/cm³.
|
|
147
|
+
*/
|
|
148
|
+
declare const platedThickness: (mass: number, area: number, density: number) => number;
|
|
149
|
+
//#endregion
|
|
150
|
+
export { Deposit, DepositRequest, charge, chargeForElectrons, currentEfficiency, currentForMass, deposit, electrochemicalEquivalent, equivalentWeight, gasVolume, massRatio, molesOfElectrons, platedThickness, timeForMass };
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { FARADAY, MOLAR_GAS_VOLUME_STP } from "../core/constants.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/electro/faraday.ts
|
|
4
|
+
/**
|
|
5
|
+
* Faraday's laws: how much stuff a given amount of charge moves.
|
|
6
|
+
*
|
|
7
|
+
* ## The whole topic is one conversion
|
|
8
|
+
*
|
|
9
|
+
* Q = I t charge is current times time
|
|
10
|
+
* n(e⁻) = Q / F one mole of electrons carries one faraday
|
|
11
|
+
* n(substance) = n(e⁻) / z where z is electrons per formula unit
|
|
12
|
+
* m = n M
|
|
13
|
+
*
|
|
14
|
+
* Faraday's first law ("mass is proportional to charge") and second law ("equal charge deposits
|
|
15
|
+
* masses in the ratio of their equivalent weights") are both consequences of that chain, not extra
|
|
16
|
+
* rules. They were discovered before anyone knew electrons existed, which is why they are stated
|
|
17
|
+
* as proportionalities with an experimental constant; the chain above is the same content once you
|
|
18
|
+
* know what the constant counts.
|
|
19
|
+
*
|
|
20
|
+
* Both laws are still exposed, because a learner is asked for them by name, but they are computed
|
|
21
|
+
* from the chain so they cannot drift from it.
|
|
22
|
+
*
|
|
23
|
+
* ## z is per formula unit, and it is where the marks go
|
|
24
|
+
*
|
|
25
|
+
* Depositing one mole of copper from Cu²⁺ takes two moles of electrons; one mole of silver from
|
|
26
|
+
* Ag⁺ takes one; one mole of aluminium from Al³⁺ takes three. Passing one faraday through three
|
|
27
|
+
* cells in series therefore deposits 1 mol Ag, ½ mol Cu and ⅓ mol Al, which looks like three
|
|
28
|
+
* different answers and is one.
|
|
29
|
+
*
|
|
30
|
+
* ## The constant
|
|
31
|
+
*
|
|
32
|
+
* F = N_A · e = 96485.3 C/mol exactly by definition of the two. Books use 96500, which is a
|
|
33
|
+
* rounding of 0.015% and cannot be seen in a three-figure answer. This file uses the exact value.
|
|
34
|
+
*
|
|
35
|
+
* Pure: no React, no pixels.
|
|
36
|
+
*/
|
|
37
|
+
/** Charge in coulombs from a steady current. */
|
|
38
|
+
const charge = (current, seconds) => current * seconds;
|
|
39
|
+
/** Moles of electrons carried by a charge. */
|
|
40
|
+
const molesOfElectrons = (coulombs) => coulombs / FARADAY;
|
|
41
|
+
/** The charge needed to move a given number of moles of electrons. */
|
|
42
|
+
const chargeForElectrons = (moles) => moles * FARADAY;
|
|
43
|
+
/**
|
|
44
|
+
* What a current deposits, in one pass.
|
|
45
|
+
*
|
|
46
|
+
* The four quantities are returned together rather than one at a time, because a question almost
|
|
47
|
+
* never asks for the mass alone: it asks for the mass and then the number of atoms, or the mass
|
|
48
|
+
* and then the change in solution concentration.
|
|
49
|
+
*/
|
|
50
|
+
function deposit({ molarMass, electrons, current, seconds }) {
|
|
51
|
+
const q = charge(current, seconds);
|
|
52
|
+
const electronMoles = molesOfElectrons(q);
|
|
53
|
+
const moles = electronMoles / electrons;
|
|
54
|
+
return {
|
|
55
|
+
electronMoles,
|
|
56
|
+
moles,
|
|
57
|
+
mass: moles * molarMass,
|
|
58
|
+
charge: q
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The current needed to deposit a given mass in a given time.
|
|
63
|
+
*
|
|
64
|
+
* The same relation solved the other way, which is how about half of these questions are set.
|
|
65
|
+
*/
|
|
66
|
+
const currentForMass = (mass, { molarMass, electrons, seconds }) => mass / molarMass * electrons * FARADAY / seconds;
|
|
67
|
+
/** The time needed to deposit a given mass at a given current. */
|
|
68
|
+
const timeForMass = (mass, { molarMass, electrons, current }) => mass / molarMass * electrons * FARADAY / current;
|
|
69
|
+
/**
|
|
70
|
+
* Equivalent weight: the mass moved by one faraday.
|
|
71
|
+
*
|
|
72
|
+
* The quantity Faraday's second law is stated in, and the reason the law works without anyone
|
|
73
|
+
* knowing about electrons. It is just M/z.
|
|
74
|
+
*/
|
|
75
|
+
const equivalentWeight = (molarMass, electrons) => molarMass / electrons;
|
|
76
|
+
/**
|
|
77
|
+
* Electrochemical equivalent Z: grams per coulomb, so that m = Z Q.
|
|
78
|
+
*
|
|
79
|
+
* The first law's constant of proportionality. Worth having by name because older papers ask for
|
|
80
|
+
* it directly, and because it makes the first law a one-line check rather than a re-derivation.
|
|
81
|
+
*/
|
|
82
|
+
const electrochemicalEquivalent = (molarMass, electrons) => equivalentWeight(molarMass, electrons) / FARADAY;
|
|
83
|
+
/**
|
|
84
|
+
* Faraday's second law as a ratio: equal charge moves masses in proportion to equivalent weights.
|
|
85
|
+
*
|
|
86
|
+
* This is the calculation for cells wired in SERIES, where the same charge necessarily passes
|
|
87
|
+
* through every one of them. That "necessarily" is the physics: series means one current, so the
|
|
88
|
+
* comparison needs no extra assumption.
|
|
89
|
+
*/
|
|
90
|
+
const massRatio = (a, b) => equivalentWeight(a.molarMass, a.electrons) / equivalentWeight(b.molarMass, b.electrons);
|
|
91
|
+
/**
|
|
92
|
+
* Volume of gas released, at a stated molar volume.
|
|
93
|
+
*
|
|
94
|
+
* Defaults to STP. A gas electrode's product is asked for as a volume far more often than as a
|
|
95
|
+
* mass, and converting through the mass loses the point: the electrons count particles, and a
|
|
96
|
+
* volume of gas is a count of particles.
|
|
97
|
+
*/
|
|
98
|
+
const gasVolume = (moles, molarVolume = MOLAR_GAS_VOLUME_STP) => moles * molarVolume;
|
|
99
|
+
/**
|
|
100
|
+
* Current efficiency: how much of the charge did the reaction you wanted.
|
|
101
|
+
*
|
|
102
|
+
* Rarely 100%. Plating nickel from an aqueous bath also reduces some water to hydrogen, so the
|
|
103
|
+
* metal actually deposited falls short of what the charge could have deposited. The gap is not
|
|
104
|
+
* experimental error, it is a second reaction sharing the current, which is why a real plating
|
|
105
|
+
* line is specified by efficiency as well as by current.
|
|
106
|
+
*/
|
|
107
|
+
const currentEfficiency = (actualMass, theoreticalMass) => theoreticalMass === 0 ? 0 : actualMass / theoreticalMass;
|
|
108
|
+
/**
|
|
109
|
+
* The plated thickness a deposit corresponds to, in centimetres.
|
|
110
|
+
*
|
|
111
|
+
* Mass is what the charge determines and thickness is what the specification is written in, so
|
|
112
|
+
* this conversion through density and area is the last step of most real plating questions.
|
|
113
|
+
* Area in cm², density in g/cm³.
|
|
114
|
+
*/
|
|
115
|
+
const platedThickness = (mass, area, density) => area === 0 || density === 0 ? 0 : mass / (area * density);
|
|
116
|
+
|
|
117
|
+
//#endregion
|
|
118
|
+
export { charge, chargeForElectrons, currentEfficiency, currentForMass, deposit, electrochemicalEquivalent, equivalentWeight, gasVolume, massRatio, molesOfElectrons, platedThickness, timeForMass };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { COUPLES, Couple, Role, canReduce, coupleById, oxidationEquation, oxidationPotential, reductionEquation, strongerOxidant } from "./couples.mjs";
|
|
2
|
+
import { Cell, HalfCellState, STANDARD_TEMPERATURE, anodeOxidationPotential, cellAsWritten, cellNotation, cellReaction, electrodePotential, electromotiveForce, freeEnergyFromPotential, galvanicCell, hydrogenElectrodePotential, nernstSlope, potentialFromFreeEnergy } from "./cell.mjs";
|
|
3
|
+
import { Discharge, ELECTROLYTES, ElectrodeMaterial, ElectrolysisConditions, ElectrolysisResult, Electrolyte, HALIDE_DISCHARGE_THRESHOLD, Phase, electrolyse, electrolyteByFormula } from "./electrolysis.mjs";
|
|
4
|
+
import { Deposit, DepositRequest, charge, chargeForElectrons, currentEfficiency, currentForMass, deposit, electrochemicalEquivalent, equivalentWeight, gasVolume, massRatio, molesOfElectrons, platedThickness, timeForMass } from "./faraday.mjs";
|
|
5
|
+
import { cellConstant, conductance, conductivity, degreeOfDissociation, dissociationFromConstant, equivalentConductivity, limitingMolarConductivity, molarConductivity, molarVolumeOfSolution, ostwaldConstant, strongMolarConductivity, weakMolarConductivity } from "./conductivity.mjs";
|
|
6
|
+
export { COUPLES, type Cell, type Couple, type Deposit, type DepositRequest, type Discharge, ELECTROLYTES, type ElectrodeMaterial, type ElectrolysisConditions, type ElectrolysisResult, type Electrolyte, HALIDE_DISCHARGE_THRESHOLD, type HalfCellState, type Phase, type Role, STANDARD_TEMPERATURE, anodeOxidationPotential, canReduce, cellAsWritten, cellConstant, cellNotation, cellReaction, charge, chargeForElectrons, conductance, conductivity, coupleById, currentEfficiency, currentForMass, degreeOfDissociation, deposit, dissociationFromConstant, electrochemicalEquivalent, electrodePotential, electrolyse, electrolyteByFormula, electromotiveForce, equivalentConductivity, equivalentWeight, freeEnergyFromPotential, galvanicCell, gasVolume, hydrogenElectrodePotential, limitingMolarConductivity, massRatio, molarConductivity, molarVolumeOfSolution, molesOfElectrons, nernstSlope, ostwaldConstant, oxidationEquation, oxidationPotential, platedThickness, potentialFromFreeEnergy, reductionEquation, strongMolarConductivity, strongerOxidant, timeForMass, weakMolarConductivity };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { COUPLES, canReduce, coupleById, oxidationEquation, oxidationPotential, reductionEquation, strongerOxidant } from "./couples.mjs";
|
|
2
|
+
import { STANDARD_TEMPERATURE, anodeOxidationPotential, cellAsWritten, cellNotation, cellReaction, electrodePotential, electromotiveForce, freeEnergyFromPotential, galvanicCell, hydrogenElectrodePotential, nernstSlope, potentialFromFreeEnergy } from "./cell.mjs";
|
|
3
|
+
import { ELECTROLYTES, HALIDE_DISCHARGE_THRESHOLD, electrolyse, electrolyteByFormula } from "./electrolysis.mjs";
|
|
4
|
+
import { charge, chargeForElectrons, currentEfficiency, currentForMass, deposit, electrochemicalEquivalent, equivalentWeight, gasVolume, massRatio, molesOfElectrons, platedThickness, timeForMass } from "./faraday.mjs";
|
|
5
|
+
import { cellConstant, conductance, conductivity, degreeOfDissociation, dissociationFromConstant, equivalentConductivity, limitingMolarConductivity, molarConductivity, molarVolumeOfSolution, ostwaldConstant, strongMolarConductivity, weakMolarConductivity } from "./conductivity.mjs";
|
|
6
|
+
|
|
7
|
+
export { COUPLES, ELECTROLYTES, HALIDE_DISCHARGE_THRESHOLD, STANDARD_TEMPERATURE, anodeOxidationPotential, canReduce, cellAsWritten, cellConstant, cellNotation, cellReaction, charge, chargeForElectrons, conductance, conductivity, coupleById, currentEfficiency, currentForMass, degreeOfDissociation, deposit, dissociationFromConstant, electrochemicalEquivalent, electrodePotential, electrolyse, electrolyteByFormula, electromotiveForce, equivalentConductivity, equivalentWeight, freeEnergyFromPotential, galvanicCell, gasVolume, hydrogenElectrodePotential, limitingMolarConductivity, massRatio, molarConductivity, molarVolumeOfSolution, molesOfElectrons, nernstSlope, ostwaldConstant, oxidationEquation, oxidationPotential, platedThickness, potentialFromFreeEnergy, reductionEquation, strongMolarConductivity, strongerOxidant, timeForMass, weakMolarConductivity };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AccountDefinition, AccountingPolicy, AccountingSolution, AdjustmentFact, AdjustmentResult, JournalEntry } from "./types.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/finance/accounting/adjustments.d.ts
|
|
4
|
+
declare function produceAdjustment(fact: AdjustmentFact, policy?: AccountingPolicy): AdjustmentResult;
|
|
5
|
+
declare function applyAdjustments({
|
|
6
|
+
accounts,
|
|
7
|
+
baseEntries,
|
|
8
|
+
adjustments,
|
|
9
|
+
policy
|
|
10
|
+
}: {
|
|
11
|
+
accounts: readonly AccountDefinition[];
|
|
12
|
+
baseEntries: readonly JournalEntry[];
|
|
13
|
+
adjustments: readonly AdjustmentFact[];
|
|
14
|
+
policy?: AccountingPolicy;
|
|
15
|
+
}): AccountingSolution;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { applyAdjustments, produceAdjustment };
|