Skip to content

Commit ac2391a

Browse files
committed
Docs: Added Philosophy behind the library
1 parent 508dccf commit ac2391a

File tree

1 file changed

+54
-38
lines changed

1 file changed

+54
-38
lines changed

docs/philosophy.md

Lines changed: 54 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,74 @@
11
# VoltOps Core Philosophy
22

3-
VoltOps delivers **physics-aware computation for everyday electronics and signal-analysis workflows**. Each public API corresponds to a concept that practicing engineers recognize—Ohm's Law, impedance, FFT-based measurement, and so on. Rather than replicating generic math helpers, VoltOps focuses on wiring realistic metadata, guardrails, and educational context into every computation.
3+
VoltOps is designed to support **electronics and signal-analysis workflows where physical context matters**. The library exposes APIs that correspond to familiar engineering concepts—Ohm’s law, impedance, power, frequency analysis—while explicitly tracking the assumptions under which those concepts are valid.
4+
5+
Rather than acting as a general numerical toolbox, VoltOps focuses on preserving metadata, enforcing basic physical constraints, and documenting intent at the API level.
46

57
---
68

7-
## Guiding Assumptions
9+
## Operating Assumptions
10+
11+
Unless stated otherwise, computations in VoltOps assume:
812

9-
- **Linear, time-invariant, lumped elements** unless explicitly stated.
10-
- **Steady-state analysis** is the default; transient behavior must be modeled consciously.
11-
- **Closed-form expressions first**. Numerical solvers and optimizers stay in delegated libraries (e.g., SciPy) until they can be wrapped with clear physics-aware semantics.
12-
- **Quantities, not scalars**. VoltOps manipulates `Voltage`, `Current`, `Power`, etc., keeping track of waveform kind (DC, AC RMS, AC peak), phase references, and carrier frequency.
13+
* **Linear, time-invariant, lumped systems**
14+
* **Steady-state behavior**, with transient effects treated as a separate modeling choice
15+
* **Closed-form analytical relationships**, with numerical solvers delegated to external libraries when needed
16+
* **Typed physical quantities**, such as voltage or current, rather than unannotated scalars
1317

14-
## Non‑Goals (for now)
18+
These assumptions are made explicit to reduce ambiguity and prevent accidental misuse.
19+
20+
---
1521

16-
Reinforcing explicit "no" statements builds trust:
22+
## Design Considerations
1723

18-
- VoltOps is **not** a SPICE replacement or a general-purpose circuit simulator.
19-
- **No real-time execution guarantees**—runtime safety belongs to your embedded toolchain.
20-
- **No nonlinear semiconductor device physics**. Analytical helpers for BJTs/FETs may arrive later, but they will remain closed-form.
21-
- **No blind duplication of SciPy/NumPy** utilities. We wrap them only when physics-aware metadata adds value.
24+
1. **Quantities instead of scalars**
25+
Electrical values are represented as typed quantities (e.g., `Voltage`, `Current`, `Power`) that carry waveform information such as DC/AC classification, RMS or peak representation, phase reference, and frequency where applicable.
2226

23-
## Design Principles
27+
2. **Physical consistency checks**
28+
Tests emphasize conservation laws, scaling behavior, and dimensional consistency rather than relying solely on fixed numerical outputs.
2429

25-
1. **Quantities over scalars** – Type-safe values that guard against invalid operations and attach waveform metadata everywhere.
26-
2. **Physical invariants as tests** – Unit tests assert conservation laws, scaling behavior, and dimensional consistency instead of memorizing golden numbers.
27-
3. **Layered architecture** – Packages are separated into `core/` (metadata + quantities), `formulas/`, `signal_processing/`, and future `circuits/` or `numeric/` layers. Lower layers never depend on higher ones.
28-
4. **Context-rich results** – APIs return annotated objects. Even FFT helpers yield spectra with sampling metadata rather than naked arrays.
29-
5. **Delegation with intent** – Expensive numerical kernels continue to live in SciPy/NumPy; VoltOps focuses on keeping the surrounding context faithful to the underlying physics.
30+
3. **Layered structure**
31+
The codebase is organized into layers (`core`, `formulas`, `signal_processing`, etc.) with one-way dependencies. Lower layers remain independent of higher-level abstractions.
3032

31-
## Roadmap Snapshot
33+
4. **Context-preserving outputs**
34+
Functions return annotated results instead of raw arrays. For example, frequency-domain transforms retain sampling and spectral metadata rather than discarding it.
35+
36+
5. **Intentional delegation**
37+
Established libraries such as NumPy and SciPy are used for numerical kernels. VoltOps focuses on providing physics-aware structure around these computations rather than re-implementing them.
38+
39+
---
3240

33-
| Theme | Why it matters | Current Status |
34-
| --- | --- | --- |
35-
| Quantity primitives | Enforce metadata, catch misuse early | (`voltage`, `current`, `resistance`, etc.) |
36-
| Circuit abstractions | Series/parallel, dividers, equivalents | planned |
37-
| Measurement helpers | ADC quantization, SNR, aliasing guards | planned |
38-
| Signal-aware DSP | FFTs that return annotated spectra | foundational transforms |
39-
| Symbolic hooks | Bridge SymPy for derivations | future exploration |
41+
## Development Roadmap (Indicative)
4042

41-
## How This Shapes Implementation
43+
| Area | Rationale | Status |
44+
| ----------------------- | ---------------------------------------------- | ------------ |
45+
| Quantity primitives | Preserve metadata and enforce valid operations | Implemented |
46+
| Circuit abstractions | Express common analytical reductions | Designed |
47+
| Measurement helpers | Model ADC limits, noise, aliasing | Designed |
48+
| Signal-aware transforms | Retain context across domains | Foundational |
49+
| Symbolic integration | Support derivations alongside numerics | Exploratory |
50+
51+
---
52+
53+
## Implementation Implications
54+
55+
* APIs are written to **express intent explicitly**. For example, voltage is derived through a named relationship rather than implicit arithmetic.
56+
* Documentation focuses on **assumptions and failure modes**, not just usage.
57+
* The architecture keeps metadata handling separate from numerical kernels, allowing future optimization without altering user-facing behavior.
58+
59+
---
4260

43-
- **APIs describe intent**: instead of `voltage = i * r`, users call `BasicFormulas.ohms_law(current=i, resistance=r)` and receive a `Voltage` object tied to the originating metadata.
44-
- **Docs teach, not just list**: each recipe explains the physical context, common pitfalls, and how VoltOps keeps track of assumptions.
45-
- **Architecture anticipates acceleration**: should we swap in C++ kernels later, the Python-facing API remains unchanged because all metadata plumbing lives in `core/`.
61+
## External Dependencies
4662

47-
## Delegations
63+
VoltOps relies on existing libraries for well-established functionality:
4864

49-
| Capability | Preferred Library |
50-
| --- | --- |
51-
| Large-scale linear algebra | NumPy / SciPy |
52-
| Nonlinear solvers & optimizers | SciPy |
53-
| Symbolic manipulation | SymPy (optional future layer) |
54-
| Plotting / visualization | Matplotlib, Plotly, etc. (kept outside VoltOps) |
65+
| Capability | Library |
66+
| --------------------------- | --------------------------- |
67+
| Linear algebra and numerics | NumPy, SciPy |
68+
| Nonlinear solvers | SciPy |
69+
| Symbolic algebra | SymPy (optional) |
70+
| Visualization | External plotting libraries |
5571

5672
---
5773

58-
VoltOps succeeds when it saves engineers from re-deriving the same relationships, documents the assumptions behind every helper, and keeps metadata honest from input to output. Depth over breadth, physics over convenience, meaning over speed.
74+
VoltOps aims to reduce repeated derivations, make assumptions visible, and keep physical meaning intact throughout a computation pipeline. The emphasis is on clarity and correctness rather than breadth or performance.

0 commit comments

Comments
 (0)