Add component database layer and validated physics core
- components/schema.py + database.py: typed loader for real retail parts (wire, capacitors, switches, sensors, projectile materials) - physics/inductance.py: multilayer solenoid inductance (Wheeler) with ferromagnetic-slug coupling via smooth overlap model and analytic dL/dx - physics/force.py: F = 0.5*I^2*dL/dx with a saturation clamp - physics/circuit.py: coupled [Q,I,x,v] discharge ODE - Validated against textbook RLC analytical solutions (under/over/critically damped) and energy conservation, not just spot-checked by eye - PLAN.md updated with animation (per-run field visualization) and GPU-accelerated batch sweep as explicit later stages Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
11
tests/fixtures/data/capacitors.json
vendored
Normal file
11
tests/fixtures/data/capacitors.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
[
|
||||
{
|
||||
"part_number": "test-cap-450v-220uf",
|
||||
"capacitance_uf": 220.0,
|
||||
"voltage_v": 450.0,
|
||||
"esr_ohm": 0.05,
|
||||
"max_current_a": 200.0,
|
||||
"price": 150.0,
|
||||
"source": "fixture"
|
||||
}
|
||||
]
|
||||
10
tests/fixtures/data/projectile_materials.json
vendored
Normal file
10
tests/fixtures/data/projectile_materials.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
[
|
||||
{
|
||||
"name": "test-steel",
|
||||
"density_kg_m3": 7850.0,
|
||||
"mu_r": 200.0,
|
||||
"b_sat_tesla": 1.8,
|
||||
"price_per_kg": 100.0,
|
||||
"source": "fixture"
|
||||
}
|
||||
]
|
||||
18
tests/fixtures/data/sensors.json
vendored
Normal file
18
tests/fixtures/data/sensors.json
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
[
|
||||
{
|
||||
"part_number": "test-optical",
|
||||
"kind": "optical",
|
||||
"propagation_delay_ns": 500.0,
|
||||
"price": 20.0,
|
||||
"source": "fixture"
|
||||
},
|
||||
{
|
||||
"part_number": "test-inductive-pickup",
|
||||
"kind": "inductive",
|
||||
"propagation_delay_ns": 0.0,
|
||||
"price": 5.0,
|
||||
"source": "fixture",
|
||||
"sensitivity_v_per_mps": 0.02,
|
||||
"threshold_v": 0.1
|
||||
}
|
||||
]
|
||||
13
tests/fixtures/data/switches.json
vendored
Normal file
13
tests/fixtures/data/switches.json
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
[
|
||||
{
|
||||
"part_number": "test-scr-25a",
|
||||
"kind": "SCR",
|
||||
"max_current_a": 25.0,
|
||||
"max_voltage_v": 600.0,
|
||||
"on_resistance_ohm": null,
|
||||
"on_voltage_drop_v": 1.5,
|
||||
"turn_on_time_ns": 2000.0,
|
||||
"price": 80.0,
|
||||
"source": "fixture"
|
||||
}
|
||||
]
|
||||
22
tests/fixtures/data/wires.json
vendored
Normal file
22
tests/fixtures/data/wires.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
[
|
||||
{
|
||||
"part_id": "test-cu-0.5",
|
||||
"material": "copper",
|
||||
"gauge_mm": 0.5,
|
||||
"insulation_od_mm": 0.55,
|
||||
"resistivity_ohm_m": 1.72e-8,
|
||||
"max_current_a": 3.0,
|
||||
"price_per_m": 5.0,
|
||||
"source": "fixture"
|
||||
},
|
||||
{
|
||||
"part_id": "test-al-0.5",
|
||||
"material": "aluminum",
|
||||
"gauge_mm": 0.5,
|
||||
"insulation_od_mm": 0.55,
|
||||
"resistivity_ohm_m": 2.82e-8,
|
||||
"max_current_a": 2.2,
|
||||
"price_per_m": 2.0,
|
||||
"source": "fixture"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user