Different kinds of Analysis
Here is a brief description of various kinds of Analysis that can be done on various circuits:
1. DC Analysis(DC Solver and DC Sweep)
-
Purpose: DC analysis is used to determine the steady-state operating point of a circuit. It calculates the DC voltages and currents in the circuit components.
- Example: Find the operating point of a simple resistor network.
* DC Analysis Example
V1 1 0 DC 10V
R1 1 2 1k
R2 2 0 2k
.dc V1 0 10 1
.op
.print dc V(1) V(2)
.end
-
In this example:
-
A voltage source V1 of 10V is connected across a resistor network consisting of R1 (1kΩ) and R2 (2kΩ).
-
The .dc command is used to sweep the DC voltage of V1 from 0V to 10V in steps of 1V.
-
The .print dc command outputs the node voltages at nodes 1 and 2.
-
The .op command tells ngspice to perform DC analysis to find the steady-state voltages and currents.
-
2. AC Analysis
-
Purpose: AC analysis is used to study the frequency response of a circuit. It calculates the circuit's response to small sinusoidal signals over a range of frequencies.
- Example: Analyze the frequency response of a simple RC low-pass filter.
* AC Analysis Example
V1 1 0 AC 1
R1 1 2 1k
C1 2 0 1uF
.ac dec 10 10 1MEG
.print ac V(2)
.end
-
In this example:
-
V1 is an AC source with a small-signal amplitude of 1V.
-
R1 and C1 form a low-pass filter.
-
The .ac command specifies an AC sweep with a decade spacing (dec), starting at 10Hz and ending at 1MHz, with 10 points per decade.
-
The .print ac command outputs the voltage at node 2 as a function of frequency.
-
3. Transient Analysis
-
Purpose: Transient analysis is used to simulate the time-domain response of a circuit. It determines how the circuit responds to inputs that change over time.
- Example: Simulate the charging and discharging of a capacitor in an RC circuit.
* Transient Analysis Example
V1 1 0 PULSE(0 5 0 1n 1n 1ms 2ms)
R1 1 2 1k
C1 2 0 1uF
.tran 1us 10ms
.print tran V(2)
.end
-
In this example:
-
V1 is a pulse voltage source that starts at 0V, rises to 5V with a rise time of 1ns, and has a pulse width of 1ms, repeating every 2ms.
-
R1 and C1 form an RC circuit.
-
The .tran command specifies a transient simulation with a time step of 1µs over a total time of 10ms.
-
The .print tran command outputs the voltage at node 2 as a function of time.
-
4. Noise Analysis
-
Purpose: Noise analysis evaluates the noise performance of a circuit, specifically the noise contribution from various components and the overall noise figure.
- Example: Perform noise analysis on a simple amplifier circuit.
* Noise Analysis Example
V1 1 0 AC 1
R1 1 2 1k
R2 2 0 1k
X1 2 0 3 opamp
.ac dec 10 1k 10MEG
.noise V(3) V1 dec 10 1k 10MEG
.print noise V(3)
.model opamp opamp
.end
-
In this example:
-
V1 is an AC source.
-
R1 and R2 set the gain for a simple operational amplifier (opamp model).
-
The .ac command defines an AC sweep.
-
The .noise command performs noise analysis, calculating the output noise referred to the input (V1), over the frequency range from 1kHz to 10MHz.
-
The .print noise command outputs the noise voltage at node 3.
-
5. Transfer Function Analysis in Ngspice
-
Purpose:Transfer function analysis is a powerful method used in electrical engineering to understand how a linear time-invariant (LTI) system, such as an electronic circuit, responds to various inputs. It provides insight into the behavior of circuits in the frequency domain, which is crucial for designing and analyzing filters, amplifiers, and control systems.
- Example: Transfer Function of a Simple RC Low-Pass Filter
Consider a simple RC low-pass filter. The transfer function analysis will show how the output voltage varies with frequency, which is typical for such filters.
* RC Low-Pass Filter Transfer Function Analysis
* Define components
V1 in 0 AC 1 ; AC voltage source with amplitude of 1V
R1 in out 1k ; Resistor of 1k ohms
C1 out 0 1uF ; Capacitor of 1 microfarad
* Transfer Function Analysis
.tf V(out) V(in) ; Calculate the transfer function from input 'in' to output 'out'
.end
Explanation:
-
V1 is an AC source with an amplitude of 1V.
-
R1 and C1 form the RC low-pass filter.
The .tf command specifies that we want to calculate the transfer function Vout/Vin.
< Basic Components used in Electronics Circuits up Exp.1 Wheatstone bridge >