# 16_opamp_dc: dc sweep

## Scope

In this simulation we are going to map a simple opamp circuit's gain at different voltages (dc sweep).

## The schematics

The single-sheet schematic contains the opamp circuit with connectors, suitable for the PCB workflow.

Click the image to get the sch-rnd sheet; also requires this project.lht in the same directory

## Opamp model

This example uses the lm358 macromodel from sch-rnd's stock spice library. This model is a subcircuit of the amplifier and simulates a lot of limiters and parasitics.

## Preparing for simulation

### Q1

The model uses the standard opamp pinout so the hardwired spice/pinnum attributes on the terminals will simply work.

The simulation setup process is largely the same as in the base example of dc op point. The simulation setup in this example is called "dc gain".

### Modifications

This circuit needs three voltage sources, which are both added as modifications. The first one is a DC 5V source connected to net Vcc (and GND). The second is a DC -5V source connected to net Vneg (and GND). These are the power supply rails of the opamp.

The third source is connected to the net in (and GND). Unlike other sources in the examples so far, this one has a name: V1. This is important because the analysis will need a named source for the sweep.

### Sim setup: output config

The analysis to use is dc (lin) which is a linear DC sweep: spice will vary the voltage on V1 (selected in the source name field, refers to V1 set up as a modification above). It is configured to run from -50mV to +60mV on the input, increasing voltage by 2 mV steps.

At the end the input and output voltages are plotted. The plot will use linear X axis because of the analysis is "(lin)".

Simulation setup dialog, third tab, after execution

Because of the large amplification factor, the input (red) trace is visible only when zoomed in.