@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,333 @@
|
|
|
1
|
+
//#region src/circuit/dc.ts
|
|
2
|
+
/** NMOS square-law operating point: drain current + its small-signal conductances. */
|
|
3
|
+
function nmosOp(Vgs, Vds, vth, k) {
|
|
4
|
+
const Vov = Vgs - vth;
|
|
5
|
+
if (Vov <= 0) return {
|
|
6
|
+
Id: 0,
|
|
7
|
+
gm: 0,
|
|
8
|
+
gds: GMIN
|
|
9
|
+
};
|
|
10
|
+
if (Vds < Vov) return {
|
|
11
|
+
Id: k * (Vov * Vds - .5 * Vds * Vds),
|
|
12
|
+
gm: k * Vds,
|
|
13
|
+
gds: k * (Vov - Vds) + GMIN
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
Id: .5 * k * Vov * Vov,
|
|
17
|
+
gm: k * Vov,
|
|
18
|
+
gds: GMIN
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const VT = .025852;
|
|
22
|
+
const GMIN = 1e-12;
|
|
23
|
+
function nodeCount(elems) {
|
|
24
|
+
let max = 0;
|
|
25
|
+
for (const e of elems) max = Math.max(max, e.n1, e.n2, e.n3 ?? 0);
|
|
26
|
+
return max + 1;
|
|
27
|
+
}
|
|
28
|
+
/** Solve A x = b by Gaussian elimination with partial pivoting. Returns null if singular. */
|
|
29
|
+
function solveLinear(A, b) {
|
|
30
|
+
const n = b.length;
|
|
31
|
+
const M = A.map((row, i) => [...row, b[i]]);
|
|
32
|
+
for (let col = 0; col < n; col++) {
|
|
33
|
+
let piv = col;
|
|
34
|
+
for (let r = col + 1; r < n; r++) if (Math.abs(M[r][col]) > Math.abs(M[piv][col])) piv = r;
|
|
35
|
+
if (Math.abs(M[piv][col]) < 1e-18) return null;
|
|
36
|
+
[M[col], M[piv]] = [M[piv], M[col]];
|
|
37
|
+
const pivVal = M[col][col];
|
|
38
|
+
for (let r = 0; r < n; r++) {
|
|
39
|
+
if (r === col) continue;
|
|
40
|
+
const f = M[r][col] / pivVal;
|
|
41
|
+
if (f === 0) continue;
|
|
42
|
+
for (let c = col; c <= n; c++) M[r][c] -= f * M[col][c];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
const x = new Array(n);
|
|
46
|
+
for (let i = 0; i < n; i++) x[i] = M[i][n] / M[i][i];
|
|
47
|
+
return x;
|
|
48
|
+
}
|
|
49
|
+
/** Build the MNA system A x = z for one solve (DC if no dt, else one transient step). */
|
|
50
|
+
function buildMNA(elems, opts) {
|
|
51
|
+
const N = nodeCount(elems);
|
|
52
|
+
const dc = opts.dt === void 0;
|
|
53
|
+
const vbranch = [];
|
|
54
|
+
elems.forEach((e) => {
|
|
55
|
+
if (e.kind === "V" || e.kind === "L" && dc) vbranch.push({
|
|
56
|
+
elem: e,
|
|
57
|
+
row: 0
|
|
58
|
+
});
|
|
59
|
+
});
|
|
60
|
+
const n = N - 1 + vbranch.length;
|
|
61
|
+
vbranch.forEach((vb, j) => {
|
|
62
|
+
vb.row = N - 1 + j;
|
|
63
|
+
});
|
|
64
|
+
const A = Array.from({ length: n }, () => new Array(n).fill(0));
|
|
65
|
+
const z = new Array(n).fill(0);
|
|
66
|
+
const ix = (node) => node - 1;
|
|
67
|
+
const stampG = (a, b, g) => {
|
|
68
|
+
if (a >= 0) A[a][a] += g;
|
|
69
|
+
if (b >= 0) A[b][b] += g;
|
|
70
|
+
if (a >= 0 && b >= 0) {
|
|
71
|
+
A[a][b] -= g;
|
|
72
|
+
A[b][a] -= g;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
const stampI = (a, b, I) => {
|
|
76
|
+
if (a >= 0) z[a] -= I;
|
|
77
|
+
if (b >= 0) z[b] += I;
|
|
78
|
+
};
|
|
79
|
+
for (let k = 1; k < N; k++) A[ix(k)][ix(k)] += GMIN;
|
|
80
|
+
let vi = 0;
|
|
81
|
+
elems.forEach((e, idx) => {
|
|
82
|
+
const a = ix(e.n1), b = ix(e.n2);
|
|
83
|
+
if (e.kind === "R") stampG(a, b, 1 / e.value);
|
|
84
|
+
else if (e.kind === "I") stampI(a, b, e.value);
|
|
85
|
+
else if (e.kind === "V" || e.kind === "L" && dc) {
|
|
86
|
+
const row = vbranch[vi++].row;
|
|
87
|
+
const E = e.kind === "V" ? e.value : 0;
|
|
88
|
+
if (a >= 0) {
|
|
89
|
+
A[a][row] += 1;
|
|
90
|
+
A[row][a] += 1;
|
|
91
|
+
}
|
|
92
|
+
if (b >= 0) {
|
|
93
|
+
A[b][row] -= 1;
|
|
94
|
+
A[row][b] -= 1;
|
|
95
|
+
}
|
|
96
|
+
z[row] += E;
|
|
97
|
+
} else if (e.kind === "C" && !dc) {
|
|
98
|
+
const Geq = e.value / opts.dt;
|
|
99
|
+
const Ieq = -Geq * (opts.prevV?.get(idx) ?? 0);
|
|
100
|
+
stampG(a, b, Geq);
|
|
101
|
+
stampI(a, b, Ieq);
|
|
102
|
+
} else if (e.kind === "L" && !dc) {
|
|
103
|
+
const Geq = opts.dt / e.value;
|
|
104
|
+
const Ieq = opts.prevI?.get(idx) ?? 0;
|
|
105
|
+
stampG(a, b, Geq);
|
|
106
|
+
stampI(a, b, Ieq);
|
|
107
|
+
} else if (e.kind === "D") {
|
|
108
|
+
const Is = e.is ?? 1e-12, nvt = (e.nIdeal ?? 1) * VT;
|
|
109
|
+
const V = opts.diodeV?.get(idx) ?? 0;
|
|
110
|
+
const Id = Is * (Math.exp(Math.min(V / nvt, 80)) - 1);
|
|
111
|
+
const gd = (Id + Is) / nvt + GMIN;
|
|
112
|
+
const Ieq = Id - gd * V;
|
|
113
|
+
stampG(a, b, gd);
|
|
114
|
+
stampI(a, b, Ieq);
|
|
115
|
+
} else if (e.kind === "M") {
|
|
116
|
+
const D = a, S = b, G = ix(e.n3 ?? 0);
|
|
117
|
+
const nv = opts.prevNodeV;
|
|
118
|
+
const Vg = nv?.[e.n3 ?? 0] ?? 0, Vd = nv?.[e.n1] ?? 0, Vs = nv?.[e.n2] ?? 0;
|
|
119
|
+
if (e.pmos) {
|
|
120
|
+
const { Id, gm, gds } = nmosOp(Vs - Vg, Vs - Vd, Math.abs(e.vth ?? 2), e.k ?? .5);
|
|
121
|
+
const Ieq = Id - gm * (Vs - Vg) - gds * (Vs - Vd);
|
|
122
|
+
stampG(S, D, gds);
|
|
123
|
+
if (S >= 0) A[S][S] += gm;
|
|
124
|
+
if (S >= 0 && G >= 0) A[S][G] -= gm;
|
|
125
|
+
if (D >= 0 && S >= 0) A[D][S] -= gm;
|
|
126
|
+
if (D >= 0 && G >= 0) A[D][G] += gm;
|
|
127
|
+
stampI(S, D, Ieq);
|
|
128
|
+
} else {
|
|
129
|
+
const { Id, gm, gds } = nmosOp(Vg - Vs, Vd - Vs, e.vth ?? 2, e.k ?? .5);
|
|
130
|
+
const Ieq = Id - gm * (Vg - Vs) - gds * (Vd - Vs);
|
|
131
|
+
stampG(D, S, gds);
|
|
132
|
+
if (D >= 0 && G >= 0) A[D][G] += gm;
|
|
133
|
+
if (D >= 0 && S >= 0) A[D][S] -= gm;
|
|
134
|
+
if (S >= 0 && G >= 0) A[S][G] -= gm;
|
|
135
|
+
if (S >= 0) A[S][S] += gm;
|
|
136
|
+
stampI(D, S, Ieq);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
return {
|
|
141
|
+
A,
|
|
142
|
+
z,
|
|
143
|
+
N,
|
|
144
|
+
vbranch
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
/** DC operating point: capacitors open, inductors short. Routes to the nonlinear solver for diodes / MOSFETs. */
|
|
148
|
+
function solveDC(elems) {
|
|
149
|
+
if (elems.some((e) => e.kind === "D" || e.kind === "M")) return solveDCNonlinear(elems);
|
|
150
|
+
const { A, z, N, vbranch } = buildMNA(elems, {});
|
|
151
|
+
const x = solveLinear(A, z);
|
|
152
|
+
const nodeV = new Array(N).fill(0);
|
|
153
|
+
const current = {};
|
|
154
|
+
if (!x) return {
|
|
155
|
+
nodeV,
|
|
156
|
+
current,
|
|
157
|
+
ok: false
|
|
158
|
+
};
|
|
159
|
+
for (let k = 1; k < N; k++) nodeV[k] = x[k - 1];
|
|
160
|
+
vbranch.forEach((vb) => {
|
|
161
|
+
if (vb.elem.id) current[vb.elem.id] = x[vb.row];
|
|
162
|
+
});
|
|
163
|
+
return {
|
|
164
|
+
nodeV,
|
|
165
|
+
current,
|
|
166
|
+
ok: true
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Nonlinear DC via Newton-Raphson: each iteration linearizes every nonlinear device
|
|
171
|
+
* (diode Shockley with pnjlim limiting; NMOS square-law about the previous node
|
|
172
|
+
* voltages) into a companion conductance + current source, solves the linear system,
|
|
173
|
+
* and repeats until the solution settles.
|
|
174
|
+
*/
|
|
175
|
+
function solveDCNonlinear(elems, opts = {}) {
|
|
176
|
+
const maxIter = opts.maxIter ?? 100, tol = opts.tol ?? 1e-7;
|
|
177
|
+
const N0 = nodeCount(elems);
|
|
178
|
+
const diodes = elems.map((e, i) => ({
|
|
179
|
+
e,
|
|
180
|
+
i
|
|
181
|
+
})).filter((x) => x.e.kind === "D");
|
|
182
|
+
const mosfets = elems.map((e, i) => ({
|
|
183
|
+
e,
|
|
184
|
+
i
|
|
185
|
+
})).filter((x) => x.e.kind === "M");
|
|
186
|
+
const diodeV = /* @__PURE__ */ new Map();
|
|
187
|
+
diodes.forEach((d) => diodeV.set(d.i, 0));
|
|
188
|
+
let prevNodeV = new Array(N0).fill(0);
|
|
189
|
+
let x = null;
|
|
190
|
+
let N = N0;
|
|
191
|
+
let vbranch = [];
|
|
192
|
+
let converged = false;
|
|
193
|
+
for (let iter = 0; iter < maxIter; iter++) {
|
|
194
|
+
const built = buildMNA(elems, {
|
|
195
|
+
diodeV,
|
|
196
|
+
prevNodeV
|
|
197
|
+
});
|
|
198
|
+
N = built.N;
|
|
199
|
+
vbranch = built.vbranch;
|
|
200
|
+
const sol = solveLinear(built.A, built.z);
|
|
201
|
+
if (!sol) break;
|
|
202
|
+
x = sol;
|
|
203
|
+
const newNodeV = new Array(N).fill(0);
|
|
204
|
+
for (let k = 1; k < N; k++) newNodeV[k] = sol[k - 1];
|
|
205
|
+
if (mosfets.length > 0) {
|
|
206
|
+
const VMAXSTEP = 2;
|
|
207
|
+
for (let k = 1; k < N; k++) {
|
|
208
|
+
const old = prevNodeV[k] ?? 0;
|
|
209
|
+
const dv = (newNodeV[k] ?? 0) - old;
|
|
210
|
+
if (Math.abs(dv) > VMAXSTEP) newNodeV[k] = old + Math.sign(dv) * VMAXSTEP;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
let maxDelta = 0;
|
|
214
|
+
for (const d of diodes) {
|
|
215
|
+
let Vnew = (newNodeV[d.e.n1] ?? 0) - (newNodeV[d.e.n2] ?? 0);
|
|
216
|
+
const nvt = (d.e.nIdeal ?? 1) * VT, Is = d.e.is ?? 1e-12;
|
|
217
|
+
const Vold = diodeV.get(d.i);
|
|
218
|
+
const Vcrit = nvt * Math.log(nvt / (Is * Math.SQRT2));
|
|
219
|
+
if (Vnew > Vcrit && Vnew > Vold) Vnew = Vold + nvt * Math.log(1 + (Vnew - Vold) / nvt);
|
|
220
|
+
maxDelta = Math.max(maxDelta, Math.abs(Vnew - Vold));
|
|
221
|
+
diodeV.set(d.i, Vnew);
|
|
222
|
+
}
|
|
223
|
+
for (let k = 1; k < N; k++) maxDelta = Math.max(maxDelta, Math.abs((newNodeV[k] ?? 0) - (prevNodeV[k] ?? 0)));
|
|
224
|
+
prevNodeV = newNodeV;
|
|
225
|
+
if (maxDelta < tol) {
|
|
226
|
+
converged = true;
|
|
227
|
+
break;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
const nodeV = new Array(N).fill(0);
|
|
231
|
+
const current = {};
|
|
232
|
+
if (!x || !converged) return {
|
|
233
|
+
nodeV,
|
|
234
|
+
current,
|
|
235
|
+
ok: false
|
|
236
|
+
};
|
|
237
|
+
for (let k = 1; k < N; k++) nodeV[k] = x[k - 1];
|
|
238
|
+
vbranch.forEach((vb) => {
|
|
239
|
+
if (vb.elem.id) current[vb.elem.id] = x[vb.row];
|
|
240
|
+
});
|
|
241
|
+
diodes.forEach((d) => {
|
|
242
|
+
if (!d.e.id) return;
|
|
243
|
+
const nvt = (d.e.nIdeal ?? 1) * VT, Is = d.e.is ?? 1e-12;
|
|
244
|
+
current[d.e.id] = Is * (Math.exp(Math.min((diodeV.get(d.i) ?? 0) / nvt, 80)) - 1);
|
|
245
|
+
});
|
|
246
|
+
mosfets.forEach((m) => {
|
|
247
|
+
if (!m.e.id) return;
|
|
248
|
+
const Vg = nodeV[m.e.n3 ?? 0] ?? 0, Vd = nodeV[m.e.n1] ?? 0, Vs = nodeV[m.e.n2] ?? 0;
|
|
249
|
+
current[m.e.id] = m.e.pmos ? nmosOp(Vs - Vg, Vs - Vd, Math.abs(m.e.vth ?? 2), m.e.k ?? .5).Id : nmosOp(Vg - Vs, Vd - Vs, m.e.vth ?? 2, m.e.k ?? .5).Id;
|
|
250
|
+
});
|
|
251
|
+
return {
|
|
252
|
+
nodeV,
|
|
253
|
+
current,
|
|
254
|
+
ok: true
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
/** Current through an element given solved node voltages (R/I directly; C/L need state). */
|
|
258
|
+
function elementCurrent(e, nodeV) {
|
|
259
|
+
const v = (nodeV[e.n1] ?? 0) - (nodeV[e.n2] ?? 0);
|
|
260
|
+
if (e.kind === "R") return v / e.value;
|
|
261
|
+
if (e.kind === "I") return e.value;
|
|
262
|
+
return NaN;
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Time-stepped transient (Backward Euler). Returns the node-voltage trajectory,
|
|
266
|
+
* including t = 0. Reactive elements use companion models rebuilt every step.
|
|
267
|
+
*/
|
|
268
|
+
function solveTransient(elems, opts) {
|
|
269
|
+
const { dt, steps } = opts;
|
|
270
|
+
const N = nodeCount(elems);
|
|
271
|
+
const prevV = /* @__PURE__ */ new Map();
|
|
272
|
+
const prevI = /* @__PURE__ */ new Map();
|
|
273
|
+
elems.forEach((e, i) => {
|
|
274
|
+
if (e.kind === "C" || e.kind === "L") prevV.set(i, opts.initialV?.get(i) ?? 0);
|
|
275
|
+
if (e.kind === "L") prevI.set(i, 0);
|
|
276
|
+
});
|
|
277
|
+
const out = [];
|
|
278
|
+
const record = (t, nodeV) => {
|
|
279
|
+
out.push({
|
|
280
|
+
t,
|
|
281
|
+
nodeV: [...nodeV]
|
|
282
|
+
});
|
|
283
|
+
};
|
|
284
|
+
let nodeV = new Array(N).fill(0);
|
|
285
|
+
if (!elems.some((e) => e.kind === "D" || e.kind === "M")) {
|
|
286
|
+
const { A, z } = buildMNA(elems.map((e, i) => e.kind === "C" ? {
|
|
287
|
+
...e,
|
|
288
|
+
kind: "V",
|
|
289
|
+
value: opts.initialV?.get(i) ?? 0
|
|
290
|
+
} : e.kind === "L" ? {
|
|
291
|
+
...e,
|
|
292
|
+
kind: "I",
|
|
293
|
+
value: prevI.get(i) ?? 0
|
|
294
|
+
} : e), {});
|
|
295
|
+
const x = solveLinear(A, z);
|
|
296
|
+
if (x) for (let k = 1; k < N; k++) nodeV[k] = x[k - 1] ?? 0;
|
|
297
|
+
}
|
|
298
|
+
record(0, nodeV);
|
|
299
|
+
for (let s = 1; s <= steps; s++) {
|
|
300
|
+
const { A, z } = buildMNA(elems, {
|
|
301
|
+
dt,
|
|
302
|
+
prevV,
|
|
303
|
+
prevI
|
|
304
|
+
});
|
|
305
|
+
const x = solveLinear(A, z);
|
|
306
|
+
if (!x) break;
|
|
307
|
+
nodeV = new Array(N).fill(0);
|
|
308
|
+
for (let k = 1; k < N; k++) nodeV[k] = x[k - 1];
|
|
309
|
+
elems.forEach((e, i) => {
|
|
310
|
+
if (e.kind === "C" || e.kind === "L") {
|
|
311
|
+
const v = (nodeV[e.n1] ?? 0) - (nodeV[e.n2] ?? 0);
|
|
312
|
+
prevV.set(i, v);
|
|
313
|
+
if (e.kind === "L") {
|
|
314
|
+
const Geq = dt / e.value;
|
|
315
|
+
prevI.set(i, Geq * v + (prevI.get(i) ?? 0));
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
record(s * dt, nodeV);
|
|
320
|
+
}
|
|
321
|
+
return out;
|
|
322
|
+
}
|
|
323
|
+
/** Equivalent resistance of resistors in series. */
|
|
324
|
+
function seriesR(...rs) {
|
|
325
|
+
return rs.reduce((a, r) => a + r, 0);
|
|
326
|
+
}
|
|
327
|
+
/** Equivalent resistance of resistors in parallel. */
|
|
328
|
+
function parallelR(...rs) {
|
|
329
|
+
return 1 / rs.reduce((a, r) => a + 1 / r, 0);
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
//#endregion
|
|
333
|
+
export { elementCurrent, parallelR, seriesR, solveDC, solveDCNonlinear, solveLinear, solveTransient };
|
package/dist/circuit/index.d.mts
CHANGED
|
@@ -1,92 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
* elements (resistors, sources, capacitors, inductors) and it returns the node
|
|
7
|
-
* voltages and branch currents, the correct numbers, so a current-electricity
|
|
8
|
-
* lab shows real results instead of hand-rolled per-lab arithmetic.
|
|
9
|
-
*
|
|
10
|
-
* • solveDC , DC operating point (capacitors open, inductors short).
|
|
11
|
-
* • solveTransient, time-stepped response (RC / RL / RLC) via Backward-Euler
|
|
12
|
-
* companion models: each reactive element becomes a
|
|
13
|
-
* conductance Geq in parallel with a current source Ieq each
|
|
14
|
-
* step, exactly how real simulators integrate the ODEs.
|
|
15
|
-
*
|
|
16
|
-
* Node 0 is ground (the reference). MNA stamps are additive, so parallel elements
|
|
17
|
-
* just sum. Nonlinear devices (diodes / transistors via Newton-Raphson) are the
|
|
18
|
-
* next layer and slot into the same stamping helpers.
|
|
19
|
-
*
|
|
20
|
-
* Conventions (validated against the MNA / Qucs companion-model references):
|
|
21
|
-
* • Resistor R between (n1,n2): conductance g = 1/R.
|
|
22
|
-
* • Current source I: drives `value` amps from n1 to n2 (injected into n2).
|
|
23
|
-
* • Voltage source V: value volts, n1 is + relative to n2 (adds a branch current
|
|
24
|
-
* unknown). Its solved current is positive flowing n1 → n2 inside the source.
|
|
25
|
-
*/
|
|
26
|
-
type NodeId = number;
|
|
27
|
-
interface Elem {
|
|
28
|
-
kind: 'R' | 'V' | 'I' | 'C' | 'L' | 'D' | 'M';
|
|
29
|
-
/** diode: n1=anode, n2=cathode. NMOS 'M': n1=drain, n2=source, n3=gate. */
|
|
30
|
-
n1: NodeId;
|
|
31
|
-
n2: NodeId;
|
|
32
|
-
/** gate node for an NMOS 'M'. */
|
|
33
|
-
n3?: NodeId;
|
|
34
|
-
/** ohms (R) / volts (V) / amps (I) / farads (C) / henries (L). Ignored for D / M. */
|
|
35
|
-
value: number;
|
|
36
|
-
/** diode saturation current Is (default 1e-12 A). */
|
|
37
|
-
is?: number;
|
|
38
|
-
/** diode ideality factor n (default 1). */
|
|
39
|
-
nIdeal?: number;
|
|
40
|
-
/** MOSFET threshold voltage Vth (default 2 V; for a PMOS the magnitude is used). */
|
|
41
|
-
vth?: number;
|
|
42
|
-
/** MOSFET transconductance parameter k = µCox·W/L (default 0.5 A/V²). */
|
|
43
|
-
k?: number;
|
|
44
|
-
/** P-channel MOSFET (conducts when the gate is LOW vs the source). Default NMOS. */
|
|
45
|
-
pmos?: boolean;
|
|
46
|
-
/** optional label, used to key the returned branch currents. */
|
|
47
|
-
id?: string;
|
|
48
|
-
}
|
|
49
|
-
/** Solve A x = b by Gaussian elimination with partial pivoting. Returns null if singular. */
|
|
50
|
-
declare function solveLinear(A: number[][], b: number[]): number[] | null;
|
|
51
|
-
interface DCResult {
|
|
52
|
-
/** node voltages indexed by node id; [0] is ground = 0. */
|
|
53
|
-
nodeV: number[];
|
|
54
|
-
/** current through each branch element (V sources, and inductors), keyed by id. */
|
|
55
|
-
current: Record<string, number>;
|
|
56
|
-
ok: boolean;
|
|
57
|
-
}
|
|
58
|
-
/** DC operating point: capacitors open, inductors short. Routes to the nonlinear solver for diodes / MOSFETs. */
|
|
59
|
-
declare function solveDC(elems: readonly Elem[]): DCResult;
|
|
60
|
-
/**
|
|
61
|
-
* Nonlinear DC via Newton-Raphson: each iteration linearizes every nonlinear device
|
|
62
|
-
* (diode Shockley with pnjlim limiting; NMOS square-law about the previous node
|
|
63
|
-
* voltages) into a companion conductance + current source, solves the linear system,
|
|
64
|
-
* and repeats until the solution settles.
|
|
65
|
-
*/
|
|
66
|
-
declare function solveDCNonlinear(elems: readonly Elem[], opts?: {
|
|
67
|
-
maxIter?: number;
|
|
68
|
-
tol?: number;
|
|
69
|
-
}): DCResult;
|
|
70
|
-
/** Current through an element given solved node voltages (R/I directly; C/L need state). */
|
|
71
|
-
declare function elementCurrent(e: Elem, nodeV: number[]): number;
|
|
72
|
-
interface TransientStep {
|
|
73
|
-
t: number;
|
|
74
|
-
nodeV: number[];
|
|
75
|
-
}
|
|
76
|
-
interface TransientOpts {
|
|
77
|
-
dt: number;
|
|
78
|
-
steps: number;
|
|
79
|
-
/** initial voltages across reactive elements, keyed by element index (default 0). */
|
|
80
|
-
initialV?: Map<number, number>;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Time-stepped transient (Backward Euler). Returns the node-voltage trajectory,
|
|
84
|
-
* including t = 0. Reactive elements use companion models rebuilt every step.
|
|
85
|
-
*/
|
|
86
|
-
declare function solveTransient(elems: readonly Elem[], opts: TransientOpts): TransientStep[];
|
|
87
|
-
/** Equivalent resistance of resistors in series. */
|
|
88
|
-
declare function seriesR(...rs: number[]): number;
|
|
89
|
-
/** Equivalent resistance of resistors in parallel. */
|
|
90
|
-
declare function parallelR(...rs: number[]): number;
|
|
91
|
-
//#endregion
|
|
92
|
-
export { DCResult, Elem, NodeId, TransientOpts, TransientStep, elementCurrent, parallelR, seriesR, solveDC, solveDCNonlinear, solveLinear, solveTransient };
|
|
1
|
+
import { DCResult, Elem, NodeId, TransientOpts, TransientStep, elementCurrent, parallelR, seriesR, solveDC, solveDCNonlinear, solveLinear, solveTransient } from "./dc.mjs";
|
|
2
|
+
import { BridgeShape, Edge, SeriesPair, Topology, degrees, findBridgeShape, findDangling, findParallelGroup, findSelfLoop, findSeriesPair, isReduced, isTerminal, mergedId, pairKey, validateTopology } from "./topology.mjs";
|
|
3
|
+
import { Component, NEGLIGIBLE, Network, Quantity, Reduction, ReductionRule, ReductionStep, combineParallel, combineSeries, deltaFromStar, equivalentByNodalAnalysis, infiniteLadderOhm, reduce, starFromDelta, symbolFor, unitFor, validateNetwork } from "./network.mjs";
|
|
4
|
+
import { AcNetwork, AcResponse, Element, ElementKind, TINY, apparentPowerVA, bandwidthRadPerS, bridgeBalances, decibels, dividerGain, equivalentImpedance, impedanceByNodalAnalysis, impedanceOf, magnitude, parallelImpedance, phaseDeg, powerFactor, qualityFactor, rcCornerOmega, rcLowPass, reactance, realPowerW, resistance, resonantHz, resonantOmega, responseAt, rmsFromPeak, seriesImpedance, seriesRlc, sweep, timesC } from "./ac.mjs";
|
|
5
|
+
export { AcNetwork, AcResponse, BridgeShape, Component, DCResult, Edge, Elem, Element, ElementKind, NEGLIGIBLE, Network, NodeId, Quantity, Reduction, ReductionRule, ReductionStep, SeriesPair, TINY, Topology, TransientOpts, TransientStep, apparentPowerVA, bandwidthRadPerS, bridgeBalances, combineParallel, combineSeries, decibels, degrees, deltaFromStar, dividerGain, elementCurrent, equivalentByNodalAnalysis, equivalentImpedance, findBridgeShape, findDangling, findParallelGroup, findSelfLoop, findSeriesPair, impedanceByNodalAnalysis, impedanceOf, infiniteLadderOhm, isReduced, isTerminal, magnitude, mergedId, pairKey, parallelImpedance, parallelR, phaseDeg, powerFactor, qualityFactor, rcCornerOmega, rcLowPass, reactance, realPowerW, reduce, resistance, resonantHz, resonantOmega, responseAt, rmsFromPeak, seriesImpedance, seriesR, seriesRlc, solveDC, solveDCNonlinear, solveLinear, solveTransient, starFromDelta, sweep, symbolFor, timesC, unitFor, validateNetwork, validateTopology };
|