Circuit Analysis problem (find the problem) In this question, I know that $\text{C},\text{R},\text{T},\text{A}\in\mathbb{R}^+$
I've this circuit (the bottom of the resitor is connected to earth ($0$)):

When I use Laplace transform I can find that:


*

*$$\text{V}_{\text{out}}(s)=\frac{\text{R}}{\text{R}+\frac{1}{\text{C}s}}\cdot\text{V}_{\text{in}}(s)$$


My input function $\text{V}_{\text{in}}(t)$ is:

When I use Laplace transform, I can find that:


*

*$$\text{V}_{\text{in}}(s)=\frac{\text{A}\tanh\left(\frac{\text{T}s}{4}\right)}{s}$$


Now, when I substitute that in, I get that:


*

*$$\text{V}_{\text{out}}(s)=\frac{\text{R}}{\text{R}+\frac{1}{\text{C}s}}\cdot\frac{\text{A}\tanh\left(\frac{\text{T}s}{4}\right)}{s}$$


So, when I solved the inverse Laplace transform. I got ($\text{H}(x)$ is the Heaviside stepfunction):


*

*$$\text{V}_{\text{out}}(t)=\text{A}\exp\left[-\frac{t}{\text{CR}}\right]-2\text{A}\sum_{n=0}^{\infty}\text{H}\left(t-\frac{\text{T}n}{2}\right)\exp\left[-\frac{\left(t-\frac{\text{T}n}{2}\right)}{\text{CR}}\right]$$


Now, when I choose values $\text{T}=\frac{1}{50},\text{R}=1980,\text{A}=6,\text{C}=\frac{47\times10^{-6}}{10}$
I got a graph that looks like:


Q: When I build it I looked at the scope and that told me that the graph I should get looks somehing like the picture down here, where is my mistake?:


I noticed, when I took out the floor part of my $\text{V}_{\text{out}}(t)$ function (I get that with mathematica) and set $\text{A}=-6$ I got a graph that look more like the thing I expected, but here I dont understand why it oscillates around $18$, it should me around $0$:

 A: The transfer function is 
$$
H(s)=\frac{V_{\text{out}}(s)}{V_{\text{in}}(s)}=\frac{s}{s+\frac{1}{\tau}}
$$
where $\tau=RC$. The input voltage is
$$
V_{\text{in}}(s)=\frac{A}{s}\tanh\left(\frac{sT}{4}\right)=\frac{A}{s}\left(1-\mathrm e^{-\frac{Ts}{2}}\right)^2\sum_{k=0}^{\infty} \mathrm e^{-kTs}
$$
and then
$$
V_{\text{out}}(s)=\frac{A}{s+\frac{1}{\tau}}\left(1-2\mathrm e^{-\frac{Ts}{2}}+\mathrm e^{-Ts}\right)\sum_{k=0}^{\infty} \mathrm e^{-kTs}=F(s)\sum_{k=0}^{\infty} \mathrm e^{-kTs}
$$
The inverse Laplace transform gives
$$
v_{\text{out}}(t)=\sum_{k=0}^{\infty} f(t-kT)
$$
where
$$
f(t)=A\left[\mathrm e^{-\frac{t}{\tau}} u\left(t\right)-
2\mathrm e^{-\frac{1}{\tau}\left(t-\frac{T}{2}\right)} u\left(t-\tfrac{T}{2}\right)+\mathrm e^{-\frac{1}{\tau}\left(t-T\right)} u\left(t-T\right)
\right]
$$
and $u(t)$ is the Heaviside function.
Check here for the first 3 periods with your values.
If for simplicity we put $\tau=2$ and $T=1$ we have the plot here
A: Your circuit is a passive differentiator I think. There is one zero and one pole and the operation of the differentiation on the square wave (hence the spikes to be expected as your picture shows) occurs at frequencies below the pole frequency. You should be getting a Dirac delta function in the output for this, I think, after taking the inverse transform.
