How to get an equation system from a Simplex table Let's assume I already have a simplex table (with an optimal solution):
$$\left(\begin{array}{ccccc|c} 
& x_1 & x_2 & S_1 & S_2 & \\
S_1 & 0 & 2 & 0 & 1 & 2 \\
S_2 & 1 & 0 & \frac{1}{5} & 0  & 4 \\
\hline
P & 5 & 0 & \frac{1}{2} & 1  & 1
\end{array}\right)$$
note: the above table is not a real problem.
How do I get the original problem model from this?

If you write a better and correct example, you can find it easier. Just make sure that:
1) The matrix in front of your basic variables should be the identity matrix.
2) The objective function row in the optimal tableau will have 0s for basic variables.
I'll change your example to the following and show you the steps to retrieve your original problem from the optimal tableau.
The original problem (which we want to get at the end):
Maximize    Z = 3x + 2y

subject to: 

2x + y ≤ 18
2x + 3y ≤ 42
3x + y ≤ 24
x ≥ 0 , y ≥ 0

Optimal Tableau:
\begin{array}{cccccc|c} 
& x & y & S_1 & S_2 & S_3 & \\
y & 0 & 1 & \frac{-1}{2} & \frac{1}{2} & 0 & 12 \\
S_3 & 0 & 0 & \frac{-7}{4} & \frac{1}{4} & 1  & 3\\
x & 1 & 0 & \frac{3}{4} & \frac{-1}{4} & 0  & 3 \\
\hline
Z & 0 & 0 & \frac{5}{4} & \frac{1}{4} & 0 & 33
\end{array}
Your original tableau will have a form like this:
\begin{array}{rr|l}
* & * & 0 \\ \hline
N & I & b
\end{array}
and your optimal tableau will be:
\begin{array}{rr|l}
* & * & * \\ \hline
B^{-1} N & B^{-1} & B^{-1} b
\end{array}
So, under our slack variables (here $S_1, S_2, S_3$), we can find $ B^{-1} $ matrix:
\begin{array}{ccc} 
 \frac{-1}{2} & \frac{1}{2} & 0 &  \\
 \frac{-7}{4} & \frac{1}{4} & 1  & \\
 \frac{3}{4} & \frac{-1}{4} & 0  &  \\
\end{array}
Now, the inverse of your $ B^{-1} $ matrix is your $B$ matrix. So, $B$ is:
\begin{array}{ccc} 
 1 & 0 & 2 &  \\
 3 & 0 & 2  & \\
 1 & 1 & 3  &  \\
\end{array}
Multiply $B$ by $[12, 3, 3]$ ($B^{-1} b$ in the optimal tableau) and you get the original $b$:
$[18, 42, 24]$
and multiply it by $B^{-1} N$ and you get your original $N$: 
\begin{array}{cc} 
 2 & 1 &  \\
 2 & 3 & \\
 3 & 1 &  \\
\end{array}
You can also refer to this answer for a more in-depth explanation.
