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
Define the new variable Gain with “let” command and plot the gain in db versus frequency
Now plot the phase of the signal
By default, the phase is in radians, to plot phase in degrees, we have to set the “units” variable
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°
At the end we will free memory with the “destroy” command and leave SPICE OPUS with “quit” command.
To learn more about SPICE OPUS you can download the tutorial attached to this page.