Engee documentation
Notebook

Noise-based operational amplifier simulation

This example demonstrates one of the methods for modeling noise in electrical circuits. The circuit is an amplifier with a cutoff frequency of 10 MHz, where noise effects are generated by an operational amplifier unit with limited bandwidth (Band-Limited Operational Amplifier). The voltage source Vn sets an equivalent spectral noise density of 20 .

Model diagram:

op_amp_with_noise--1743430398910.png

Defining a function to load and run the model:

In [ ]:
function start_model_engee()
    try
        engee.close("op_amp_with_noise", force=true) # closing the model
        catch err # if there is no model to close and engee.close() is not executed, it will be loaded after catch.
            m = engee.load("$(@__DIR__)/op_amp_with_noise.engee") # loading the model
        end;

    try
        engee.run(m, verbose=true) # launching the model
        catch err # if the model is not loaded and engee.run() is not executed, the bottom two lines after catch will be executed.
            m = engee.load("$(@__DIR__)/op_amp_with_noise.engee") # loading the model
            engee.run(m, verbose=true) # launching the model
        end
end
Out[0]:
start_model_engee (generic function with 1 method)

Running the simulation

In [ ]:
start_model_engee();
Building...
Progress 0%
Progress 5%
Progress 10%
Progress 15%
Progress 20%
Progress 25%
Progress 30%
Progress 35%
Progress 40%
Progress 45%
Progress 50%
Progress 55%
Progress 61%
Progress 66%
Progress 71%
Progress 76%
Progress 81%
Progress 86%
Progress 91%
Progress 96%
Progress 100%

Writing simulation data to variables:

In [ ]:
t = simout["op_amp_with_noise/SysOutput_1"].time[:]
amp_voltage = simout["op_amp_with_noise/SysOutput_1"].value[:]
Out[0]:
WorkspaceArray{Float64}("op_amp_with_noise/SysOutput_1").value

Data visualization

In [ ]:
using Plots

Voltage graph on the amplifier:

In [ ]:
plot(t, amp_voltage, linewidth=2, title="Voltage across the amplifier", xlabel="Time, from", ylabel="Voltage, V", lc=2)
Out[0]:

Frequency response of the amplifier:

newplot (65).png