circuit-json 0.0.453 → 0.0.454
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/README.md +232 -0
- package/dist/index.d.mts +2654 -40
- package/dist/index.mjs +415 -111
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -195,11 +195,21 @@ https://github.com/user-attachments/assets/2f28b7ba-689e-4d80-85b2-5bdef84b41f8
|
|
|
195
195
|
- [SchematicTrace](#schematictrace)
|
|
196
196
|
- [SchematicVoltageProbe](#schematicvoltageprobe)
|
|
197
197
|
- [Simulation Elements](#simulation-elements)
|
|
198
|
+
- [SimulationAcSweepCurrentGraph](#simulationacsweepcurrentgraph)
|
|
199
|
+
- [SimulationAcSweepVoltageGraph](#simulationacsweepvoltagegraph)
|
|
200
|
+
- [SimulationAnalysisResult](#simulationanalysisresult)
|
|
201
|
+
- [SimulationComplexSample](#simulationcomplexsample)
|
|
198
202
|
- [SimulationCurrentProbe](#simulationcurrentprobe)
|
|
199
203
|
- [SimulationCurrentSource](#simulationcurrentsource)
|
|
204
|
+
- [SimulationDcOperatingPointCurrent](#simulationdcoperatingpointcurrent)
|
|
205
|
+
- [SimulationDcOperatingPointVoltage](#simulationdcoperatingpointvoltage)
|
|
206
|
+
- [SimulationDcSweepCurrentGraph](#simulationdcsweepcurrentgraph)
|
|
207
|
+
- [SimulationDcSweepVoltageGraph](#simulationdcsweepvoltagegraph)
|
|
200
208
|
- [SimulationExperiment](#simulationexperiment)
|
|
201
209
|
- [SimulationOpAmp](#simulationopamp)
|
|
202
210
|
- [SimulationOscilloscopeTrace](#simulationoscilloscopetrace)
|
|
211
|
+
- [SimulationParameterSweep](#simulationparametersweep)
|
|
212
|
+
- [SimulationParameterSweepCoordinate](#simulationparametersweepcoordinate)
|
|
203
213
|
- [SimulationSpiceSubcircuit](#simulationspicesubcircuit)
|
|
204
214
|
- [SimulationSwitch](#simulationswitch)
|
|
205
215
|
- [SimulationTransientCurrentGraph](#simulationtransientcurrentgraph)
|
|
@@ -3412,6 +3422,81 @@ interface SchematicVoltageProbe {
|
|
|
3412
3422
|
|
|
3413
3423
|
## Simulation Elements
|
|
3414
3424
|
|
|
3425
|
+
### SimulationAcSweepCurrentGraph
|
|
3426
|
+
|
|
3427
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_ac_sweep_current_graph.ts)
|
|
3428
|
+
|
|
3429
|
+
```typescript
|
|
3430
|
+
interface SimulationAcSweepCurrentGraph {
|
|
3431
|
+
type: "simulation_ac_sweep_current_graph"
|
|
3432
|
+
simulation_ac_sweep_current_graph_id: string
|
|
3433
|
+
simulation_experiment_id: string
|
|
3434
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3435
|
+
simulation_current_probe_id: string
|
|
3436
|
+
frequencies_hz: number[]
|
|
3437
|
+
complex_currents: SimulationComplexSample[]
|
|
3438
|
+
name?: string
|
|
3439
|
+
color?: string
|
|
3440
|
+
}
|
|
3441
|
+
```
|
|
3442
|
+
|
|
3443
|
+
### SimulationAcSweepVoltageGraph
|
|
3444
|
+
|
|
3445
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_ac_sweep_voltage_graph.ts)
|
|
3446
|
+
|
|
3447
|
+
```typescript
|
|
3448
|
+
interface SimulationAcSweepVoltageGraph {
|
|
3449
|
+
type: "simulation_ac_sweep_voltage_graph"
|
|
3450
|
+
simulation_ac_sweep_voltage_graph_id: string
|
|
3451
|
+
simulation_experiment_id: string
|
|
3452
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3453
|
+
simulation_voltage_probe_id: string
|
|
3454
|
+
frequencies_hz: number[]
|
|
3455
|
+
complex_voltages: SimulationComplexSample[]
|
|
3456
|
+
name?: string
|
|
3457
|
+
color?: string
|
|
3458
|
+
}
|
|
3459
|
+
```
|
|
3460
|
+
|
|
3461
|
+
### SimulationAnalysisResult
|
|
3462
|
+
|
|
3463
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_analysis_result.ts)
|
|
3464
|
+
|
|
3465
|
+
```typescript
|
|
3466
|
+
type SimulationAnalysisResult =
|
|
3467
|
+
| SimulationVoltageAnalysisResult
|
|
3468
|
+
| SimulationCurrentAnalysisResult
|
|
3469
|
+
|
|
3470
|
+
type SimulationNonTransientVoltageAnalysisResult =
|
|
3471
|
+
| SimulationDcOperatingPointVoltage
|
|
3472
|
+
| SimulationDcSweepVoltageGraph
|
|
3473
|
+
| SimulationAcSweepVoltageGraph
|
|
3474
|
+
|
|
3475
|
+
type SimulationNonTransientCurrentAnalysisResult =
|
|
3476
|
+
| SimulationDcOperatingPointCurrent
|
|
3477
|
+
| SimulationDcSweepCurrentGraph
|
|
3478
|
+
| SimulationAcSweepCurrentGraph
|
|
3479
|
+
|
|
3480
|
+
type SimulationVoltageAnalysisResult =
|
|
3481
|
+
| SimulationTransientVoltageGraph
|
|
3482
|
+
| SimulationNonTransientVoltageAnalysisResult
|
|
3483
|
+
|
|
3484
|
+
type SimulationCurrentAnalysisResult =
|
|
3485
|
+
| SimulationTransientCurrentGraph
|
|
3486
|
+
| SimulationNonTransientCurrentAnalysisResult
|
|
3487
|
+
```
|
|
3488
|
+
|
|
3489
|
+
### SimulationComplexSample
|
|
3490
|
+
|
|
3491
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_complex_sample.ts)
|
|
3492
|
+
|
|
3493
|
+
```typescript
|
|
3494
|
+
interface SimulationComplexSample {
|
|
3495
|
+
re: number
|
|
3496
|
+
im: number
|
|
3497
|
+
}
|
|
3498
|
+
```
|
|
3499
|
+
|
|
3415
3500
|
### SimulationCurrentProbe
|
|
3416
3501
|
|
|
3417
3502
|
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_current_probe.ts)
|
|
@@ -3453,6 +3538,8 @@ interface SimulationDcCurrentSource {
|
|
|
3453
3538
|
negative_source_port_id?: string
|
|
3454
3539
|
negative_source_net_id?: string
|
|
3455
3540
|
current: number
|
|
3541
|
+
ac_magnitude?: number
|
|
3542
|
+
ac_phase?: number
|
|
3456
3543
|
}
|
|
3457
3544
|
|
|
3458
3545
|
/** Defines an AC current source for simulation purposes. */
|
|
@@ -3470,6 +3557,80 @@ interface SimulationAcCurrentSource {
|
|
|
3470
3557
|
wave_shape?: WaveShape
|
|
3471
3558
|
phase?: number
|
|
3472
3559
|
duty_cycle?: number
|
|
3560
|
+
ac_magnitude?: number
|
|
3561
|
+
ac_phase?: number
|
|
3562
|
+
}
|
|
3563
|
+
```
|
|
3564
|
+
|
|
3565
|
+
### SimulationDcOperatingPointCurrent
|
|
3566
|
+
|
|
3567
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_dc_operating_point_current.ts)
|
|
3568
|
+
|
|
3569
|
+
```typescript
|
|
3570
|
+
interface SimulationDcOperatingPointCurrent {
|
|
3571
|
+
type: "simulation_dc_operating_point_current"
|
|
3572
|
+
simulation_dc_operating_point_current_id: string
|
|
3573
|
+
simulation_experiment_id: string
|
|
3574
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3575
|
+
simulation_current_probe_id: string
|
|
3576
|
+
current: number
|
|
3577
|
+
name?: string
|
|
3578
|
+
color?: string
|
|
3579
|
+
}
|
|
3580
|
+
```
|
|
3581
|
+
|
|
3582
|
+
### SimulationDcOperatingPointVoltage
|
|
3583
|
+
|
|
3584
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_dc_operating_point_voltage.ts)
|
|
3585
|
+
|
|
3586
|
+
```typescript
|
|
3587
|
+
interface SimulationDcOperatingPointVoltage {
|
|
3588
|
+
type: "simulation_dc_operating_point_voltage"
|
|
3589
|
+
simulation_dc_operating_point_voltage_id: string
|
|
3590
|
+
simulation_experiment_id: string
|
|
3591
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3592
|
+
simulation_voltage_probe_id: string
|
|
3593
|
+
voltage: number
|
|
3594
|
+
name?: string
|
|
3595
|
+
color?: string
|
|
3596
|
+
}
|
|
3597
|
+
```
|
|
3598
|
+
|
|
3599
|
+
### SimulationDcSweepCurrentGraph
|
|
3600
|
+
|
|
3601
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_dc_sweep_current_graph.ts)
|
|
3602
|
+
|
|
3603
|
+
```typescript
|
|
3604
|
+
interface SimulationDcSweepCurrentGraph {
|
|
3605
|
+
type: "simulation_dc_sweep_current_graph"
|
|
3606
|
+
simulation_dc_sweep_current_graph_id: string
|
|
3607
|
+
simulation_experiment_id: string
|
|
3608
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3609
|
+
simulation_current_probe_id: string
|
|
3610
|
+
sweep_values: number[]
|
|
3611
|
+
sweep_unit: SimulationDcSweepUnit
|
|
3612
|
+
current_levels: number[]
|
|
3613
|
+
name?: string
|
|
3614
|
+
color?: string
|
|
3615
|
+
}
|
|
3616
|
+
```
|
|
3617
|
+
|
|
3618
|
+
### SimulationDcSweepVoltageGraph
|
|
3619
|
+
|
|
3620
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_dc_sweep_voltage_graph.ts)
|
|
3621
|
+
|
|
3622
|
+
```typescript
|
|
3623
|
+
interface SimulationDcSweepVoltageGraph {
|
|
3624
|
+
type: "simulation_dc_sweep_voltage_graph"
|
|
3625
|
+
simulation_dc_sweep_voltage_graph_id: string
|
|
3626
|
+
simulation_experiment_id: string
|
|
3627
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3628
|
+
simulation_voltage_probe_id: string
|
|
3629
|
+
sweep_values: number[]
|
|
3630
|
+
sweep_unit: SimulationDcSweepUnit
|
|
3631
|
+
voltage_levels: number[]
|
|
3632
|
+
name?: string
|
|
3633
|
+
color?: string
|
|
3473
3634
|
}
|
|
3474
3635
|
```
|
|
3475
3636
|
|
|
@@ -3487,6 +3648,17 @@ interface SimulationExperiment {
|
|
|
3487
3648
|
start_time_ms?: number // ms
|
|
3488
3649
|
end_time_ms?: number // ms
|
|
3489
3650
|
spice_options?: SpiceSimulationOptions
|
|
3651
|
+
dc_sweep_voltage_source_id?: string
|
|
3652
|
+
dc_sweep_current_source_id?: string
|
|
3653
|
+
dc_sweep_start?: number
|
|
3654
|
+
dc_sweep_stop?: number
|
|
3655
|
+
dc_sweep_step?: number
|
|
3656
|
+
dc_sweep_unit?: "V" | "A"
|
|
3657
|
+
ac_sweep_type?: "linear" | "decade" | "octave"
|
|
3658
|
+
ac_samples_per_interval?: number
|
|
3659
|
+
ac_sample_count?: number
|
|
3660
|
+
ac_start_frequency_hz?: number
|
|
3661
|
+
ac_stop_frequency_hz?: number
|
|
3490
3662
|
}
|
|
3491
3663
|
|
|
3492
3664
|
interface SpiceSimulationOptions {
|
|
@@ -3545,6 +3717,60 @@ interface SimulationOscilloscopeTrace {
|
|
|
3545
3717
|
}
|
|
3546
3718
|
```
|
|
3547
3719
|
|
|
3720
|
+
### SimulationParameterSweep
|
|
3721
|
+
|
|
3722
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_parameter_sweep.ts)
|
|
3723
|
+
|
|
3724
|
+
```typescript
|
|
3725
|
+
type SimulationParameterSweep =
|
|
3726
|
+
| SimulationResistanceParameterSweep
|
|
3727
|
+
| SimulationCapacitanceParameterSweep
|
|
3728
|
+
| SimulationInductanceParameterSweep
|
|
3729
|
+
| SimulationVoltageParameterSweep
|
|
3730
|
+
| SimulationCurrentParameterSweep
|
|
3731
|
+
|
|
3732
|
+
interface SimulationResistanceParameterSweep
|
|
3733
|
+
extends SimulationParameterSweepBase {
|
|
3734
|
+
parameter_type: "resistance"
|
|
3735
|
+
resistor_source_component_id: string
|
|
3736
|
+
}
|
|
3737
|
+
|
|
3738
|
+
interface SimulationCapacitanceParameterSweep
|
|
3739
|
+
extends SimulationParameterSweepBase {
|
|
3740
|
+
parameter_type: "capacitance"
|
|
3741
|
+
capacitor_source_component_id: string
|
|
3742
|
+
}
|
|
3743
|
+
|
|
3744
|
+
interface SimulationInductanceParameterSweep
|
|
3745
|
+
extends SimulationParameterSweepBase {
|
|
3746
|
+
parameter_type: "inductance"
|
|
3747
|
+
inductor_source_component_id: string
|
|
3748
|
+
}
|
|
3749
|
+
|
|
3750
|
+
interface SimulationVoltageParameterSweep extends SimulationParameterSweepBase {
|
|
3751
|
+
parameter_type: "voltage"
|
|
3752
|
+
source_net_id: string
|
|
3753
|
+
}
|
|
3754
|
+
|
|
3755
|
+
interface SimulationCurrentParameterSweep extends SimulationParameterSweepBase {
|
|
3756
|
+
parameter_type: "current"
|
|
3757
|
+
current_source_component_id: string
|
|
3758
|
+
}
|
|
3759
|
+
```
|
|
3760
|
+
|
|
3761
|
+
### SimulationParameterSweepCoordinate
|
|
3762
|
+
|
|
3763
|
+
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_parameter_sweep_coordinate.ts)
|
|
3764
|
+
|
|
3765
|
+
```typescript
|
|
3766
|
+
interface SimulationParameterSweepCoordinate {
|
|
3767
|
+
simulation_parameter_sweep_id: string
|
|
3768
|
+
sweep_index: number
|
|
3769
|
+
parameter_value: number
|
|
3770
|
+
parameter_unit: SimulationParameterUnit
|
|
3771
|
+
}
|
|
3772
|
+
```
|
|
3773
|
+
|
|
3548
3774
|
### SimulationSpiceSubcircuit
|
|
3549
3775
|
|
|
3550
3776
|
[Source](https://github.com/tscircuit/circuit-json/blob/main/src/simulation/simulation_spice_subcircuit.ts)
|
|
@@ -3593,6 +3819,7 @@ interface SimulationTransientCurrentGraph {
|
|
|
3593
3819
|
type: "simulation_transient_current_graph"
|
|
3594
3820
|
simulation_transient_current_graph_id: string
|
|
3595
3821
|
simulation_experiment_id: string
|
|
3822
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3596
3823
|
timestamps_ms?: number[]
|
|
3597
3824
|
current_levels: number[]
|
|
3598
3825
|
source_component_id?: string
|
|
@@ -3614,6 +3841,7 @@ interface SimulationTransientVoltageGraph {
|
|
|
3614
3841
|
type: "simulation_transient_voltage_graph"
|
|
3615
3842
|
simulation_transient_voltage_graph_id: string
|
|
3616
3843
|
simulation_experiment_id: string
|
|
3844
|
+
simulation_parameter_sweep_coordinate?: SimulationParameterSweepCoordinate
|
|
3617
3845
|
timestamps_ms?: number[]
|
|
3618
3846
|
voltage_levels: number[]
|
|
3619
3847
|
source_component_id?: string
|
|
@@ -3685,6 +3913,8 @@ interface SimulationDcVoltageSource {
|
|
|
3685
3913
|
negative_source_port_id?: string
|
|
3686
3914
|
negative_source_net_id?: string
|
|
3687
3915
|
voltage: number
|
|
3916
|
+
ac_magnitude?: number
|
|
3917
|
+
ac_phase?: number
|
|
3688
3918
|
}
|
|
3689
3919
|
|
|
3690
3920
|
/** Defines an AC voltage source for simulation purposes. */
|
|
@@ -3707,6 +3937,8 @@ interface SimulationAcVoltageSource {
|
|
|
3707
3937
|
fall_time?: number // ms
|
|
3708
3938
|
pulse_width?: number // ms
|
|
3709
3939
|
period?: number // ms
|
|
3940
|
+
ac_magnitude?: number
|
|
3941
|
+
ac_phase?: number
|
|
3710
3942
|
}
|
|
3711
3943
|
```
|
|
3712
3944
|
|