## How to simulate Op-Amp in MATLAB

Good day. Could anyone tell me how to simulate an equivalent Operational Amplifier in Simulink? I read somewhere that I had to do it with 2 adders and a gain block, but I don't know how. Thanks.

 PhysOrg.com engineering news on PhysOrg.com >> Researchers use light projector and single-pixel detectors to create 3-D images>> GPS solution provides 3-minute tsunami alerts>> Single-pixel power: Scientists make 3-D images without a camera
 Recognitions: Gold Member ---(-ve Input)---- ...........................| (- +)SUM | ----|-Gain-> --- |Saturation Block| ---> (output) ---(+ve Input)--- Set gain very high, like 10,000. Saturation Block is used to limit the output to within certain range; for real hardware op-amps the output would saturate at power supply voltage levels.

 Quote by I_am_learning ---(-ve Input)---- ...........................| (- +)SUM | ----|-Gain-> --- |Saturation Block| ---> (output) ---(+ve Input)--- Set gain very high, like 10,000. Saturation Block is used to limit the output to within certain range; for real hardware op-amps the output would saturate at power supply voltage levels.
Ok thanks for that. Now, for some reason the resistors and capacitors don't want to connect to the Sum block. I tried the SimpowerSystems and Simscape blocks and they dont connect. Do you know why?

Recognitions:
Gold Member

## How to simulate Op-Amp in MATLAB

Blocks are very restrictive of what type of signals are input and what types are output.
Resisters and capacitors take 'voltage' signals as input but the 'sum' block needs pure signal (number) as input. 'Voltage Measurement Block' and 'Variable Voltage source' can convert signal of one form to other.
In short, the blocks don't connect because the signal types don't match.

 Quote by I_am_learning Blocks are very restrictive of what type of signals are input and what types are output. Resisters and capacitors take 'voltage' signals as input but the 'sum' block needs pure signal (number) as input. 'Voltage Measurement Block' and 'Variable Voltage source' can convert signal of one form to other. In short, the blocks don't connect because the signal types don't match.
That is great information. Is there any specific source or book that you can recommend me to learn all of these things?

I'll try to set up the whole model later on and tell you if I need any help.

P.S. Does the saturation block require another converter?

 Quote by I_am_learning Blocks are very restrictive of what type of signals are input and what types are output. Resisters and capacitors take 'voltage' signals as input but the 'sum' block needs pure signal (number) as input. 'Voltage Measurement Block' and 'Variable Voltage source' can convert signal of one form to other. In short, the blocks don't connect because the signal types don't match.
What converter do I need to put to the saturation block to be able to measure the output voltage?

 The simulation gives me an error. This is what I have so far: http://i1226.photobucket.com/albums/.../Projecto2.jpg How do I fix it?
 Recognitions: Gold Member The voltage measurement block measures 'voltage difference between two points' only. So, you need to connect both of its two input. The saturation block takes in pure number and gives out pure number. To convert it to voltage signal use a 'controlled voltage source' block. http://www.mathworks.com/help/physmo...agesource.html You can learn a great deal about various blocks by opening their configuration panel (double click) and choosing help.

 Quote by I_am_learning The voltage measurement block measures 'voltage difference between two points' only. So, you need to connect both of its two input. The saturation block takes in pure number and gives out pure number. To convert it to voltage signal use a 'controlled voltage source' block. http://www.mathworks.com/help/physmo...agesource.html You can learn a great deal about various blocks by opening their configuration panel (double click) and choosing help.
Ok, so I connected the voltage measurement blocks and then added the controlled voltage source block and I still get some weird error. What's wrong now? Did I connect the voltage measurement blocks wrong?

http://i1226.photobucket.com/albums/...lo2attempt.jpg