It is possible to bypass writing the spice model of the transistor within the netlist file. Instead, we can generate a new library *.lib or incorporate the spice model into an existing library. In the Windows environment, the *.lib library should be integrated into the Spice Opus installation directory’s lib scripts.
Now, we need to incorporate the created library into the *.cir file. Let’s modify a new *.cir file and designate it as BJTwithinclude.cir. Place 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.
[attachments title=”SPICE OPUS Tutorial” logged_users=2 include=”712″]