Getting Started with SPICE OPUS

We could avoid to write the spice model of transistor inside the netlist file: we can create a new library *.lib or add the spice model inside an existing library. In Windows the *.lib library must be added to the Spice Opus directory installation lib scripts

now we have to include the library created in the *.cir file, let’s edit a new *.cir file and name it BJTwithinclude.cir. Add the file in the installation directory.

Let’ s load the file

with “ac” command the input frequency is swept from 10Hz to 100MHz with 10 points per decade

acanalysis

Define the new variable Gain with “let” command and plot the gain in db versus frequency

plotgain

gainvsfrequency

Now plot the phase of the signal

plotphase

phasevsfrequency

By default, the phase is in radians, to plot phase in degrees, we have to set the “units” variable

 

setunits

Degrees

the discontinuity of the phase occurs because SPICE OPUS calculates phase in an [-180°, 180°] interval. To eliminate it we can define a new vector called “phase” using the “unwrap” command.  The expression for it transfers all positive components for 360°

unwrap

unwrappedphase

At the end we will free memory with the “destroy” command and leave SPICE OPUS with “quit” command.

quitspiceopus

To learn more about SPICE OPUS you can download the tutorial attached to this page.

Posted in SPICE OPUS and tagged , , , , , .