Simulating op-amp circuits using Multisim/Matlab

In summary: In the function generator, I can change the amplitude, frequency, and the offset, if I use it as sine wave. If I use it as square wave, I can change the duty cycle too.
  • #1
Fatima Hasan
319
14
Homework Statement
Find Vo for figure 1 & figure 2.
Find Vo, Vo1,Vo2 for figure 3
Figures are attached below.
Simulate using Multisim, MATLAB, or any Electrical software.
Relevant Equations
-
I tried to simulate the circuit shown in fig 1 using Multisim and here's my work:
circuit.JPG

sine wave.JPG
The result:
square wave.JPG
result.JPG


I do not know where is my mistake, could someone help me figuring out the problem?
Any help would be greatly appreciated!
 

Attachments

  • prob1.JPG
    prob1.JPG
    47.1 KB · Views: 138
  • prob2.JPG
    prob2.JPG
    25.1 KB · Views: 141
Last edited:
Physics news on Phys.org
  • #2
In the SPICE simulators that I use, those input sources would need explicit ground connections. Otherwise they would just be floating...
 
  • #3
berkeman said:
In the SPICE simulators that I use, those input sources would need explicit ground connections. Otherwise they would just be floating...
Here's my second attempt:
circuit2.JPG

result2.JPG


However, the result is not as expected to be.
 
  • #4
It looks like in this version you shorted the opamp -VEE supply input to its output? I guess there is no connection dot at the intersection, so maybe they are not shorted. You should still move the -VEE power symbol off of the feedback wire, though.

Can you expand the oscilloscope trace out more so that the overall character of the startup transient can be seen? Maybe go out about 10x in timebase. Also, can you invert the colors of the oscilloscope display? It's hard to read the red trace on the black background. Thanks.
 
  • #5
berkeman said:
It looks like in this version you shorted the opamp -VEE supply input to its output? I guess there is no connection dot at the intersection, so maybe they are not shorted. You should still move the -VEE power symbol off of the feedback wire, though.

Can you expand the oscilloscope trace out more so that the overall character of the startup transient can be seen? Maybe go out about 10x in timebase. Also, can you invert the colors of the oscilloscope display? It's hard to read the red trace on the black background. Thanks.
circuit3.JPG


Here's what I got:
result3.JPG
 
  • #6
Thank you, much easier to see the 'scope output! That looks pretty reasonable if the two sources are configured as sin and square wave sources, which was your original problem statement, right? What are your settings for XFG1 and XFG2?
 
  • #7
berkeman said:
Thank you, much easier to see the 'scope output! That looks pretty reasonable if the two sources are configured as sin and square wave sources, which was your original problem statement, right? What are your settings for XFG1 and XFG2?
Yes, XFG1: sine wave
sine wave.JPG


XFG2: square wave
square wave.JPG


I am trying to get a result similar to this:
ans1.JPG
 
  • #8
Looks like you are close. Just adjust the frequency and amplitude of the two generators to get you that desired waveform...
 
  • #9
berkeman said:
Looks like you are close. Just adjust the frequency and amplitude of the two generators to get you that desired waveform...
The amplitude and frequency are mentioned in the question.
Is this result acceptable or I have to adjust the scales?
result4.JPG
 
Last edited:
  • #10
From the picture in your Post #7 it looks like you have the frequencies and amplitudes of the square and sine backwards? Double-check the original problem statement and match those settings...
 
  • Like
Likes Fatima Hasan
  • #11
berkeman said:
From the picture in your Post #7 it looks like you have the frequencies and amplitudes of the square and sine backwards? Double-check the original problem statement and match those settings...
I solved all the parts, can you please check my results?
figure 1:
1.JPG

Figure 2 & Figure 3:
fig2&3.JPG


Result of fig2 :
2.JPG

Results of Figure 3 (Vo1,Vo2, & Vo, respectively):
3_vo1.JPG

3_vo2.JPG

3_vo.JPG


I am not sure about Vo in figure 3, because the value of the rightmost resistor in figure 3 is not written. I assume it's 1k,. This is the color code of it, I did a search but did not get the right value:
resistor.JPG


Thanks,
 

Attachments

  • 3_vo2.JPG
    3_vo2.JPG
    64.2 KB · Views: 121
  • #12
For Figure 1 -- does your simulator let you adjust the phase of your sources? If so, I'd play with the phase (or delay) of the sine wave to get your simulation to better match the 'scope picture. You can see how the relative phase of the sine and square waves is causing an initial offset of the sine that appears to droop across the plateaus of the square wave. Adjusting the phase of the sine so that it is mid-waveform at the square wave transitions should get rid of that.

Figure 2 is an integrator, so getting a tri wave out for the square wave input seems right.

Figure 3 has a differentiator as the 2nd stage, so the tri wave input giving a square wave output looks right. I'm not understanding the final waveforms yet, though...
 
  • #13
berkeman said:
For Figure 1 -- does your simulator let you adjust the phase of your sources? If so, I'd play with the phase (or delay) of the sine wave to get your simulation to better match the 'scope picture.
In the function generator, I can change the amplitude, frequency, and the offset, if I use it as sine wave. If I use it as square wave, I can change the duty cycle too.
berkeman said:
Figure 3 has a differentiator as the 2nd stage, so the tri wave input giving a square wave output looks right. I'm not understanding the final waveforms yet, though...
As our instructor said, the 1st stage is comparator, so the result would be a square wave ( Vo1). The 2nd stage is a differentiator, so the result would be as follows:
Vo2.JPG

The 3rd stage is a rectification and the result should be as follows:
Vo.JPG

(No negative pulses)
which is the output of the time-maker.
 

1. How do I simulate an op-amp circuit using Multisim/Matlab?

To simulate an op-amp circuit using Multisim, you can use the "Op-Amp" component from the "Analog" library. Simply drag and drop the component onto your circuit schematic and connect it to the other components. For Matlab, you can use the "opamp" function to create an op-amp object and then connect it to the rest of your circuit using the appropriate syntax.

2. Can I simulate non-ideal op-amp behavior in Multisim/Matlab?

Yes, both Multisim and Matlab allow you to simulate non-ideal op-amp behavior. In Multisim, you can use the "Op-Amp (Non-Ideal)" component from the "Analog" library. In Matlab, you can specify non-ideal parameters such as input offset voltage and gain bandwidth product when creating the op-amp object.

3. How do I analyze the results of my op-amp circuit simulation?

In Multisim, you can use the built-in simulation tools such as the oscilloscope and probe to analyze the results of your simulation. In Matlab, you can use the "plot" function to plot the output of your circuit and analyze it using various techniques such as frequency response analysis.

4. Can I create a custom op-amp model in Multisim/Matlab?

Yes, both Multisim and Matlab allow you to create custom op-amp models. In Multisim, you can use the "Op-Amp (Custom)" component from the "Analog" library and specify the parameters of your custom model. In Matlab, you can use the "opamp" function with user-defined parameters to create a custom op-amp object.

5. Are there any limitations to simulating op-amp circuits in Multisim/Matlab?

While Multisim and Matlab are powerful tools for simulating op-amp circuits, there are some limitations to keep in mind. For example, Multisim may not be able to simulate extremely complex circuits with a large number of components. Matlab may also have limitations on the number of op-amp models that can be included in a single circuit. It is always best to check the software documentation for any specific limitations before starting your simulation.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
8
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
21
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
34
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
15
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
8
Views
788
  • Engineering and Comp Sci Homework Help
2
Replies
44
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
16
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
4
Views
2K
Back
Top