├── documentation ├── RC.png ├── i1r3.png ├── v1d1.png ├── v1r4.png ├── i1v1r6.png ├── v2nmos1.png ├── DCDriver.png ├── CMOSInverter.png ├── DCSweepV1D1.png ├── DCSweepV1R4.png ├── NMOS_Model.png ├── PMOS_Model.png ├── PulseDriver.png ├── SineDriver.png ├── SquareDriver.png ├── Trans_MMSS.png ├── Trans_RSMem.png ├── DCSweepV2NMOS1.png ├── DCSweepV2PMOS1.png ├── PN_Diode_Model.png ├── SawtoothDriver.png ├── TriangleDriver.png ├── cmos-inverter.png ├── rc-time-domain.png ├── ArbitraryDriver.png ├── Capacitor_Model.png ├── InverterRegions.png ├── SPICE_flow_chart.png ├── Trans_Pass_Gate.png ├── transmission-gate.png ├── ArbitraryStreaming.png ├── CMOS_Inverter_Trans.png ├── Half_Wave_Rectifier.png ├── DCSweepCMOS_Inverter10.png ├── DCSweepCMOS_Inverter25.png ├── DCSweepCMOSInverter_Vt15.png ├── DCSweepCMOSInverter_Vt25.png └── diode-half-wave-rectifier.png ├── src ├── test │ ├── resources │ │ ├── 2-1_kTSynapse.sub │ │ ├── dcopi1r1.yml │ │ ├── RH-kTSynapse-netlist.cir │ │ ├── RL-kTSynapse-netlist.cir │ │ ├── DCSweepI1R1.yml │ │ ├── knowm_mr_netlist.cir │ │ ├── knowm_mem1_sine.cir │ │ ├── FF-kTSynapse-netlist.cir │ │ ├── knowm_mem1_sine_model.cir │ │ ├── FFXX-kTSynapse-netlist.cir │ │ ├── RSMem.yml │ │ ├── ahah2-1_pulse_netlist.cir │ │ ├── knowm_mem1R1_neg_pulse_netlist.cir │ │ ├── knowm_mem1R1_pulse_netlist.cir │ │ ├── knowm_mem1R1_pulse_netlist_2us.cir │ │ ├── Knowm_AHaH_Nodes.lib │ │ └── Knowm_AHaH_Nodes.txt │ └── java │ │ └── org │ │ └── knowm │ │ └── jspice │ │ ├── issues │ │ └── TestForIssue33.java │ │ ├── memristor │ │ ├── DCOPV1Mem1.java │ │ ├── V1RSMemristor1.java │ │ ├── V1JoglekarMemristor1.java │ │ ├── TransientAnalysisV1MSSMem1.java │ │ ├── TransientAnalysisV1MSSMem1D1.java │ │ ├── TransientAnalysisV1MSSMem1D2.java │ │ ├── TransientAnalysisV1MMSSMem1.java │ │ └── TransientAnalysisV1JoglekarMem1.java │ │ ├── dcop │ │ ├── DCOPI1D1.java │ │ ├── DCOPI1R4.java │ │ ├── DCOPI2R4.java │ │ ├── DCOPI2R6.java │ │ ├── DCOPV1D1.java │ │ ├── DCOPV1R1.java │ │ ├── DCOPV1R3.java │ │ ├── DCOPV1R4.java │ │ ├── DCOPV2R4.java │ │ ├── DCOPV2R5.java │ │ ├── DCOPV2R6.java │ │ ├── DCOPI1R2D1.java │ │ ├── DCOPI1V1R6.java │ │ ├── DCOPV1R1C1.java │ │ ├── DCOPV1R1L1.java │ │ ├── DCOPV2NMOS1.java │ │ ├── DCOPV2PMOS1.java │ │ ├── DCOPI1IAR1R2.java │ │ ├── DCOPI1VAR1R2.java │ │ ├── DCOPIntegrator.java │ │ ├── DCOPV1R2VCCS1.java │ │ ├── DCOP_NMOSInverter.java │ │ ├── DCOP_PMOSInverter.java │ │ ├── DCOP_VoltageKeeper.java │ │ ├── DCOP_CMOSInverter.java │ │ ├── DCOP_HalfWaveRectifier.java │ │ ├── DCOP_TriStateInverter.java │ │ └── DCOPI1R3.java │ │ ├── dcsweep │ │ ├── DCSweepV1D1.java │ │ ├── DCSweepV1R4.java │ │ ├── DCSweepI1V1R6.java │ │ ├── DCSweepI1R2D1.java │ │ ├── DCSweepV1R1C1.java │ │ ├── DCSweepV1R2VCCS1.java │ │ ├── DCSweepV1Mem1.java │ │ ├── DCSweepCMOSBuffer.java │ │ ├── DCSweepNMOSInverter.java │ │ ├── DCSweepVoltageKeeper.java │ │ ├── DCSweepCMOSInverter.java │ │ ├── DCSweepHalfWaveRectifier.java │ │ ├── DCSweepTriStateInverter.java │ │ ├── DCSweepPMOSInverter.java │ │ └── DCSweepI1R1.java │ │ ├── circuits │ │ ├── I1D1.java │ │ ├── V1D1.java │ │ ├── I1R1.java │ │ ├── V2NMOS1.java │ │ ├── V1R1.java │ │ ├── V2PMOS1.java │ │ ├── V2NMOS1SubThreshold.java │ │ ├── V1R1L1.java │ │ ├── I1R3.java │ │ ├── V1R3.java │ │ ├── I1R2D1.java │ │ ├── V1R2VCCS1.java │ │ ├── I1R4.java │ │ ├── V1R4.java │ │ ├── I1IAR1R2.java │ │ ├── I1VAR1R2.java │ │ ├── Integrator.java │ │ ├── NMOSInverter.java │ │ ├── PMOSInverter.java │ │ ├── TransmissionGateCircuit.java │ │ ├── I2R4.java │ │ ├── V2R4.java │ │ ├── V1R1C1.java │ │ ├── HalfWaveRectifier.java │ │ ├── V2R5.java │ │ ├── VoltageKeeper.java │ │ ├── I2R6.java │ │ └── V2R6.java │ │ └── transientanalysis │ │ ├── driver │ │ └── TestDrivers.java │ │ ├── TransientAnalysisV1R8C8.java │ │ ├── TransientAnalysisV1R1C1.java │ │ ├── TransientAnalysisV1R1L1.java │ │ ├── TransientAnalysisCMOSInverter.java │ │ ├── TransientAnalysisBusKeeper.java │ │ ├── TransientAnalysisHalfWaveRectifier.java │ │ ├── TransientAnalysisTriStateInverter0.java │ │ └── TransientAnalysisIntegrator.java └── main │ ├── java │ └── org │ │ └── knowm │ │ └── jspice │ │ ├── netlist │ │ ├── spice │ │ │ ├── SPICESubckt.java │ │ │ └── PeekableScanner.java │ │ ├── NetlistMemristor.java │ │ ├── NetlistDCCurrentArbitrary.java │ │ ├── NetlistDCVoltageArbitrary.java │ │ ├── NetlistVCVS.java │ │ ├── NetlistNMOS.java │ │ ├── NetlistPMOS.java │ │ ├── NetlistDCCurrent.java │ │ ├── NetlistDCVoltage.java │ │ ├── NetlistResistor.java │ │ ├── NetlistInductor.java │ │ └── NetlistVCCS.java │ │ ├── component │ │ ├── NonlinearComponent.java │ │ ├── source │ │ │ └── Source.java │ │ ├── Sweepable.java │ │ └── element │ │ │ ├── linear │ │ │ └── LinearElement.java │ │ │ ├── nonlinear │ │ │ ├── NMOS.java │ │ │ └── PMOS.java │ │ │ └── reactive │ │ │ └── ReactiveElement.java │ │ ├── simulate │ │ ├── dcoperatingpoint │ │ │ ├── DCOPConfig.java │ │ │ └── NodalAnalysisConvergenceException.java │ │ ├── SimulationPreCheck.java │ │ ├── transientanalysis │ │ │ └── driver │ │ │ │ ├── DC.java │ │ │ │ └── Sine.java │ │ ├── SimulationPlotData.java │ │ └── SimulationConfig.java │ │ └── circuit │ │ ├── SubCircuit.java │ │ └── subcircuit │ │ ├── CMOSInverter.java │ │ ├── TransmissionGate.java │ │ └── Buffer.java │ └── resources │ └── simplelogger.properties ├── .gitignore ├── LICENSE └── .travis.yml /documentation/RC.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/RC.png -------------------------------------------------------------------------------- /documentation/i1r3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/i1r3.png -------------------------------------------------------------------------------- /documentation/v1d1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/v1d1.png -------------------------------------------------------------------------------- /documentation/v1r4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/v1r4.png -------------------------------------------------------------------------------- /documentation/i1v1r6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/i1v1r6.png -------------------------------------------------------------------------------- /documentation/v2nmos1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/v2nmos1.png -------------------------------------------------------------------------------- /documentation/DCDriver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/DCDriver.png -------------------------------------------------------------------------------- /documentation/CMOSInverter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/CMOSInverter.png -------------------------------------------------------------------------------- /documentation/DCSweepV1D1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/DCSweepV1D1.png -------------------------------------------------------------------------------- /documentation/DCSweepV1R4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/DCSweepV1R4.png -------------------------------------------------------------------------------- /documentation/NMOS_Model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/NMOS_Model.png -------------------------------------------------------------------------------- /documentation/PMOS_Model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/PMOS_Model.png -------------------------------------------------------------------------------- /documentation/PulseDriver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/PulseDriver.png -------------------------------------------------------------------------------- /documentation/SineDriver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/SineDriver.png -------------------------------------------------------------------------------- /documentation/SquareDriver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/SquareDriver.png -------------------------------------------------------------------------------- /documentation/Trans_MMSS.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/Trans_MMSS.png -------------------------------------------------------------------------------- /documentation/Trans_RSMem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/Trans_RSMem.png -------------------------------------------------------------------------------- /documentation/DCSweepV2NMOS1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/DCSweepV2NMOS1.png -------------------------------------------------------------------------------- /documentation/DCSweepV2PMOS1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/DCSweepV2PMOS1.png -------------------------------------------------------------------------------- /documentation/PN_Diode_Model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/PN_Diode_Model.png -------------------------------------------------------------------------------- /documentation/SawtoothDriver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/SawtoothDriver.png -------------------------------------------------------------------------------- /documentation/TriangleDriver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/TriangleDriver.png -------------------------------------------------------------------------------- /documentation/cmos-inverter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/cmos-inverter.png -------------------------------------------------------------------------------- /documentation/rc-time-domain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/rc-time-domain.png -------------------------------------------------------------------------------- /documentation/ArbitraryDriver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/ArbitraryDriver.png -------------------------------------------------------------------------------- /documentation/Capacitor_Model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/Capacitor_Model.png -------------------------------------------------------------------------------- /documentation/InverterRegions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/InverterRegions.png -------------------------------------------------------------------------------- /documentation/SPICE_flow_chart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/SPICE_flow_chart.png -------------------------------------------------------------------------------- /documentation/Trans_Pass_Gate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/Trans_Pass_Gate.png -------------------------------------------------------------------------------- /documentation/transmission-gate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/transmission-gate.png -------------------------------------------------------------------------------- /documentation/ArbitraryStreaming.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/ArbitraryStreaming.png -------------------------------------------------------------------------------- /documentation/CMOS_Inverter_Trans.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/CMOS_Inverter_Trans.png -------------------------------------------------------------------------------- /documentation/Half_Wave_Rectifier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/Half_Wave_Rectifier.png -------------------------------------------------------------------------------- /documentation/DCSweepCMOS_Inverter10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/DCSweepCMOS_Inverter10.png -------------------------------------------------------------------------------- /documentation/DCSweepCMOS_Inverter25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/DCSweepCMOS_Inverter25.png -------------------------------------------------------------------------------- /documentation/DCSweepCMOSInverter_Vt15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/DCSweepCMOSInverter_Vt15.png -------------------------------------------------------------------------------- /documentation/DCSweepCMOSInverter_Vt25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/DCSweepCMOSInverter_Vt25.png -------------------------------------------------------------------------------- /documentation/diode-half-wave-rectifier.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/knowm/jspice/HEAD/documentation/diode-half-wave-rectifier.png -------------------------------------------------------------------------------- /src/test/resources/2-1_kTSynapse.sub: -------------------------------------------------------------------------------- 1 | .subckt kTSynapse2-1 A B y 2 | YMEMRISTOR MR1 A y MRM5 3 | YMEMRISTOR MR2 y B MRM5 4 | .ends kTSynapse2-1 5 | 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | javadoc/ 3 | bin/ 4 | .classpath 5 | .project 6 | .settings/ 7 | .DS_Store 8 | .idea/ 9 | *.iml 10 | dependency-reduced-pom.xml 11 | *.out 12 | -------------------------------------------------------------------------------- /src/test/resources/dcopi1r1.yml: -------------------------------------------------------------------------------- 1 | components: 2 | - type: dc_current 3 | nodes: 1,0 4 | id: a 5 | current: 1.0 6 | - type: resistor 7 | nodes: 0,1 8 | id: R1 9 | resistance: 1000.0 10 | sim: 11 | type: dcop -------------------------------------------------------------------------------- /src/test/resources/RH-kTSynapse-netlist.cir: -------------------------------------------------------------------------------- 1 | 2 | 3 | VY y 0 DC 0 PULSE(0 -.5 0 0 0 1 2) AC 0 4 | 5 | YMEMRISTOR MB y 0 MB 6 | 7 | .model MB memristor ( level=5 8 | + Roff=5000 Ron=500 9 | + Voff=0.27 Von=0.27 10 | + Tau=0.0001 Rinit=${R_B} ) 11 | 12 | .tran 2us 10us 13 | 14 | .END 15 | -------------------------------------------------------------------------------- /src/test/resources/RL-kTSynapse-netlist.cir: -------------------------------------------------------------------------------- 1 | 2 | 3 | VA A 0 DC 0 PULSE(0 -.5 0 0 0 1 2) AC 0 4 | 5 | YMEMRISTOR MA A 0 MA 6 | 7 | .model MA memristor ( level=5 8 | + Roff=5000 Ron=500 9 | + Voff=0.27 Von=0.27 10 | + Tau=0.0001 Rinit=${R_A} ) 11 | 12 | .tran 2us 10us 13 | 14 | .END 15 | 16 | -------------------------------------------------------------------------------- /src/test/resources/DCSweepI1R1.yml: -------------------------------------------------------------------------------- 1 | components: 2 | - type: dc_current 3 | nodes: 1,0 4 | id: a 5 | current: 1.0 6 | - type: resistor 7 | nodes: 0,1 8 | id: R1 9 | resistance: 1000.0 10 | sim: 11 | type: sweep 12 | sweep_id: a 13 | observe_id: I(R1) 14 | start_value: 0.0 15 | end_value: 10.0 16 | step_size: 1.0 -------------------------------------------------------------------------------- /src/test/resources/knowm_mr_netlist.cir: -------------------------------------------------------------------------------- 1 | * Qucs 0.0.19 /Users/marendall/.qucs/Ymemristor_prj/knowm_mr_test.sch 2 | VPr1 _net0 Vmr DC 0 3 | 4 | V1 _net0 0 DC 0 SIN(0 500M 10 0 0) AC 500M 5 | YMEMRISTOR MR1 Vmr 0 MRM5 6 | .model MRM5 memristor ( level=5 Rinit=1500 Roff=1500 Ron=500 Voff=0.27 Von=0.27 Tau=0.0001 ) 7 | .tran 0.0049505 0.5 0 8 | .PRINT tran format=raw file=knowm_mr_test_tran.txt I(VPr1) v(Vmr) 9 | .END 10 | -------------------------------------------------------------------------------- /src/test/resources/knowm_mem1_sine.cir: -------------------------------------------------------------------------------- 1 | * Qucs 0.0.19 /Users/marendall/.qucs/Ymemristor_prj/knowm_mr_test.sch 2 | VPr1 _net0 Vmr DC 0 3 | 4 | V1 _net0 0 DC 0 SIN(0 500M 10 0 0) AC 500M 5 | YMEMRISTOR MR1 Vmr 0 MRM5 6 | .model MRM5 memristor ( level=5 Rinit=1500 Roff=1500 Ron=500 Voff=0.27 Von=0.27 Tau=0.0001 ) 7 | 8 | .tran 0.0049505 0.5 0 9 | .PRINT tran format=raw file=knowm_mr_test_tran.txt I(VPr1) v(Vmr) 10 | .END 11 | -------------------------------------------------------------------------------- /src/test/resources/FF-kTSynapse-netlist.cir: -------------------------------------------------------------------------------- 1 | 2 | 3 | VA A 0 DC 0 PULSE(0 1 0 0 0 1 2) AC 0 4 | 5 | YMEMRISTOR MA A y MA 6 | YMEMRISTOR MB y 0 MB 7 | 8 | .model MA memristor ( level=5 9 | + Roff=5000 Ron=500 10 | + Voff=0.27 Von=0.27 11 | + Tau=0.0001 Rinit=${R_A} ) 12 | 13 | .model MB memristor ( level=5 14 | + Roff=5000 Ron=500 15 | + Voff=0.27 Von=0.27 16 | + Tau=0.0001 Rinit=${R_B} ) 17 | 18 | .tran 2us 10us 19 | 20 | .END 21 | -------------------------------------------------------------------------------- /src/test/resources/knowm_mem1_sine_model.cir: -------------------------------------------------------------------------------- 1 | * Qucs 0.0.19 /Users/marendall/.qucs/Ymemristor_prj/knowm_mr_test.sch 2 | VPr1 _net0 Vmr DC 0 3 | 4 | V1 _net0 0 DC 0 SIN(0 500M 10 0 0) AC 500M 5 | YMEMRISTOR MR1 Vmr 0 MRM5 6 | .model MRM5 memristor ( level=5 Rinit=1500 7 | + Roff=1500 Ron=500 Voff=0.27 8 | + Von=0.27 Tau=0.0001 Rinit=500 ) 9 | 10 | .tran 0.0049505 0.5 0 11 | .PRINT tran format=raw file=knowm_mr_test_tran.txt I(VPr1) v(Vmr) 12 | .END 13 | -------------------------------------------------------------------------------- /src/test/resources/FFXX-kTSynapse-netlist.cir: -------------------------------------------------------------------------------- 1 | .INCLUDE "2-1_kTSynapse.sub" 2 | 3 | VA A 0 DC 0 PULSE(0 .5 0 0 0 5u 10u) AC 0 4 | VB B 0 DC 0 PULSE(0 -.5 0 0 0 5u 10u) AC 0 5 | 6 | XX1 A B y kTSynapse2-1 7 | 8 | .model MRM5 memristor ( level=5 9 | + Rinit=1000 Roff=1500 Ron=500 10 | + Voff=0.27 Von=0.27 11 | + Tau=0.0001 Rinit=1000 ) 12 | 13 | .tran 500ns 1000us 1e-09 14 | 15 | .PRINT tran format=raw file=AHaH2-1_pulse_test_tran.txt I(VPr1) v(Vin) v(Vmr) v(Vout) 16 | .END 17 | -------------------------------------------------------------------------------- /src/test/resources/RSMem.yml: -------------------------------------------------------------------------------- 1 | components: 2 | - type: dc_voltage 3 | nodes: VDD,0 4 | id: Vdd 5 | voltage: 1.0 6 | - type: rs_mem 7 | nodes: VDD,0 8 | id: M1 9 | schottky_forward_alpha: 0.0 10 | schottky_forward_beta: 0.0 11 | schottky_reverse_alpha: 0.0 12 | schottky_reverse_beta: 0.0 13 | phi: 1.0 14 | sim: 15 | type: trans 16 | stop_time: 0.001 17 | time_step: 1.0E-5 18 | drivers: 19 | - type: sine 20 | id: Vdd 21 | dc_offset: 0.0 22 | phase: 0.0 23 | amplitude: 1.2 24 | frequency: 2000.0 -------------------------------------------------------------------------------- /src/test/resources/ahah2-1_pulse_netlist.cir: -------------------------------------------------------------------------------- 1 | * Qucs 0.0.19 /Users/marendall/.qucs/AHaH_kT-Synapse_prj/AHaH2-1_pulse_test.sch 2 | .INCLUDE "Knowm_AHaH_Nodes.txt" 3 | VPr1 Vin Vmr DC 0 4 | 5 | V1 Vin 0 DC 0 PULSE(0 1 0.01 1N 1N 0.09 9e+07) AC 0 6 | R1 0 Vout 50 7 | XX1 Vmr 0 Vout AHAH2-1 8 | .model MRM5 memristor ( level=5 9 | + Roff=1500 Ron=500 10 | + Voff=0.27 Von=0.27 11 | + Tau=0.0001 Rinit=1000 ) 12 | .tran 0.00148515 0.15 1e-09 13 | .PRINT tran format=raw file=AHaH2-1_pulse_test_tran.txt I(VPr1) v(Vin) v(Vmr) v(Vout) 14 | .END -------------------------------------------------------------------------------- /src/test/resources/knowm_mem1R1_neg_pulse_netlist.cir: -------------------------------------------------------------------------------- 1 | * Qucs 0.0.19 /Users/marendall/.qucs/KnowmMemristor_prj/knowm_mr_pulse.sch 2 | VPr1 Vin Vmr DC 0 3 | R1 0 Vout 500 4 | 5 | YMEMRISTOR MR1 Vmr Vout MRM5 6 | V1 Vin 0 DC 0 PULSE( 0 -1 0N 0N 0N 1e-05 3e-05) AC 0 7 | .model MRM5 memristor ( level=5 Rinit=1500 8 | + Roff=1500 Ron=500 Voff=0.27 Von=0.27 9 | + Tau=0.0001 Phi=1.0 10 | + Sfa=0.0 Sfb=0.0 Sra=0.0 Srb=0.0 Rinit=500 ) 11 | 12 | .STEP V1:V2 LIST 0.25 0.5 0.75 1.0 13 | .tran 1us 50us 14 | .PRINT tran format=raw file=knowm_mr_pulse_tran.txt I(VPr1) v(Vin) v(Vmr) v(Vout) 15 | .END 16 | -------------------------------------------------------------------------------- /src/test/resources/knowm_mem1R1_pulse_netlist.cir: -------------------------------------------------------------------------------- 1 | * Qucs 0.0.19 /Users/marendall/.qucs/KnowmMemristor_prj/knowm_mr_pulse.sch 2 | VPr1 Vin Vmr DC 0 3 | R1 0 Vout 500 4 | 5 | YMEMRISTOR MR1 Vmr Vout MRM5 6 | V1 Vin 0 DC 0 PULSE( 2 0 0N 1N 1N 5e-06 1.0002e-05) AC 0 7 | .model MRM5 memristor ( level=5 Rinit=1500 8 | + Roff=1500 Ron=500 Voff=0.27 Von=0.27 9 | + Tau=0.0001 Phi=1.0 10 | + Sfa=0.0 Sfb=0.0 Sra=0.0 Srb=0.0 Rinit=500 ) 11 | 12 | .STEP V1:V2 LIST 0.25 0.5 0.75 1.0 13 | .tran 1us 50us 14 | .PRINT tran format=raw file=knowm_mr_pulse_tran.txt I(VPr1) v(Vin) v(Vmr) v(Vout) 15 | .END 16 | -------------------------------------------------------------------------------- /src/test/resources/knowm_mem1R1_pulse_netlist_2us.cir: -------------------------------------------------------------------------------- 1 | * Qucs 0.0.19 /Users/marendall/.qucs/KnowmMemristor_prj/knowm_mr_pulse.sch 2 | VPr1 Vin Vmr DC 0 3 | R1 0 Vout 500 4 | 5 | YMEMRISTOR MR1 Vmr Vout MRM5 6 | V1 Vin 0 DC 0 PULSE( 0 2 0N 0N 0N 2e-06 4e-06) AC 0 7 | .model MRM5 memristor ( level=5 Rinit=1500 8 | + Roff=1500 Ron=500 Voff=0.27 Von=0.27 9 | + Tau=0.0001 Phi=1.0 10 | + Sfa=0.0 Sfb=0.0 Sra=0.0 Srb=0.0 Rinit=500 ) 11 | 12 | .STEP V1:V2 LIST 0.25 0.5 0.75 1.0 13 | .tran 1us 50us 14 | .PRINT tran format=raw file=knowm_mr_pulse_tran.txt I(VPr1) v(Vin) v(Vmr) v(Vout) 15 | .END 16 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/issues/TestForIssue33.java: -------------------------------------------------------------------------------- 1 | package org.knowm.jspice.issues; 2 | 3 | import org.knowm.jspice.JSpice; 4 | import org.knowm.jspice.netlist.NetlistBuilder; 5 | 6 | public class TestForIssue33 { 7 | 8 | public static void main(String[] args) { 9 | 10 | NetlistBuilder generated = new NetlistBuilder() 11 | .addNetlistResistor("g1", 0, "c1", "0") 12 | .addNetlistResistor("g2", 0, "c2", "0") 13 | .addNetlistResistor("r1", 10, "c2", "c3") 14 | .addNetlistDCVoltage("b", 9.0, "c3", "c1")//<-- specifically this component id 15 | .addDCOPSimulationConfig(); 16 | System.out.println(generated.build()); 17 | JSpice.simulate(generated.build()); 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | jspice is distributed under the GNU General Public License version 3 2 | and is also available under alternative licenses negotiated directly 3 | with Knowm, Inc. 4 | 5 | Copyright (c) 2016-2019 Knowm Inc. www.knowm.org 6 | 7 | Knowm, Inc. holds copyright 8 | and/or sufficient licenses to all components of the jspice 9 | package, and therefore can grant, at its sole discretion, the ability 10 | for companies, individuals, or organizations to create proprietary or 11 | open source (even if not GPL) modules which may be dynamically linked at 12 | runtime with the portions of jspice which fall under our 13 | copyright/license umbrella, or are distributed under more flexible 14 | licenses than GPL. 15 | 16 | The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 17 | 18 | If you have any questions regarding our licensing policy, please 19 | contact us at `contact@knowm.org`. 20 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/netlist/spice/SPICESubckt.java: -------------------------------------------------------------------------------- 1 | package org.knowm.jspice.netlist.spice; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Arrays; 5 | import java.util.List; 6 | 7 | class SPICESubckt { 8 | 9 | private String id; 10 | private List nodes = new ArrayList<>(); 11 | private List lines = new ArrayList<>(); 12 | 13 | public void setId(String id) { 14 | this.id = id; 15 | } 16 | 17 | public void addNode(String node) { 18 | this.nodes.add(node); 19 | } 20 | 21 | public void addLine(String line) { 22 | this.lines.add(line); 23 | } 24 | 25 | public String getId() { 26 | return id; 27 | } 28 | 29 | public List getNodes() { 30 | return nodes; 31 | } 32 | 33 | public List getLines() { 34 | return lines; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | return "SPICESubckt{" + "id='" + id + '\'' + ", nodes=" + Arrays.toString(nodes.toArray()) + ", lines=" + Arrays.toString(lines.toArray()) + '}'; 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/netlist/spice/PeekableScanner.java: -------------------------------------------------------------------------------- 1 | package org.knowm.jspice.netlist.spice; 2 | 3 | import java.io.Closeable; 4 | import java.io.IOException; 5 | import java.io.InputStream; 6 | import java.util.Scanner; 7 | 8 | /** 9 | * Specialized class allowing peeking for a Scanner 10 | */ 11 | class PeekableScanner implements Closeable { 12 | 13 | private Scanner scanner; 14 | private String nextLine; 15 | 16 | public PeekableScanner(InputStream source) { 17 | 18 | // System.out.println("source = " + source); 19 | scanner = new Scanner(source); 20 | nextLine = (scanner.hasNext() ? scanner.nextLine().trim() : null); 21 | } 22 | 23 | public boolean hasNext() { 24 | return (nextLine != null); 25 | } 26 | 27 | public String nextLine() { 28 | String current = nextLine; 29 | nextLine = (scanner.hasNext() ? scanner.nextLine().trim() : null); 30 | return current; 31 | } 32 | 33 | public String peek() { 34 | return nextLine; 35 | } 36 | 37 | @Override 38 | public void close() throws IOException { 39 | scanner.close(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/component/NonlinearComponent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.component; 23 | 24 | /** 25 | * @author timmolter 26 | */ 27 | public interface NonlinearComponent { 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/simulate/dcoperatingpoint/DCOPConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.simulate.dcoperatingpoint; 23 | 24 | import org.knowm.jspice.simulate.SimulationConfig; 25 | 26 | public class DCOPConfig extends SimulationConfig { 27 | 28 | // no special config needed. 29 | } -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/component/source/Source.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.component.source; 23 | 24 | import org.knowm.jspice.component.Component; 25 | 26 | /** 27 | * @author timmolter 28 | */ 29 | public abstract class Source extends Component { 30 | 31 | public Source(String id) { 32 | 33 | super(id); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/component/Sweepable.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.component; 23 | 24 | import com.fasterxml.jackson.annotation.JsonIgnore; 25 | 26 | /** 27 | * @author timmolter 28 | */ 29 | public interface Sweepable { 30 | 31 | void setSweepValue(double value); 32 | 33 | @JsonIgnore 34 | double getSweepableValue(); 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/netlist/NetlistMemristor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.netlist; 23 | 24 | import org.knowm.jspice.component.element.memristor.Memristor; 25 | 26 | public class NetlistMemristor extends NetlistComponent { 27 | 28 | public NetlistMemristor(Memristor memristor, String... nodes) { 29 | 30 | super(memristor, nodes); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/component/element/linear/LinearElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.component.element.linear; 23 | 24 | import org.knowm.jspice.component.Component; 25 | 26 | /** 27 | * @author timmolter 28 | */ 29 | public abstract class LinearElement extends Component { 30 | 31 | public LinearElement(String id) { 32 | 33 | super(id); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/memristor/DCOPV1Mem1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.memristor; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.netlist.Netlist; 26 | 27 | public class DCOPV1Mem1 { 28 | 29 | public static void main(String[] args) { 30 | 31 | Netlist netlist = new V1MSSMemristor1(); 32 | JSpice.simulate(netlist); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/test/resources/Knowm_AHaH_Nodes.lib: -------------------------------------------------------------------------------- 1 | * Knowm AHaH memristor-based node models: experimental behavioural models. 2 | * Developed for Xyce/Qucs-S. 3 | * 4 | * 5 | * This is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * Copyright Michael Arendall Jan. 2017 miche.arendall@gmail.com 11 | * 12 | * *********************************************************************************** 13 | .subckt AHAH2-1 nin1 nin2 nout 14 | YMEMRISTOR MR1 nin1 nout MRM5 15 | YMEMRISTOR MR2 nout nin2 MRM5 16 | .ends AHAH2-1 17 | ************************************************************************************* 18 | .subckt AHAH2-1i nin1 nin2 nout 19 | YMEMRISTOR MR1 nout nin1 MRM5 20 | YMEMRISTOR MR2 nin2 nout MRM5 21 | .ends AHAH2-1i 22 | ************************************************************************************* 23 | .subckt AHAH1-2 nin nout1 nout2 24 | YMEMRISTOR MR1 nin nout1 MRM5 25 | YMEMRISTOR MR2 nin nout2 MRM5 26 | .ends AHAH1-2 27 | ************************************************************************************* 28 | .subckt AHAH1-2i nin nout1 nout2 29 | YMEMRISTOR MR1 nout1 nin MRM5 30 | YMEMRISTOR MR2 nout2 nin MRM5 31 | .ends AHAH1-2i 32 | -------------------------------------------------------------------------------- /src/test/resources/Knowm_AHaH_Nodes.txt: -------------------------------------------------------------------------------- 1 | * Knowm AHaH memristor-based node models: experimental behavioural models. 2 | * Developed for Xyce/Qucs-S. 3 | * 4 | * 5 | * This is free software; you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation; either version 2, or (at your option) 8 | * any later version. 9 | * 10 | * Copyright Michael Arendall Jan. 2017 miche.arendall@gmail.com 11 | * 12 | * *********************************************************************************** 13 | .subckt AHAH2-1 nin1 nin2 nout 14 | YMEMRISTOR MR1 nin1 nout MRM5 15 | YMEMRISTOR MR2 nout nin2 MRM5 16 | .ends AHAH2-1 17 | ************************************************************************************* 18 | .subckt AHAH2-1i nin1 nin2 nout 19 | YMEMRISTOR MR1 nout nin1 MRM5 20 | YMEMRISTOR MR2 nin2 nout MRM5 21 | .ends AHAH2-1i 22 | ************************************************************************************* 23 | .subckt AHAH1-2 nin nout1 nout2 24 | YMEMRISTOR MR1 nin nout1 MRM5 25 | YMEMRISTOR MR2 nin nout2 MRM5 26 | .ends AHAH1-2 27 | ************************************************************************************* 28 | .subckt AHAH1-2i nin nout1 nout2 29 | YMEMRISTOR MR1 nout1 nin MRM5 30 | YMEMRISTOR MR2 nout2 nin MRM5 31 | .ends AHAH1-2i 32 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/component/element/nonlinear/NMOS.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.component.element.nonlinear; 23 | 24 | /** 25 | * @author timmolter 26 | */ 27 | public class NMOS extends MOSFET { 28 | 29 | /** 30 | * Constructor 31 | * 32 | * @param id 33 | */ 34 | public NMOS(String id, double Vthresh) { 35 | 36 | super(id, Vthresh); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/component/element/nonlinear/PMOS.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.component.element.nonlinear; 23 | 24 | /** 25 | * @author timmolter 26 | */ 27 | public class PMOS extends MOSFET { 28 | 29 | /** 30 | * Constructor 31 | * 32 | * @param id 33 | */ 34 | public PMOS(String id, double Vthresh) { 35 | 36 | super(id, Vthresh); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPI1D1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.I1D1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPI1D1 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new I1D1(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPI1R4.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.I1R4; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPI1R4 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new I1R4(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPI2R4.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.I2R4; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPI2R4 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new I2R4(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPI2R6.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.I2R6; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPI2R6 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new I2R6(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPV1D1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V1D1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPV1D1 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new V1D1(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPV1R1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V1R1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPV1R1 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new V1R1(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPV1R3.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V1R3; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPV1R3 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new V1R3(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPV1R4.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V1R4; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPV1R4 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new V1R4(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPV2R4.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V2R4; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPV2R4 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new V2R4(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPV2R5.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V2R5; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPV2R5 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new V2R5(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPV2R6.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V2R6; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPV2R6 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new V2R6(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPI1R2D1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.I1R2D1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPI1R2D1 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new I1R2D1(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPI1V1R6.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.I1V1R6; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPI1V1R6 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new I1V1R6(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPV1R1C1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V1R1C1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPV1R1C1 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new V1R1C1(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPV1R1L1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V1R1L1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPV1R1L1 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new V1R1L1(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPV2NMOS1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V2NMOS1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPV2NMOS1 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new V2NMOS1(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPV2PMOS1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V2PMOS1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPV2PMOS1 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new V2PMOS1(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPI1IAR1R2.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.I1IAR1R2; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPI1IAR1R2 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new I1IAR1R2(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPI1VAR1R2.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.I1VAR1R2; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPI1VAR1R2 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new I1VAR1R2(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPIntegrator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.Integrator; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPIntegrator { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new Integrator(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPV1R2VCCS1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V1R2VCCS1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOPV1R2VCCS1 { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new V1R2VCCS1(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOP_NMOSInverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.NMOSInverter; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOP_NMOSInverter { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new NMOSInverter(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOP_PMOSInverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.PMOSInverter; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOP_PMOSInverter { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new PMOSInverter(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOP_VoltageKeeper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.VoltageKeeper; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOP_VoltageKeeper { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new VoltageKeeper(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOP_CMOSInverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.CMOSInverterCircuit; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOP_CMOSInverter { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new CMOSInverterCircuit(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOP_HalfWaveRectifier.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.HalfWaveRectifier; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOP_HalfWaveRectifier { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new HalfWaveRectifier(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOP_TriStateInverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.TriStateInverterCircuit; 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class DCOP_TriStateInverter { 29 | 30 | public static void main(String[] args) { 31 | 32 | Netlist netlist = new TriStateInverterCircuit(); 33 | JSpice.simulate(netlist); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/simulate/dcoperatingpoint/NodalAnalysisConvergenceException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.simulate.dcoperatingpoint; 23 | 24 | /** 25 | * @author timmolter 26 | */ 27 | public class NodalAnalysisConvergenceException extends RuntimeException { 28 | 29 | /** 30 | * Constructor 31 | */ 32 | public NodalAnalysisConvergenceException() { 33 | 34 | super("Convergence Failed for non-linear circuit. Too many iterations."); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcsweep/DCSweepV1D1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcsweep; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V1D1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.dcsweep.DCSweepConfig; 28 | 29 | public class DCSweepV1D1 { 30 | 31 | public static void main(String[] args) { 32 | 33 | Netlist netlist = new V1D1(); 34 | netlist.setSimulationConfig(new DCSweepConfig("Va", "I(D1)", 0.5, .95, .005)); 35 | JSpice.simulate(netlist); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcsweep/DCSweepV1R4.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcsweep; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V1R4; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.dcsweep.DCSweepConfig; 28 | 29 | public class DCSweepV1R4 { 30 | 31 | public static void main(String[] args) { 32 | 33 | Netlist netlist = new V1R4(); 34 | netlist.setSimulationConfig(new DCSweepConfig("R1", "I(3)", 100.0, 10000, 100)); 35 | JSpice.simulate(netlist); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcsweep/DCSweepI1V1R6.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcsweep; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.I1V1R6; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.dcsweep.DCSweepConfig; 28 | 29 | public class DCSweepI1V1R6 { 30 | 31 | public static void main(String[] args) { 32 | 33 | Netlist netlist = new I1V1R6(); 34 | netlist.setSimulationConfig(new DCSweepConfig("x", "V(5)", 0.0, 10.0, 1.0)); 35 | JSpice.simulate(netlist); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcsweep/DCSweepI1R2D1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcsweep; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.I1R2D1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.dcsweep.DCSweepConfig; 28 | 29 | public class DCSweepI1R2D1 { 30 | 31 | public static void main(String[] args) { 32 | 33 | Netlist netlist = new I1R2D1(); 34 | netlist.setSimulationConfig(new DCSweepConfig("Ia", "I(D1)", 0.0, 0.05, 0.001)); 35 | JSpice.simulate(netlist); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcsweep/DCSweepV1R1C1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcsweep; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V1R1C1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.dcsweep.DCSweepConfig; 28 | 29 | public class DCSweepV1R1C1 { 30 | 31 | public static void main(String[] args) { 32 | 33 | Netlist netlist = new V1R1C1(); 34 | netlist.setSimulationConfig(new DCSweepConfig("V1", "I(V1)", 0.5, 0.95, 0.005)); 35 | JSpice.simulate(netlist); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcsweep/DCSweepV1R2VCCS1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcsweep; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V1R2VCCS1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.dcsweep.DCSweepConfig; 28 | 29 | public class DCSweepV1R2VCCS1 { 30 | 31 | public static void main(String[] args) { 32 | 33 | Netlist netlist = new V1R2VCCS1(); 34 | netlist.setSimulationConfig(new DCSweepConfig("VCCS1", "I(VCCS1)", 1, 10, 1)); 35 | JSpice.simulate(netlist); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcsweep/DCSweepV1Mem1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcsweep; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.memristor.V1MSSMemristor1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.dcsweep.DCSweepConfig; 28 | 29 | public class DCSweepV1Mem1 { 30 | 31 | public static void main(String[] args) { 32 | 33 | Netlist netlist = new V1MSSMemristor1(); 34 | netlist.setSimulationConfig(new DCSweepConfig("Vdd", "I(M1)", 0.0, 1.0, .05)); 35 | JSpice.simulate(netlist); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/circuit/SubCircuit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuit; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistComponent; 26 | 27 | /** 28 | * @author timmolter 29 | */ 30 | public class SubCircuit { 31 | 32 | private Netlist subCircuitNetlist = new Netlist(); 33 | 34 | public void addNetListComponent(NetlistComponent component) { 35 | 36 | subCircuitNetlist.addNetListComponent(component); 37 | } 38 | 39 | public Netlist getNetlist() { 40 | 41 | return subCircuitNetlist; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/simulate/SimulationPreCheck.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.simulate; 23 | 24 | import java.util.Set; 25 | 26 | import org.knowm.jspice.netlist.Netlist; 27 | 28 | public class SimulationPreCheck { 29 | 30 | public static void verifyComponentToSweepOrDriveId(Netlist netlist, String componentId) { 31 | 32 | Set componentIDs = netlist.getComponentIDMap().keySet(); 33 | if (!componentIDs.contains(componentId)) { 34 | throw new IllegalArgumentException(componentId + " could not be found in the circuit!"); 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcsweep/DCSweepCMOSBuffer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcsweep; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.BufferCircuit; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.dcsweep.DCSweepConfig; 28 | 29 | public class DCSweepCMOSBuffer { 30 | 31 | public static void main(String[] args) { 32 | 33 | Netlist netlist = new BufferCircuit(); 34 | netlist.setSimulationConfig(new DCSweepConfig("Vin", "V(out)", 0, 5.0, .050)); 35 | JSpice.simulate(netlist); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcsweep/DCSweepNMOSInverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcsweep; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.NMOSInverter; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.dcsweep.DCSweepConfig; 28 | 29 | public class DCSweepNMOSInverter { 30 | 31 | public static void main(String[] args) { 32 | 33 | Netlist netlist = new NMOSInverter(); 34 | netlist.setSimulationConfig(new DCSweepConfig("Vin", "V(out)", 0, 5.0, .10)); 35 | JSpice.simulate(netlist); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcsweep/DCSweepVoltageKeeper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcsweep; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.VoltageKeeper; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.dcsweep.DCSweepConfig; 28 | 29 | public class DCSweepVoltageKeeper { 30 | 31 | public static void main(String[] args) { 32 | 33 | Netlist netlist = new VoltageKeeper(); 34 | netlist.setSimulationConfig(new DCSweepConfig("Vin", "V(out)", 0, 5.0, .050)); 35 | JSpice.simulate(netlist); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcsweep/DCSweepCMOSInverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcsweep; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.CMOSInverterCircuit; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.dcsweep.DCSweepConfig; 28 | 29 | public class DCSweepCMOSInverter { 30 | 31 | public static void main(String[] args) { 32 | 33 | Netlist netlist = new CMOSInverterCircuit(); 34 | netlist.setSimulationConfig(new DCSweepConfig("Vin", "V(out)", 0, 5, .10)); 35 | JSpice.simulate(netlist); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/I1D1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCCurrent; 26 | import org.knowm.jspice.netlist.NetlistDiode; 27 | 28 | public class I1D1 extends Netlist { 29 | 30 | public I1D1() { 31 | 32 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 33 | addNetListComponent(new NetlistDCCurrent("Ia", .10, "0", "1")); 34 | addNetListComponent(new NetlistDiode("D1", 0.000000000000001, "1", "0")); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/V1D1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistDiode; 27 | 28 | public class V1D1 extends Netlist { 29 | 30 | public V1D1() { 31 | 32 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 33 | addNetListComponent(new NetlistDCVoltage("Va", 0.95, "1", "0")); 34 | addNetListComponent(new NetlistDiode("D1", 0.000000000000001, "1", "0")); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcsweep/DCSweepHalfWaveRectifier.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcsweep; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.HalfWaveRectifier; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.dcsweep.DCSweepConfig; 28 | 29 | public class DCSweepHalfWaveRectifier { 30 | 31 | public static void main(String[] args) { 32 | 33 | Netlist netlist = new HalfWaveRectifier(); 34 | netlist.setSimulationConfig(new DCSweepConfig("Vsrc", "I(D1)", 0, 5.0, .05)); 35 | JSpice.simulate(netlist); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcsweep/DCSweepTriStateInverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcsweep; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.TriStateInverterCircuit; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.dcsweep.DCSweepConfig; 28 | 29 | public class DCSweepTriStateInverter { 30 | 31 | public static void main(String[] args) { 32 | 33 | Netlist netlist = new TriStateInverterCircuit(); 34 | netlist.setSimulationConfig(new DCSweepConfig("Vin", "V(out)", 0, 5.0, .10)); 35 | JSpice.simulate(netlist); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcsweep/DCSweepPMOSInverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcsweep; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.PMOSInverter; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.dcsweep.DCSweepConfig; 28 | 29 | /** 30 | * @author timmolter 31 | */ 32 | public class DCSweepPMOSInverter { 33 | 34 | public static void main(String[] args) { 35 | 36 | Netlist netlist = new PMOSInverter(); 37 | netlist.setSimulationConfig(new DCSweepConfig("Vin", "V(out)", 0, 5.0, .10)); 38 | JSpice.simulate(netlist); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/I1R1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCCurrent; 26 | import org.knowm.jspice.netlist.NetlistResistor; 27 | 28 | /** 29 | * This circuit is simply a dc current source and a single resistor 30 | * 31 | * @author timmolter 32 | */ 33 | public class I1R1 extends Netlist { 34 | 35 | /** 36 | * Constructor 37 | */ 38 | public I1R1() { 39 | 40 | addNetListComponent(new NetlistDCCurrent("a", 1.0, "0", "1")); 41 | addNetListComponent(new NetlistResistor("R1", 1000, "1", "0")); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/simulate/transientanalysis/driver/DC.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.simulate.transientanalysis.driver; 23 | 24 | import java.math.BigDecimal; 25 | 26 | import com.fasterxml.jackson.annotation.JsonProperty; 27 | 28 | public class DC extends Driver { 29 | 30 | /** 31 | * Constructor 32 | * 33 | * @param id 34 | * @param dcOffset 35 | */ 36 | public DC(@JsonProperty("id") String id, @JsonProperty("dc_offset") double dcOffset) { 37 | 38 | super(id, dcOffset, "0", 0.0, "0"); 39 | } 40 | 41 | @Override 42 | public double getSignal(BigDecimal time) { 43 | 44 | return dcOffset; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/V2NMOS1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistNMOS; 27 | 28 | public class V2NMOS1 extends Netlist { 29 | 30 | public V2NMOS1() { 31 | 32 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 33 | addNetListComponent(new NetlistDCVoltage("Vdd", 5.0, "1", "0")); 34 | addNetListComponent(new NetlistDCVoltage("Vg", 3.3, "2", "0")); 35 | addNetListComponent(new NetlistNMOS("NMOS1", 2.5, "2", "1", "0")); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcop/DCOPI1R3.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcop; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.netlist.Netlist; 26 | import org.knowm.jspice.netlist.NetlistBuilder; 27 | 28 | public class DCOPI1R3 { 29 | 30 | public static void main(String[] args) { 31 | 32 | // run via NetlistBuilder 33 | NetlistBuilder builder = new NetlistBuilder().addNetlistDCCurrent("a", 1.0, "0", "1").addNetlistResistor("R1", 10, "1", "0") 34 | .addNetlistResistor("R2", 1000, "1", "2").addNetlistResistor("R3", 1000, "2", "0"); 35 | Netlist netlist = builder.build(); 36 | JSpice.simulate(netlist); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/V1R1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistResistor; 27 | 28 | /** 29 | * @author timmolter 30 | */ 31 | public class V1R1 extends Netlist { 32 | 33 | /** 34 | * Constructor 35 | */ 36 | public V1R1() { 37 | 38 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 39 | addNetListComponent(new NetlistDCVoltage("V1", 10.0, "1", "0")); 40 | addNetListComponent(new NetlistResistor("R1", 1000, "1", "0")); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/V2PMOS1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistPMOS; 27 | 28 | public class V2PMOS1 extends Netlist { 29 | 30 | public V2PMOS1() { 31 | 32 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 33 | addNetListComponent(new NetlistDCVoltage("Vdd", 5.0, "1", "0")); 34 | addNetListComponent(new NetlistDCVoltage("Vg", 3.3, "2", "0")); 35 | addNetListComponent(new NetlistPMOS("PMOS1", 2.5, "2", "1", "0")); // G, D, S 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/V2NMOS1SubThreshold.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistNMOS; 27 | 28 | public class V2NMOS1SubThreshold extends Netlist { 29 | 30 | public V2NMOS1SubThreshold() { 31 | 32 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 33 | addNetListComponent(new NetlistDCVoltage("Vds", 2, "1", "0")); 34 | addNetListComponent(new NetlistDCVoltage("Vgs", 1.0, "2", "0")); 35 | addNetListComponent(new NetlistNMOS("NMOS1", 2.5, "2", "1", "0")); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/V1R1L1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistInductor; 27 | import org.knowm.jspice.netlist.NetlistResistor; 28 | 29 | public class V1R1L1 extends Netlist { 30 | 31 | public V1R1L1() { 32 | 33 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 34 | addNetListComponent(new NetlistDCVoltage("V1", 0.0, "1", "0")); 35 | addNetListComponent(new NetlistResistor("R1", 100, "1", "2")); 36 | addNetListComponent(new NetlistInductor("L1", 200E-6, "2", "0")); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/I1R3.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCCurrent; 26 | import org.knowm.jspice.netlist.NetlistResistor; 27 | 28 | public class I1R3 extends Netlist { 29 | 30 | public I1R3() { 31 | 32 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 33 | addNetListComponent(new NetlistDCCurrent("a", 1.0, "0", "1")); 34 | addNetListComponent(new NetlistResistor("R1", 10, "1", "0")); 35 | addNetListComponent(new NetlistResistor("R2", 1000, "1", "2")); 36 | addNetListComponent(new NetlistResistor("R3", 1000, "2", "0")); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/V1R3.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistResistor; 27 | 28 | public class V1R3 extends Netlist { 29 | 30 | public V1R3() { 31 | 32 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 33 | addNetListComponent(new NetlistDCVoltage("x", 10.0, "1", "0")); 34 | addNetListComponent(new NetlistResistor("R1", 10, "1", "0")); 35 | addNetListComponent(new NetlistResistor("R2", 1000, "1", "2")); 36 | addNetListComponent(new NetlistResistor("R3", 1000, "2", "0")); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/circuit/subcircuit/CMOSInverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuit.subcircuit; 23 | 24 | import java.util.UUID; 25 | 26 | import org.knowm.jspice.circuit.SubCircuit; 27 | import org.knowm.jspice.netlist.NetlistNMOS; 28 | import org.knowm.jspice.netlist.NetlistPMOS; 29 | 30 | public class CMOSInverter extends SubCircuit { 31 | 32 | public CMOSInverter(String Vdd, String gnd, String in, String out, double Vthreshold) { 33 | 34 | String deviceId = UUID.randomUUID().toString(); 35 | 36 | addNetListComponent(new NetlistPMOS(deviceId + "_" + "P1", Vthreshold, in, out, Vdd)); // G, D, S 37 | addNetListComponent(new NetlistNMOS(deviceId + "_" + "N1", Vthreshold, in, out, gnd)); // G, D, S 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/transientanalysis/driver/TestDrivers.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.transientanalysis.driver; 23 | 24 | import java.util.List; 25 | 26 | import org.knowm.xchart.SwingWrapper; 27 | import org.knowm.xchart.XYChart; 28 | 29 | public class TestDrivers { 30 | 31 | int counter; 32 | final int point2Verify = 3; 33 | double y; 34 | 35 | void plotData(String name, List xData, List yData) { 36 | 37 | // Create Chart 38 | XYChart chart = new XYChart(600, 300); 39 | chart.setTitle("Driver Waveform"); 40 | chart.setXAxisTitle("time"); 41 | chart.setYAxisTitle(name); 42 | chart.addSeries(name, xData, yData); 43 | 44 | new SwingWrapper<>(chart).displayChart(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/circuit/subcircuit/TransmissionGate.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuit.subcircuit; 23 | 24 | import java.util.UUID; 25 | 26 | import org.knowm.jspice.circuit.SubCircuit; 27 | import org.knowm.jspice.netlist.NetlistNMOS; 28 | import org.knowm.jspice.netlist.NetlistPMOS; 29 | 30 | public class TransmissionGate extends SubCircuit { 31 | 32 | public TransmissionGate(String in, String out, String clk, String clkBar, double Vthreshold) { 33 | 34 | String deviceId = UUID.randomUUID().toString(); 35 | 36 | addNetListComponent(new NetlistPMOS(deviceId + "_" + "P1", Vthreshold, clkBar, out, in)); // G, D, S 37 | addNetListComponent(new NetlistNMOS(deviceId + "_" + "N1", Vthreshold, clk, in, out)); // G, D, S 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/resources/simplelogger.properties: -------------------------------------------------------------------------------- 1 | # SLF4J's SimpleLogger configuration file 2 | # Simple implementation of Logger that sends all enabled log messages, for all defined loggers, to System.err. 3 | # Default logging detail level for all instances of SimpleLogger. 4 | # Must be one of ("trace", "debug", "info", "warn", or "error"). 5 | # If not specified, defaults to "info". 6 | org.slf4j.simpleLogger.defaultLogLevel=warn 7 | # Logging detail level for a SimpleLogger instance named "xxxxx". 8 | # Must be one of ("trace", "debug", "info", "warn", or "error"). 9 | # If not specified, the default logging detail level is used. 10 | #org.slf4j.simpleLogger.log.xxxxx= 11 | # Set to true if you want the current date and time to be included in output messages. 12 | # Default is false, and will output the number of milliseconds elapsed since startup. 13 | #org.slf4j.simpleLogger.showDateTime=false 14 | # The date and time format to be used in the output messages. 15 | # The pattern describing the date and time format is the same that is used in java.text.SimpleDateFormat. 16 | # If the format is not specified or is invalid, the default format is used. 17 | # The default format is yyyy-MM-dd HH:mm:ss:SSS Z. 18 | #org.slf4j.simpleLogger.dateTimeFormat=yyyy-MM-dd HH:mm:ss:SSS Z 19 | # Set to true if you want to output the current thread name. 20 | # Defaults to true. 21 | #org.slf4j.simpleLogger.showThreadName=true 22 | # Set to true if you want the Logger instance name to be included in output messages. 23 | # Defaults to true. 24 | #org.slf4j.simpleLogger.showLogName=true 25 | # Set to true if you want the last component of the name to be included in output messages. 26 | # Defaults to false. 27 | #org.slf4j.simpleLogger.showShortLogName=false -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/simulate/SimulationPlotData.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.simulate; 23 | 24 | import java.util.ArrayList; 25 | import java.util.List; 26 | 27 | public final class SimulationPlotData { 28 | 29 | private final List xData; 30 | private final List yData; 31 | 32 | /** 33 | * Constructor 34 | */ 35 | public SimulationPlotData() { 36 | 37 | this.xData = new ArrayList<>(); 38 | this.yData = new ArrayList<>(); 39 | } 40 | 41 | public List getxData() { 42 | 43 | return xData; 44 | } 45 | 46 | public List getyData() { 47 | 48 | return yData; 49 | } 50 | 51 | @Override 52 | public String toString() { 53 | 54 | return "SimulationData [xData=" + xData + ", yData=" + yData + "]"; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/I1R2D1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCCurrent; 26 | import org.knowm.jspice.netlist.NetlistDiode; 27 | import org.knowm.jspice.netlist.NetlistResistor; 28 | 29 | public class I1R2D1 extends Netlist { 30 | 31 | public I1R2D1() { 32 | 33 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 34 | addNetListComponent(new NetlistDCCurrent("Ia", .10, "0", "1")); 35 | addNetListComponent(new NetlistResistor("R1", 100, "1", "0")); 36 | addNetListComponent(new NetlistResistor("R2", 10000, "1", "2")); 37 | addNetListComponent(new NetlistDiode("D1", 0.000000000000001, "2", "0")); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/V1R2VCCS1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistResistor; 27 | import org.knowm.jspice.netlist.NetlistVCCS; 28 | 29 | public class V1R2VCCS1 extends Netlist { 30 | 31 | public V1R2VCCS1() { 32 | 33 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 34 | addNetListComponent(new NetlistDCVoltage("V1", 1.0, "1", "0")); 35 | addNetListComponent(new NetlistResistor("R1", 1, "1", "0")); 36 | addNetListComponent(new NetlistResistor("R2", 1, "2", "0")); 37 | addNetListComponent(new NetlistVCCS("VCCS1", 1, "2", "0", "1", "0")); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/I1R4.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCCurrent; 26 | import org.knowm.jspice.netlist.NetlistResistor; 27 | 28 | public class I1R4 extends Netlist { 29 | 30 | public I1R4() { 31 | 32 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 33 | addNetListComponent(new NetlistDCCurrent("a", 1.0, "0", "1")); 34 | addNetListComponent(new NetlistResistor("R1", 100, "2", "0")); 35 | addNetListComponent(new NetlistResistor("R2", 1000, "0", "3")); 36 | addNetListComponent(new NetlistResistor("R3", 1000, "2", "3")); 37 | addNetListComponent(new NetlistResistor("R4", 100, "1", "2")); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/V1R4.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistResistor; 27 | 28 | public class V1R4 extends Netlist { 29 | 30 | public V1R4() { 31 | 32 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 33 | addNetListComponent(new NetlistDCVoltage("x", 10.0, "1", "0")); 34 | addNetListComponent(new NetlistResistor("R4", 100, "1", "2")); 35 | addNetListComponent(new NetlistResistor("R3", 1000, "2", "3")); 36 | addNetListComponent(new NetlistResistor("R2", 1000, "3", "0")); 37 | addNetListComponent(new NetlistResistor("R1", 100, "2", "0")); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/netlist/NetlistDCCurrentArbitrary.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.netlist; 23 | 24 | import org.knowm.jspice.component.source.DCCurrentArbitrary; 25 | 26 | import com.fasterxml.jackson.annotation.JsonCreator; 27 | import com.fasterxml.jackson.annotation.JsonProperty; 28 | 29 | public class NetlistDCCurrentArbitrary extends NetlistComponent { 30 | 31 | public NetlistDCCurrentArbitrary(String id, String expression, String... nodes) { 32 | 33 | super(new DCCurrentArbitrary(id, expression), nodes); 34 | } 35 | 36 | @JsonCreator 37 | public NetlistDCCurrentArbitrary(@JsonProperty("id") String id, @JsonProperty("expression") String expression, @JsonProperty("nodes") String nodes) { 38 | 39 | super(new DCCurrentArbitrary(id, expression), nodes); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/I1IAR1R2.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCCurrent; 26 | import org.knowm.jspice.netlist.NetlistDCCurrentArbitrary; 27 | import org.knowm.jspice.netlist.NetlistResistor; 28 | 29 | public class I1IAR1R2 extends Netlist { 30 | 31 | public I1IAR1R2() { 32 | 33 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 34 | addNetListComponent(new NetlistDCCurrent("x", 2.0, "1", "0")); 35 | addNetListComponent(new NetlistResistor("R1", 1, "1", "0")); 36 | addNetListComponent(new NetlistDCCurrentArbitrary("y", "I(x)*I(x)", "2", "0")); 37 | addNetListComponent(new NetlistResistor("R2", 1, "2", "0")); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/I1VAR1R2.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCCurrent; 26 | import org.knowm.jspice.netlist.NetlistDCVoltageArbitrary; 27 | import org.knowm.jspice.netlist.NetlistResistor; 28 | 29 | public class I1VAR1R2 extends Netlist { 30 | 31 | public I1VAR1R2() { 32 | 33 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 34 | addNetListComponent(new NetlistDCCurrent("x", 2.0, "1", "0")); 35 | addNetListComponent(new NetlistResistor("R1", 1, "1", "0")); 36 | addNetListComponent(new NetlistDCVoltageArbitrary("y", "V(1)*V(1)", "2", "0")); 37 | addNetListComponent(new NetlistResistor("R2", 1, "2", "0")); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/component/element/reactive/ReactiveElement.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.component.element.reactive; 23 | 24 | import java.util.Map; 25 | 26 | import org.knowm.jspice.component.Component; 27 | 28 | /** 29 | * @author timmolter 30 | */ 31 | public abstract class ReactiveElement extends Component { 32 | 33 | public ReactiveElement(String id) { 34 | 35 | super(id); 36 | } 37 | 38 | public abstract void stampSolutionVector(double[] RHS, Map nodeID2ColumnIdxMap, String[] nodes); 39 | 40 | private Double initialCondition = null; 41 | 42 | public Double getInitialCondition() { 43 | 44 | return initialCondition; 45 | } 46 | 47 | public void setInitialCondition(double initialCondition) { 48 | 49 | this.initialCondition = initialCondition; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/Integrator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistCapacitor; 26 | import org.knowm.jspice.netlist.NetlistDCVoltage; 27 | import org.knowm.jspice.netlist.NetlistResistor; 28 | import org.knowm.jspice.netlist.NetlistVCCS; 29 | 30 | public class Integrator extends Netlist { 31 | 32 | public Integrator() { 33 | 34 | addNetListComponent(new NetlistDCVoltage("V1", 1.0, "1", "0")); 35 | addNetListComponent(new NetlistResistor("R1", 1, "1", "0")); 36 | addNetListComponent(new NetlistVCCS("Gx", 1, "0", "x", "1", "0")); 37 | addNetListComponent(new NetlistCapacitor("Cx", 1, "x", "0")); 38 | addNetListComponent(new NetlistResistor("Rx", 1_000_000_000, "x", "0")); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/NMOSInverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistNMOS; 27 | import org.knowm.jspice.netlist.NetlistResistor; 28 | 29 | public class NMOSInverter extends Netlist { 30 | 31 | public NMOSInverter() { 32 | 33 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 34 | addNetListComponent(new NetlistDCVoltage("VDD", 5.0, "Vdd", "0")); 35 | addNetListComponent(new NetlistDCVoltage("Vin", 2.7, "in", "0")); 36 | addNetListComponent(new NetlistNMOS("M1", 2.5, "in", "out", "0")); // G, D, S 37 | addNetListComponent(new NetlistResistor("Rout", 100000, "Vdd", "out")); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/PMOSInverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistPMOS; 27 | import org.knowm.jspice.netlist.NetlistResistor; 28 | 29 | public class PMOSInverter extends Netlist { 30 | 31 | public PMOSInverter() { 32 | 33 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 34 | addNetListComponent(new NetlistDCVoltage("VDD", 5.0, "Vdd", "0")); 35 | addNetListComponent(new NetlistDCVoltage("Vin", 0.30, "in", "0")); 36 | addNetListComponent(new NetlistPMOS("M1", 2.5, "in", "out", "Vdd")); // G, D, S 37 | addNetListComponent(new NetlistResistor("Rout", 100000, "out", "0")); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/TransmissionGateCircuit.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.circuit.subcircuit.TransmissionGate; 25 | import org.knowm.jspice.netlist.Netlist; 26 | import org.knowm.jspice.netlist.NetlistDCVoltage; 27 | import org.knowm.jspice.netlist.NetlistResistor; 28 | 29 | public class TransmissionGateCircuit extends Netlist { 30 | 31 | public TransmissionGateCircuit() { 32 | 33 | addNetListComponent(new NetlistDCVoltage("Vin", 0.3, "in", "0")); 34 | addNetListComponent(new NetlistDCVoltage("Vclk", 5.0, "CLK", "0")); 35 | addNetListComponent(new NetlistDCVoltage("VclkBar", 0.0, "CLKBAR", "0")); 36 | 37 | addNetListComponent(new NetlistResistor("Rout", 100000, "out", "0")); 38 | 39 | addSubCircuit(new TransmissionGate("in", "out", "CLK", "CLKBAR", 2.5)); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/memristor/V1RSMemristor1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.memristor; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistRSMemristor; 27 | 28 | public class V1RSMemristor1 extends Netlist { 29 | 30 | private final static double schottkeyAlpha = 0; // N/A 31 | private final static double schottkeyBeta = 0; // N/A 32 | private final static double phi = 1; 33 | 34 | public V1RSMemristor1() { 35 | 36 | // build netlist, the nodes can be named anything except for ground whose node .................. 37 | addNetListComponent(new NetlistDCVoltage("Vdd", 1.0, "VDD", "0")); 38 | addNetListComponent(new NetlistRSMemristor("M1", schottkeyAlpha, schottkeyBeta, schottkeyAlpha, schottkeyBeta, phi, "VDD", "0")); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/netlist/NetlistDCVoltageArbitrary.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.netlist; 23 | 24 | import org.knowm.jspice.component.source.DCCurrentArbitrary; 25 | import org.knowm.jspice.component.source.DCVoltageArbitrary; 26 | 27 | import com.fasterxml.jackson.annotation.JsonCreator; 28 | import com.fasterxml.jackson.annotation.JsonProperty; 29 | 30 | public class NetlistDCVoltageArbitrary extends NetlistComponent { 31 | 32 | public NetlistDCVoltageArbitrary(String id, String expression, String... nodes) { 33 | 34 | super(new DCVoltageArbitrary(id, expression), nodes); 35 | } 36 | 37 | @JsonCreator 38 | public NetlistDCVoltageArbitrary(@JsonProperty("id") String id, @JsonProperty("expression") String expression, @JsonProperty("nodes") String nodes) { 39 | 40 | super(new DCCurrentArbitrary(id, expression), nodes); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/I2R4.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCCurrent; 26 | import org.knowm.jspice.netlist.NetlistResistor; 27 | 28 | public class I2R4 extends Netlist { 29 | 30 | public I2R4() { 31 | 32 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 33 | addNetListComponent(new NetlistDCCurrent("a", 1.0, "0", "1")); 34 | addNetListComponent(new NetlistDCCurrent("b", 0.5, "0", "1")); 35 | addNetListComponent(new NetlistResistor("R1", 100, "2", "0")); 36 | addNetListComponent(new NetlistResistor("R2", 1000, "0", "3")); 37 | addNetListComponent(new NetlistResistor("R3", 1000, "2", "3")); 38 | addNetListComponent(new NetlistResistor("R4", 100, "1", "2")); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | sudo: false 3 | before_install: "git clone -b travis `git config --get remote.origin.url` target/travis" 4 | script: "[ ${TRAVIS_PULL_REQUEST} = 'false' ] && mvn clean deploy --settings target/travis/settings.xml || mvn clean verify --settings target/travis/settings.xml" 5 | 6 | dist: trusty 7 | 8 | jdk: 9 | - openjdk11 10 | 11 | # whitelist 12 | branches: 13 | only: 14 | - master 15 | 16 | env: 17 | global: 18 | - secure: "oQK6bpODrpvLzs/ljjfcffVYNCxFRCdhoN8/s5r6fHFkHVBA3HO8hDbilq0rwYimjPgP1X1gr+5tE2VfxkvYiagBxrbx3rkUomSEKIOT/2mR8xUTEzfB6Cen4sZqPw+FX+QfdGodR10aj+ND1BmpiQGRFV/D71GLhuCmNSGRMd6T7f4OHytgt3eTNK2Ra5AQI1DYdchKj/IdAmRAz6nn1RKsEUdsqEepXE9FH2FaAhqMr0gGr16mehnbFnUQ+0g+jnOI4299Wyhn5tvb4+io698iXGd/+iNXLw5u7wHiYqglEtVpTt2TUYgG5PTeDShyh5pc/5d6WOPQVcRrcxNFsH5Bl1UpB/fgUqpmkuec4n94phKumfBnCNYpm2dk1rCNrR+az6yeUCqXWgC5BOldLpaB2pwTUfGxG5FNJXNYA71IRMBK0i4ipfQFXZLetIiGoZhpPhDRsHJNhmdUE2Oazjsarfr6v+S92MX3tZeaAC+ZpnTGns1OcW7hMmSQ+PVKo6x9Kq3XxZkIMqmMyHC0/0p4h3rryDsqh2nUOD3TsmLZJs91ZVSQDgnK/JIH1sGV8Pvksw0QhKtx2b4yU43ManCAvHjoIy5rBONIxtGfsgtw6/cawA6n09Oe/FV8iAPoQY0WyI6FUV2Hke+6zq8sXe9le1XAJeMNWlIVWDce5iI=" 19 | - secure: "fgV6H2wfVbONyuqr4nEge5zK4QBBjdlYIai2umWaNLyZ8gvRRkX8bvEjPM9yM4bN5j0b9CnPDdINQQ6Bh/uzt1FDSmlSReXgbY7eS02aR8Gvl69U+DIfEGGZRTLbrEkwlzqh60EMobZ9YH+QLHjTCAefG5lg2bPzkv/NNFHP2zeFYRbA/0XXXqn0McgBR6hkuvhItKc24rkTC4ukx6G/uZAHvI9nu+hfBlaAO2Joza2J4vIF2aR2OyHQOR5kLIj2fqFnms6rv8Zl/bG1YfhVzbm6HeuQlVAIVx3Kd5tsCn91xnLwOas7m/XTLpiKJUVfWwDRtVjXa8OTJozHbT67kURodNKdWIXdY/+jcsp1LQ9d+o3LYNGDGCPOFKbONo1rPS9fOmV9kC0RvKSKmo+QOk8hAY02QHNHbUG5BkkIJKUh7nMqwdjJwT6BO476kPcfSGR06X6CP+uIlaz448tbBNCyqKgsNLMM2CiFaoYiSRDPX2V+rnEJg5XI8buEBh60ivAS3P1nyA1LiMRUKP9XvbDFFpjjcbmf/A+UTuczBkSSWw8n3MX1mQ310uW3Rj+qmJAihP7PgTyIWR+nG+KnO6OUNIYsQQNAQKGo12b6m7tQhbEVBBrIlInar0RyTayVDXtV3YoOK27uHFnNLa0U3DorlmE174AucsRu0kJFyRE=" -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/netlist/NetlistVCVS.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.netlist; 23 | 24 | import javax.validation.Valid; 25 | import javax.validation.constraints.NotNull; 26 | 27 | import org.knowm.jspice.component.source.VCVS; 28 | 29 | import com.fasterxml.jackson.annotation.JsonCreator; 30 | import com.fasterxml.jackson.annotation.JsonProperty; 31 | 32 | public class NetlistVCVS extends NetlistComponent { 33 | 34 | @Valid 35 | @NotNull 36 | @JsonProperty("gain") 37 | double gain; 38 | 39 | public NetlistVCVS(String id, double gain, String... nodes) { 40 | 41 | super(new VCVS(id, gain), nodes); 42 | this.gain = gain; 43 | } 44 | 45 | @JsonCreator 46 | public NetlistVCVS(@JsonProperty("id") String id, @JsonProperty("gain") double gain, @JsonProperty("nodes") String nodes) { 47 | 48 | super(new VCVS(id, gain), nodes); 49 | this.gain = gain; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/V2R4.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistResistor; 27 | 28 | /** 29 | * @author timmolter 30 | */ 31 | public class V2R4 extends Netlist { 32 | 33 | public V2R4() { 34 | 35 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 36 | addNetListComponent(new NetlistDCVoltage("x", 10.0, "4", "0")); 37 | addNetListComponent(new NetlistDCVoltage("y", 5.0, "1", "4")); 38 | addNetListComponent(new NetlistResistor("R4", 100, "1", "2")); 39 | addNetListComponent(new NetlistResistor("R3", 1000, "2", "3")); 40 | addNetListComponent(new NetlistResistor("R2", 1000, "3", "0")); 41 | addNetListComponent(new NetlistResistor("R1", 100, "2", "0")); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/memristor/V1JoglekarMemristor1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.memristor; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistJoglekarMemristor; 27 | 28 | public class V1JoglekarMemristor1 extends Netlist { 29 | 30 | private final double Rinit = 11_000; 31 | private final double Ron = 100; 32 | private final double Roff = 16_000; 33 | private final double D = 10e-9; 34 | private final double uv = 10e-15; 35 | private final double p = 1; 36 | 37 | public V1JoglekarMemristor1() { 38 | 39 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 40 | addNetListComponent(new NetlistDCVoltage("Vdd", 1.0, "VDD", "0")); 41 | addNetListComponent(new NetlistJoglekarMemristor("M1", Rinit, Ron, Roff, D, uv, p, "VDD", "0")); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/V1R1C1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.component.element.reactive.Capacitor; 25 | import org.knowm.jspice.netlist.Netlist; 26 | import org.knowm.jspice.netlist.NetlistCapacitor; 27 | import org.knowm.jspice.netlist.NetlistDCVoltage; 28 | import org.knowm.jspice.netlist.NetlistResistor; 29 | 30 | public class V1R1C1 extends Netlist { 31 | 32 | public V1R1C1() { 33 | 34 | // // define capacitor 35 | // Capacitor capacitor1 = new Capacitor("C1", 16E-8); 36 | // capacitor1.setInitialCondition(0); 37 | 38 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 39 | addNetListComponent(new NetlistDCVoltage("V1", 0.0, "1", "0")); 40 | addNetListComponent(new NetlistResistor("R1", 160000, "1", "2")); 41 | addNetListComponent(new NetlistCapacitor("C1", 16E-8, "2", "0")); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/HalfWaveRectifier.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistCapacitor; 26 | import org.knowm.jspice.netlist.NetlistDCVoltage; 27 | import org.knowm.jspice.netlist.NetlistDiode; 28 | import org.knowm.jspice.netlist.NetlistResistor; 29 | 30 | public class HalfWaveRectifier extends Netlist { 31 | 32 | public HalfWaveRectifier() { 33 | 34 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 35 | addNetListComponent(new NetlistDCVoltage("Vsrc", 0.0, "in", "0")); 36 | addNetListComponent(new NetlistResistor("Rsrc", 50, "in", "D")); 37 | addNetListComponent(new NetlistDiode("D1", 3.872e-9, "D", "out")); 38 | addNetListComponent(new NetlistCapacitor("C1", 0.00001, "out", "0")); 39 | addNetListComponent(new NetlistResistor("Rload", 1000, "out", "0")); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/memristor/TransientAnalysisV1MSSMem1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.memristor; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.netlist.Netlist; 26 | import org.knowm.jspice.simulate.SimulationPlotter; 27 | import org.knowm.jspice.simulate.SimulationResult; 28 | import org.knowm.jspice.simulate.transientanalysis.TransientConfig; 29 | import org.knowm.jspice.simulate.transientanalysis.driver.Sine; 30 | 31 | public class TransientAnalysisV1MSSMem1 { 32 | 33 | public static void main(String[] args) { 34 | 35 | Netlist netlist = new V1MSSMemristor1(); 36 | TransientConfig transientConfig = new TransientConfig(".04", ".00001", new Sine("Vdd", 0.0, "0", 0.5, "100.0")); 37 | netlist.setSimulationConfig(transientConfig); 38 | SimulationResult simulationResult = JSpice.simulate(netlist); 39 | SimulationPlotter.plotTransientInOutCurve("I/V Curve", simulationResult, "V(VDD)", "I(M1)"); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/memristor/TransientAnalysisV1MSSMem1D1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.memristor; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.netlist.Netlist; 26 | import org.knowm.jspice.simulate.SimulationPlotter; 27 | import org.knowm.jspice.simulate.SimulationResult; 28 | import org.knowm.jspice.simulate.transientanalysis.TransientConfig; 29 | import org.knowm.jspice.simulate.transientanalysis.driver.Sine; 30 | 31 | public class TransientAnalysisV1MSSMem1D1 { 32 | 33 | public static void main(String[] args) { 34 | 35 | Netlist netlist = new V1MSSMemristor1D1(); 36 | TransientConfig transientConfig = new TransientConfig(".04", ".001", new Sine("V1", 0.0, "0", 1.5, "100.0")); 37 | netlist.setSimulationConfig(transientConfig); 38 | SimulationResult simulationResult = JSpice.simulate(netlist); 39 | SimulationPlotter.plotTransientInOutCurve("I/V Curve", simulationResult, "V(1)", "I(M1)"); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/netlist/NetlistNMOS.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.netlist; 23 | 24 | import javax.validation.Valid; 25 | import javax.validation.constraints.NotNull; 26 | 27 | import org.knowm.jspice.component.element.nonlinear.NMOS; 28 | 29 | import com.fasterxml.jackson.annotation.JsonCreator; 30 | import com.fasterxml.jackson.annotation.JsonProperty; 31 | 32 | public class NetlistNMOS extends NetlistComponent { 33 | 34 | @Valid 35 | @NotNull 36 | @JsonProperty("threshold") 37 | double threshold; 38 | 39 | public NetlistNMOS(String id, double threshold, String... nodes) { 40 | 41 | super(new NMOS(id, threshold), nodes); 42 | this.threshold = threshold; 43 | } 44 | 45 | @JsonCreator 46 | public NetlistNMOS(@JsonProperty("id") String id, @JsonProperty("threshold") double threshold, @JsonProperty("nodes") String nodes) { 47 | 48 | super(new NMOS(id, threshold), nodes); 49 | this.threshold = threshold; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/netlist/NetlistPMOS.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.netlist; 23 | 24 | import javax.validation.Valid; 25 | import javax.validation.constraints.NotNull; 26 | 27 | import org.knowm.jspice.component.element.nonlinear.PMOS; 28 | 29 | import com.fasterxml.jackson.annotation.JsonCreator; 30 | import com.fasterxml.jackson.annotation.JsonProperty; 31 | 32 | public class NetlistPMOS extends NetlistComponent { 33 | 34 | @Valid 35 | @NotNull 36 | @JsonProperty("threshold") 37 | double threshold; 38 | 39 | public NetlistPMOS(String id, double threshold, String... nodes) { 40 | 41 | super(new PMOS(id, threshold), nodes); 42 | this.threshold = threshold; 43 | } 44 | 45 | @JsonCreator 46 | public NetlistPMOS(@JsonProperty("id") String id, @JsonProperty("threshold") double threshold, @JsonProperty("nodes") String nodes) { 47 | 48 | super(new PMOS(id, threshold), nodes); 49 | this.threshold = threshold; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/memristor/TransientAnalysisV1MSSMem1D2.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.memristor; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.netlist.Netlist; 26 | import org.knowm.jspice.simulate.SimulationPlotter; 27 | import org.knowm.jspice.simulate.SimulationResult; 28 | import org.knowm.jspice.simulate.transientanalysis.TransientConfig; 29 | import org.knowm.jspice.simulate.transientanalysis.driver.Sine; 30 | 31 | public class TransientAnalysisV1MSSMem1D2 { 32 | 33 | public static void main(String[] args) { 34 | 35 | Netlist netlist = new V1MSSMemristor1D2(); 36 | TransientConfig transientConfig = new TransientConfig(".04", ".001", new Sine("V1", 0.0, "0", 1.75, "100.0")); 37 | netlist.setSimulationConfig(transientConfig); 38 | SimulationResult simulationResult = JSpice.simulate(netlist); 39 | SimulationPlotter.plotTransientInOutCurve("I/V Curve", simulationResult, "V(1)", "I(M1)"); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/transientanalysis/TransientAnalysisV1R8C8.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.transientanalysis; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V1R8C8; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.SimulationPlotter; 28 | import org.knowm.jspice.simulate.SimulationResult; 29 | import org.knowm.jspice.simulate.transientanalysis.TransientConfig; 30 | import org.knowm.jspice.simulate.transientanalysis.driver.Square; 31 | 32 | public class TransientAnalysisV1R8C8 { 33 | 34 | public static void main(String[] args) { 35 | 36 | Netlist netlist = new V1R8C8(); 37 | TransientConfig transientConfig = new TransientConfig(".00098", ".00001", new Square("V1", 5, "0", 5, "1000.0")); 38 | netlist.setSimulationConfig(transientConfig); 39 | SimulationResult simulationResult = JSpice.simulate(netlist); 40 | SimulationPlotter.plot(simulationResult, "V(9)"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/netlist/NetlistDCCurrent.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.netlist; 23 | 24 | import javax.validation.Valid; 25 | import javax.validation.constraints.NotNull; 26 | 27 | import org.knowm.jspice.component.source.DCCurrent; 28 | 29 | import com.fasterxml.jackson.annotation.JsonCreator; 30 | import com.fasterxml.jackson.annotation.JsonProperty; 31 | 32 | public class NetlistDCCurrent extends NetlistComponent { 33 | 34 | @Valid 35 | @NotNull 36 | @JsonProperty("current") 37 | double current; 38 | 39 | public NetlistDCCurrent(String id, double current, String... nodes) { 40 | 41 | super(new DCCurrent(id, current), nodes); 42 | this.current = current; 43 | } 44 | 45 | @JsonCreator 46 | public NetlistDCCurrent(@JsonProperty("id") String id, @JsonProperty("current") double current, @JsonProperty("nodes") String nodes) { 47 | 48 | super(new DCCurrent(id, current), nodes); 49 | this.current = current; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/netlist/NetlistDCVoltage.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.netlist; 23 | 24 | import javax.validation.Valid; 25 | import javax.validation.constraints.NotNull; 26 | 27 | import org.knowm.jspice.component.source.DCVoltage; 28 | 29 | import com.fasterxml.jackson.annotation.JsonCreator; 30 | import com.fasterxml.jackson.annotation.JsonProperty; 31 | 32 | public class NetlistDCVoltage extends NetlistComponent { 33 | 34 | @Valid 35 | @NotNull 36 | @JsonProperty("voltage") 37 | double voltage; 38 | 39 | public NetlistDCVoltage(String id, double voltage, String... nodes) { 40 | 41 | super(new DCVoltage(id, voltage), nodes); 42 | this.voltage = voltage; 43 | } 44 | 45 | @JsonCreator 46 | public NetlistDCVoltage(@JsonProperty("id") String id, @JsonProperty("voltage") double voltage, @JsonProperty("nodes") String nodes) { 47 | 48 | super(new DCVoltage(id, voltage), nodes); 49 | this.voltage = voltage; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/V2R5.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistResistor; 27 | 28 | /** 29 | * @author timmolter 30 | */ 31 | public class V2R5 extends Netlist { 32 | 33 | public V2R5() { 34 | 35 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 36 | addNetListComponent(new NetlistDCVoltage("x", 10.0, "4", "0")); 37 | addNetListComponent(new NetlistDCVoltage("y", 5.0, "1", "4")); 38 | addNetListComponent(new NetlistResistor("R5", 1000, "3", "0")); 39 | addNetListComponent(new NetlistResistor("R4", 100, "1", "2")); 40 | addNetListComponent(new NetlistResistor("R3", 1000, "2", "3")); 41 | addNetListComponent(new NetlistResistor("R2", 1000, "3", "0")); 42 | addNetListComponent(new NetlistResistor("R1", 100, "2", "0")); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/transientanalysis/TransientAnalysisV1R1C1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.transientanalysis; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V1R1C1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.SimulationPlotter; 28 | import org.knowm.jspice.simulate.SimulationResult; 29 | import org.knowm.jspice.simulate.transientanalysis.TransientConfig; 30 | import org.knowm.jspice.simulate.transientanalysis.driver.Square; 31 | 32 | public class TransientAnalysisV1R1C1 { 33 | 34 | public static void main(String[] args) { 35 | 36 | Netlist netlist = new V1R1C1(); 37 | TransientConfig transientConfig = new TransientConfig("2", ".01", new Square("V1", 2.5, "0", 2.5, "1.0")); 38 | netlist.setSimulationConfig(transientConfig); 39 | SimulationResult simulationResult = JSpice.simulate(netlist); 40 | SimulationPlotter.plot(simulationResult, new String[]{"V(1)", "V(2)"}); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/transientanalysis/TransientAnalysisV1R1L1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.transientanalysis; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.V1R1L1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.SimulationPlotter; 28 | import org.knowm.jspice.simulate.SimulationResult; 29 | import org.knowm.jspice.simulate.transientanalysis.TransientConfig; 30 | import org.knowm.jspice.simulate.transientanalysis.driver.Sine; 31 | 32 | public class TransientAnalysisV1R1L1 { 33 | 34 | public static void main(String[] args) { 35 | 36 | Netlist netlist = new V1R1L1(); 37 | TransientConfig transientConfig = new TransientConfig("2", ".01", new Sine("V1", 0, "0", 2.5, "1.0")); 38 | netlist.setSimulationConfig(transientConfig); 39 | SimulationResult simulationResult = JSpice.simulate(netlist); 40 | SimulationPlotter.plotSeparate(simulationResult, new String[]{"V(1)", "I(L1)"}); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/netlist/NetlistResistor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.netlist; 23 | 24 | import javax.validation.Valid; 25 | import javax.validation.constraints.NotNull; 26 | 27 | import org.knowm.jspice.component.element.linear.Resistor; 28 | 29 | import com.fasterxml.jackson.annotation.JsonCreator; 30 | import com.fasterxml.jackson.annotation.JsonProperty; 31 | 32 | public class NetlistResistor extends NetlistComponent { 33 | 34 | @Valid 35 | @NotNull 36 | @JsonProperty("resistance") 37 | double resistance; 38 | 39 | public NetlistResistor(String id, double resistance, String... nodes) { 40 | 41 | super(new Resistor(id, resistance), nodes); 42 | this.resistance = resistance; 43 | } 44 | 45 | @JsonCreator 46 | public NetlistResistor(@JsonProperty("id") String id, @JsonProperty("resistance") double resistance, @JsonProperty("nodes") String nodes) { 47 | 48 | super(new Resistor(id, resistance), nodes); 49 | this.resistance = resistance; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/netlist/NetlistInductor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.netlist; 23 | 24 | import javax.validation.Valid; 25 | import javax.validation.constraints.NotNull; 26 | 27 | import org.knowm.jspice.component.element.reactive.Inductor; 28 | 29 | import com.fasterxml.jackson.annotation.JsonCreator; 30 | import com.fasterxml.jackson.annotation.JsonProperty; 31 | 32 | public class NetlistInductor extends NetlistComponent { 33 | 34 | @Valid 35 | @NotNull 36 | @JsonProperty("inductance") 37 | double inductance; 38 | 39 | public NetlistInductor(String id, double inductance, String... nodes) { 40 | 41 | super(new Inductor(id, inductance), nodes); 42 | this.inductance = inductance; 43 | } 44 | 45 | @JsonCreator 46 | public NetlistInductor(@JsonProperty("id") String id, @JsonProperty("inductance") double inductance, @JsonProperty("nodes") String nodes) { 47 | 48 | super(new Inductor(id, inductance), nodes); 49 | this.inductance = inductance; 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/VoltageKeeper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistNMOS; 27 | import org.knowm.jspice.netlist.NetlistPMOS; 28 | 29 | public class VoltageKeeper extends Netlist { 30 | 31 | public VoltageKeeper() { 32 | 33 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 34 | addNetListComponent(new NetlistDCVoltage("VDD", 5.0, "Vdd", "0")); 35 | addNetListComponent(new NetlistDCVoltage("Vin", 0.0, "in", "0")); 36 | addNetListComponent(new NetlistPMOS("P1", 2.5, "in", "out", "Vdd")); // G, D, S 37 | addNetListComponent(new NetlistNMOS("N1", 2.5, "in", "out", "0")); // G, D, S 38 | addNetListComponent(new NetlistPMOS("P2", 2.5, "out", "in", "Vdd")); // G, D, S 39 | addNetListComponent(new NetlistNMOS("N2", 2.5, "out", "in", "0")); // G, D, S 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/simulate/SimulationConfig.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.simulate; 23 | 24 | import org.knowm.jspice.simulate.dcoperatingpoint.DCOPConfig; 25 | import org.knowm.jspice.simulate.dcsweep.DCSweepConfig; 26 | import org.knowm.jspice.simulate.transientanalysis.TransientConfig; 27 | import org.knowm.konfig.Konfigurable; 28 | 29 | import com.fasterxml.jackson.annotation.JsonIgnoreProperties; 30 | import com.fasterxml.jackson.annotation.JsonSubTypes; 31 | import com.fasterxml.jackson.annotation.JsonSubTypes.Type; 32 | import com.fasterxml.jackson.annotation.JsonTypeInfo; 33 | 34 | @JsonIgnoreProperties(ignoreUnknown = true) 35 | @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") 36 | @JsonSubTypes({@Type(value = DCOPConfig.class, name = "dcop"), @Type(value = DCSweepConfig.class, name = "sweep"), 37 | @Type(value = TransientConfig.class, name = "trans")}) 38 | public abstract class SimulationConfig implements Konfigurable { 39 | 40 | } -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/I2R6.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCCurrent; 26 | import org.knowm.jspice.netlist.NetlistResistor; 27 | 28 | public class I2R6 extends Netlist { 29 | 30 | public I2R6() { 31 | 32 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 33 | addNetListComponent(new NetlistDCCurrent("a", 1.0, "0", "4")); 34 | addNetListComponent(new NetlistDCCurrent("b", 0.5, "5", "2")); 35 | addNetListComponent(new NetlistResistor("R1", 100, "5", "0")); 36 | addNetListComponent(new NetlistResistor("R2", 1000, "0", "3")); 37 | addNetListComponent(new NetlistResistor("R3", 1000, "2", "3")); 38 | addNetListComponent(new NetlistResistor("R4", 100, "1", "2")); 39 | addNetListComponent(new NetlistResistor("R5", 1000, "3", "0")); 40 | addNetListComponent(new NetlistResistor("R6", 10000, "1", "4")); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/transientanalysis/TransientAnalysisCMOSInverter.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.transientanalysis; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.CMOSInverterCircuit; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.SimulationPlotter; 28 | import org.knowm.jspice.simulate.SimulationResult; 29 | import org.knowm.jspice.simulate.transientanalysis.TransientConfig; 30 | import org.knowm.jspice.simulate.transientanalysis.driver.Triangle; 31 | 32 | public class TransientAnalysisCMOSInverter { 33 | 34 | public static void main(String[] args) { 35 | 36 | Netlist netlist = new CMOSInverterCircuit(); 37 | TransientConfig transientConfig = new TransientConfig("2", ".05", new Triangle("Vin", 2.5, "0", 2.5, "1.0")); 38 | netlist.setSimulationConfig(transientConfig); 39 | SimulationResult simulationResult = JSpice.simulate(netlist); 40 | SimulationPlotter.plot(simulationResult, "V(in)", "V(out)"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/transientanalysis/TransientAnalysisBusKeeper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.transientanalysis; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.BusKeeper; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.SimulationPlotter; 28 | import org.knowm.jspice.simulate.SimulationResult; 29 | import org.knowm.jspice.simulate.transientanalysis.TransientConfig; 30 | import org.knowm.jspice.simulate.transientanalysis.driver.Triangle; 31 | 32 | public class TransientAnalysisBusKeeper { 33 | 34 | public static void main(String[] args) { 35 | 36 | // Circuit 37 | Netlist netlist = new BusKeeper(); 38 | 39 | TransientConfig transientConfig = new TransientConfig("2", ".01", new Triangle("Vin", 2.5, "0", 2.5, "1.0")); 40 | netlist.setSimulationConfig(transientConfig); 41 | SimulationResult simulationResult = JSpice.simulate(netlist); 42 | SimulationPlotter.plot(simulationResult, "V(in)", "V(out)"); 43 | 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/transientanalysis/TransientAnalysisHalfWaveRectifier.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.transientanalysis; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.HalfWaveRectifier; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.SimulationPlotter; 28 | import org.knowm.jspice.simulate.SimulationResult; 29 | import org.knowm.jspice.simulate.transientanalysis.TransientConfig; 30 | import org.knowm.jspice.simulate.transientanalysis.driver.Sine; 31 | 32 | public class TransientAnalysisHalfWaveRectifier { 33 | 34 | public static void main(String[] args) { 35 | 36 | Netlist netlist = new HalfWaveRectifier(); 37 | TransientConfig transientConfig = new TransientConfig(".0833333333", ".0002", new Sine("Vsrc", 0, "0", 12, "60.0")); 38 | netlist.setSimulationConfig(transientConfig); 39 | SimulationResult simulationResult = JSpice.simulate(netlist); 40 | SimulationPlotter.plot(simulationResult, "V(in)", "V(out)"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/transientanalysis/TransientAnalysisTriStateInverter0.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.transientanalysis; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.TriStateInverterCircuit; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.SimulationPlotter; 28 | import org.knowm.jspice.simulate.SimulationResult; 29 | import org.knowm.jspice.simulate.transientanalysis.TransientConfig; 30 | import org.knowm.jspice.simulate.transientanalysis.driver.Sine; 31 | 32 | public class TransientAnalysisTriStateInverter0 { 33 | 34 | public static void main(String[] args) { 35 | 36 | Netlist netlist = new TriStateInverterCircuit(); 37 | TransientConfig transientConfig = new TransientConfig(".0002", ".000001", new Sine("Vin", 2.6, "0", 2.5, "10000")); 38 | netlist.setSimulationConfig(transientConfig); 39 | SimulationResult simulationResult = JSpice.simulate(netlist); 40 | SimulationPlotter.plot(simulationResult, "V(out)"); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/netlist/NetlistVCCS.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.netlist; 23 | 24 | import javax.validation.Valid; 25 | import javax.validation.constraints.NotNull; 26 | 27 | import org.knowm.jspice.component.source.VCCS; 28 | 29 | import com.fasterxml.jackson.annotation.JsonCreator; 30 | import com.fasterxml.jackson.annotation.JsonProperty; 31 | 32 | public class NetlistVCCS extends NetlistComponent { 33 | 34 | @Valid 35 | @NotNull 36 | @JsonProperty("transconductance") 37 | double transconductance; 38 | 39 | public NetlistVCCS(String id, double transconductance, String... nodes) { 40 | 41 | super(new VCCS(id, transconductance), nodes); 42 | this.transconductance = transconductance; 43 | } 44 | 45 | @JsonCreator 46 | public NetlistVCCS(@JsonProperty("id") String id, @JsonProperty("transconductance") double transconductance, @JsonProperty("nodes") String nodes) { 47 | 48 | super(new VCCS(id, transconductance), nodes); 49 | this.transconductance = transconductance; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/transientanalysis/TransientAnalysisIntegrator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.transientanalysis; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.Integrator; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.SimulationPlotter; 28 | import org.knowm.jspice.simulate.SimulationResult; 29 | import org.knowm.jspice.simulate.transientanalysis.TransientConfig; 30 | import org.knowm.jspice.simulate.transientanalysis.driver.Sine; 31 | 32 | /** 33 | * @author timmolter 34 | */ 35 | public class TransientAnalysisIntegrator { 36 | 37 | public static void main(String[] args) { 38 | 39 | Netlist netlist = new Integrator(); 40 | TransientConfig transientConfig = new TransientConfig("2", ".05", new Sine("V1", 0, "0", 1.0, "1.0")); 41 | netlist.setSimulationConfig(transientConfig); 42 | SimulationResult simulationResult = JSpice.simulate(netlist); 43 | SimulationPlotter.plot(simulationResult, "V(1)", "V(x)", "I(Gx)"); 44 | 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/memristor/TransientAnalysisV1MMSSMem1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.memristor; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.netlist.Netlist; 26 | import org.knowm.jspice.simulate.SimulationPlotter; 27 | import org.knowm.jspice.simulate.SimulationResult; 28 | import org.knowm.jspice.simulate.transientanalysis.TransientConfig; 29 | import org.knowm.jspice.simulate.transientanalysis.driver.Sine; 30 | 31 | public class TransientAnalysisV1MMSSMem1 { 32 | 33 | public static void main(String[] args) { 34 | 35 | Netlist netlist = new V1MMSSMemristor1(); 36 | TransientConfig transientConfig = new TransientConfig(".04", ".0001", new Sine("Vdd", 0.0, "0", 0.5, "100.0")); 37 | netlist.setSimulationConfig(transientConfig); 38 | SimulationResult simulationResult = JSpice.simulate(netlist); 39 | SimulationPlotter.plotSeparate(simulationResult,"V(VDD)", "I(M1)"); 40 | SimulationPlotter.plotTransientInOutCurve("I/V Curve", simulationResult, "V(VDD)", "I(M1)"); 41 | 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/dcsweep/DCSweepI1R1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.dcsweep; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.circuits.I1R1; 26 | import org.knowm.jspice.netlist.Netlist; 27 | import org.knowm.jspice.simulate.dcsweep.DCSweepConfig; 28 | 29 | /** 30 | * @author timmolter 31 | */ 32 | public class DCSweepI1R1 { 33 | 34 | public static void main(String[] args) { 35 | 36 | // run DC operating point 37 | Netlist netlist = new I1R1(); 38 | netlist.setSimulationConfig(new DCSweepConfig("a", "I(R1)", 0.0, 10.0, 1.0)); 39 | JSpice.simulate(netlist); 40 | 41 | // // run via NetlistBuilder 42 | // NetlistBuilder builder = new NetlistBuilder().addNetlistDCCurrent("a", 1.0, "1", "0").addNetlistResistor("R1", 1000, "0", "1") 43 | // .addDCSweepSimulationConfig("a", "I(R1)", 0.0, 10.0, 1.0); 44 | // Netlist netlist = builder.build(); 45 | // System.out.println("builder.getYAML() " + builder.getYAML()); 46 | // JSpice.simulate(netlist); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/circuit/subcircuit/Buffer.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuit.subcircuit; 23 | 24 | import java.util.UUID; 25 | 26 | import org.knowm.jspice.circuit.SubCircuit; 27 | import org.knowm.jspice.netlist.NetlistNMOS; 28 | import org.knowm.jspice.netlist.NetlistPMOS; 29 | 30 | public class Buffer extends SubCircuit { 31 | 32 | public Buffer(String Vdd, String gnd, String in, String out, double Vthreshold) { 33 | 34 | String deviceId = UUID.randomUUID().toString(); 35 | 36 | // inverter1 37 | addNetListComponent(new NetlistPMOS(deviceId + "_" + "P1", Vthreshold, in, deviceId + "_" + "x", Vdd)); // G, D, S 38 | addNetListComponent(new NetlistNMOS(deviceId + "_" + "N1", Vthreshold, in, deviceId + "_" + "x", gnd)); // G, D, S 39 | 40 | // inverter2 41 | addNetListComponent(new NetlistPMOS(deviceId + "_" + "P2", Vthreshold, deviceId + "_" + "x", out, Vdd)); // G, D, S 42 | addNetListComponent(new NetlistNMOS(deviceId + "_" + "N2", Vthreshold, deviceId + "_" + "x", out, gnd)); // G, D, S 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/org/knowm/jspice/simulate/transientanalysis/driver/Sine.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.simulate.transientanalysis.driver; 23 | 24 | import java.math.BigDecimal; 25 | 26 | import com.fasterxml.jackson.annotation.JsonProperty; 27 | 28 | /** 29 | * @author timmolter 30 | */ 31 | public class Sine extends Driver { 32 | 33 | /** 34 | * Constructor 35 | * 36 | * @param id 37 | * @param dcOffset 38 | * @param phase 39 | * @param amplitude 40 | * @param frequency 41 | */ 42 | public Sine(@JsonProperty("id") String id, 43 | @JsonProperty("dc_offset") double dcOffset, 44 | @JsonProperty("phase") String phase, 45 | @JsonProperty("amplitude") double amplitude, 46 | @JsonProperty("frequency") String frequency) { 47 | 48 | super(id, dcOffset, phase, amplitude, frequency); 49 | } 50 | 51 | @Override 52 | public double getSignal(BigDecimal time) { 53 | 54 | return amplitude * Math.sin(twopi.multiply(frequencyBD) .multiply(time).subtract( phaseBD).doubleValue()) + dcOffset; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/circuits/V2R6.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.circuits; 23 | 24 | import org.knowm.jspice.netlist.Netlist; 25 | import org.knowm.jspice.netlist.NetlistDCVoltage; 26 | import org.knowm.jspice.netlist.NetlistResistor; 27 | 28 | /** 29 | * @author timmolter 30 | */ 31 | public class V2R6 extends Netlist { 32 | 33 | public V2R6() { 34 | 35 | // build netlist, the nodes can be named anything except for ground whose node is always labeled "0" 36 | addNetListComponent(new NetlistDCVoltage("x", 10.0, "4", "0")); 37 | addNetListComponent(new NetlistDCVoltage("y", 5.0, "2", "5")); 38 | addNetListComponent(new NetlistResistor("R6", 10000, "1", "4")); 39 | addNetListComponent(new NetlistResistor("R5", 1000, "3", "0")); 40 | addNetListComponent(new NetlistResistor("R4", 100, "1", "2")); 41 | addNetListComponent(new NetlistResistor("R3", 1000, "2", "3")); 42 | addNetListComponent(new NetlistResistor("R2", 1000, "3", "0")); 43 | addNetListComponent(new NetlistResistor("R1", 100, "5", "0")); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/test/java/org/knowm/jspice/memristor/TransientAnalysisV1JoglekarMem1.java: -------------------------------------------------------------------------------- 1 | /** 2 | * jspice is distributed under the GNU General Public License version 3 3 | * and is also available under alternative licenses negotiated directly 4 | * with Knowm, Inc. 5 | * 6 | * Copyright (c) 2016-2017 Knowm Inc. www.knowm.org 7 | * 8 | * Knowm, Inc. holds copyright 9 | * and/or sufficient licenses to all components of the jspice 10 | * package, and therefore can grant, at its sole discretion, the ability 11 | * for companies, individuals, or organizations to create proprietary or 12 | * open source (even if not GPL) modules which may be dynamically linked at 13 | * runtime with the portions of jspice which fall under our 14 | * copyright/license umbrella, or are distributed under more flexible 15 | * licenses than GPL. 16 | * 17 | * The 'Knowm' name and logos are trademarks owned by Knowm, Inc. 18 | * 19 | * If you have any questions regarding our licensing policy, please 20 | * contact us at `contact@knowm.org`. 21 | */ 22 | package org.knowm.jspice.memristor; 23 | 24 | import org.knowm.jspice.JSpice; 25 | import org.knowm.jspice.netlist.Netlist; 26 | import org.knowm.jspice.simulate.SimulationPlotter; 27 | import org.knowm.jspice.simulate.SimulationResult; 28 | import org.knowm.jspice.simulate.transientanalysis.TransientConfig; 29 | import org.knowm.jspice.simulate.transientanalysis.driver.Sine; 30 | 31 | public class TransientAnalysisV1JoglekarMem1 { 32 | 33 | public static void main(String[] args) { 34 | 35 | // Circuit 36 | Netlist netlist = new V1JoglekarMemristor1(); 37 | TransientConfig transientConfig = new TransientConfig(".03", "3E-5", new Sine("Vdd", 0.0, "0", .4, "10.0")); 38 | netlist.setSimulationConfig(transientConfig); 39 | SimulationResult simulationResult = JSpice.simulate(netlist); 40 | SimulationPlotter.plotSeparate(simulationResult, "V(VDD)", "I(M1)"); 41 | SimulationPlotter.plotTransientInOutCurve("I/V Curve", simulationResult, "V(VDD)", "I(M1)"); 42 | } 43 | } 44 | --------------------------------------------------------------------------------