This is a typical example of negative feedback in an Op-Amp -
For this case, the feedback of the output can be controlled using a resistor divider, and let's call the feedback fraction to be X. We can thus find the closed gain to be -
$$G_{CL} = \frac{G_{OL}}{1 + XG_{OL}}$$ using the open loop gain for the op-amp. As the open loop gain is very high, the equation reduces to 1/X. So, we can get a sizeable gain in this case using a proper resistor divider, but this retains the phase of the input waveform in V_in.
Now here is where I'm facing a problem. If I need to reverse the phase by 180 degrees for the output, maintaining the same magnitude of gain, how should I change the connections in the existing circuit without adding any other component? Using the equation -
$$V_{out} = G_{OL}(V_{non-inv}-V_{inv})$$, I see that I need to ground the non-inverting input and V_inverting should have a voltage of (XV_out + V_in), so that the gain remains same with a change in sign. But I have not been able to implement this, and this configuration distorts my input, though my output voltage is the same as it was with the phase retention gain -
Can someone help me out in this? It would be of great help.
NOTE: It is possible to shift the phase by 180 degrees using a three pole RC filter. I wish to know if there is an alternative to this without adding any new component.
Edit: Here is the actual V_in, and this doesn't get distorted for the Phase retention gain -
Here is the output that I get in both cases, the phase reversed or phase retained gains -
Here is the distorted V_in for the phase reversed gain in my case -