Numerical Methods - order of accuracy I am implementing a program which solves differential equations - 1d diffusion.
I am using the Crank - Nicolson method whose accuracy should be second-order for time and second-order for space.
Unfortunately my results are second-order for time and first-order for space.
How is that possible? Or did I mess up something and is it not possible?

 I know f.e. that if it should be second-order and becomes third-order that means that T = Ahp + Bhp+1 and etc. if Ahp equals 0 then Bhp+1 will become dominant and we have p+1 order of accuracy.
I found one small issue in my code so I am closing the question. Thanks
@PierreCarre and @Uranix for your help
 A: Crank-Nicolson method is a second order in time and space, that is its error is $\varepsilon = A \Delta t^2 + B \Delta x^2 + \text{higer order terms}$. The leading term is $A \Delta t^2 + B \Delta x^2$.
If you take $\Delta t = \Delta x^2$ then the leading term becomes $A\Delta x^4 + B\Delta x^2$ and $A\Delta x^4$ becomes one of the higher order terms. The main error is given simply by $B\Delta x^2$. I also cannot understand why do you think your results are second-order in time. As I said, when $\Delta t = \Delta x^2$ the temporal error is very small and can be neglected compared to the spatial error.
The proper convergence study for the Crank-Nicolson method requires fixing $\Delta t = K \Delta x$ relation for some constant $K$. Then the leading term of the error decreases exactly in 4 times when you divide the step size by 2. Note that you need to divide both of the steps (the temporal and the spatial) by the factor of 2.
A: The CN scheme results in solving at each time step the linear system
$$
\left(I-\frac{D \Delta t}{2\Delta x^2} A\right)U^{n+1}=\left(I+\frac{D \Delta t}{2\Delta x^2} A\right)U^n + \Delta t F,
$$
where $A$ is the usual central difference matrix and $F$ the source term $ f_i = D \pi^2 \sin(\pi x_i)$. Taking $\Delta t = \Delta x$, which is fine because the scheme is unconditionally stable, you get the table ($D=1$):
$$
\begin{array}{|c|c|}\hline
\Delta x, \Delta t & Max. Error\\ \hline
0.1 & 0.286 \times 10^{-1}\\ \hline
0.01 & 0.316 \times 10^{-3}\\ \hline
0.001 & 0.321 \times 10^{-5}\\ \hline
\end{array}
$$
where the error is measured as $\displaystyle \max_{i,j}|U^i_j - u(x_j, t_i)|$. Using the last two lines to estimate the order of convergence, you get
$$
\alpha \approx \dfrac{\log \left(\dfrac{0.321\times 10^{-5}}{0.32\times 10^{-3}}\right)}{\log\left(\dfrac{0.001}{0.01}\right)}=2.011
$$
So, it would be useful if you post your exact discretization and code, because there must be some mistake.
