SPICE circuit to find AOL and noise gain of Transimpedance amplifier
This technique is often used in simulators. Generally speaking, every type of simulation in Spice goes something like this:


Read the netlist and build up the circuit.
Determine the operating point.
Do simulation-specific calculations (eg. small signal analysis) using the parameters found in step 2.
Destroy the circuit.


During step 2, Spice will assume that the circuit is quasi-static. This basically means it will try to find a solution of the circuit that can go on for an eternity without anything starting to change in time.

This is called DC. At DC, it means that:


Capacitors behave like an open circuit, because in rest:
$$i_C = C\frac{dv_C}{dt} = 0$$
Or put in words: no current can flow through the capacitor because else it wouldn't be in rest.
Inductors behave like a closed circuit, because in rest:
$$v_L = L\frac{di_L}{dt} = 0$$
Or put in words: no voltage can exist across the inductor because else it wouldn't be in rest.


During step 3, typically time/frequency-dependent effects come into play. We can then choose \$L\$ and \$C\$ such that they behave completely different as follows:


Capacitors can be made to behave like a short circuit, if:
$$v_C = \frac{1}{C}\int_{-\infty}^t i_Cdu \xrightarrow{C\to\infty} 0$$
Or put in words: if the capacitance is made larger, the voltage change over the capacitor can be made smaller making the capacitor behave more like a short-circuit.
Inductors can be made to behave like an open circuit, if:
$$i_L = \frac{1}{L}\int_{-\infty}^t v_Ldu \xrightarrow{L\to\infty} 0$$
Or put in words: if the inductance is made larger, the current through the inductor can be made smaller making the inductor behave more like an open-circuit.


Note that this all can be summerized quite neatly in the Fourier-domain:

$$\begin{align}
Z_C &amp;= \frac{1}{j2\pi f C} \\
Z_C &amp;\xrightarrow{C\to\infty} 0\\
Z_C &amp;\xrightarrow{f\to 0} \infty
\end{align}$$

And for inductors

$$\begin{align}
Z_L &amp;= j2\pi f L\\
Z_L &amp;\xrightarrow{L\to\infty} \infty\\
Z_L &amp;\xrightarrow{f\to 0} 0
\end{align}$$

Simulators can't work with infinite values, so instead we choose a very large value such that it doesn't affect the behavior of the rest of the circuit.


  Could anyone explain to me why put the source VG1 in the way shown in the picture, and why not at the non-inverting input side.


If the amplifier has a perfect common-mode rejection, then the result can be made identical if you placed the source at the positive terminal (you also need to change you measurement point too). This is generally speaking not the case though, so it is safer to inject the signal in the feedback loop, which is closer to how the OL gain should be interpreted.