I have problem with my piecewise functions
I read others post and I tried this but I have errors
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{align*}
$x_{{i}{j}}$ =
&\begin{cases}
\text{1,} &\quad\text{Si se envía agua desde área i ( i $\in$ \{1,2,3,4,5,6,7,8,9,10\}) a sitio j ( j $\in$ \{1,2,3,4,5,6,7\})} \\
\text{0,} &\quad\text{En caso contrario}
\end{cases}\\
$y_{j}$ =
&\begin{cases}
\text{1,} &\quad\text{ Si se construye planta en el sitio j ( j $\in $ \{1,2,3,4,5,6,7\})} \\
\text{0,} &\quad\text{En caso contrario}
\end{cases}
\end{align*}
\end{document}
Runaway argument? ! Paragraph ended before \align* was complete. \par l.592
I did this (using [) and it works well but they appear not aligned
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
x_{{i}{j}} =
\begin{cases}
\text{1,} &\quad\text{Si se envía agua desde área i ( i $\in$ \{1,2,3,4,5,6,7,8,9,10\}) a sitio j ( j $\in$ \{1,2,3,4,5,6,7\})} \\
\text{0,} &\quad\text{En caso contrario}
\end{cases}
\]
\[
y_{j} =
\begin{cases}
\text{1,} &\quad\text{ Si se construye planta en el sitio j ( j $\in $ \{1,2,3,4,5,6,7\})} \\
\text{0,} &\quad\text{En caso contrario}
\end{cases}
\]
\end{document}
and I want they are aligned, like this
$$
aroundx_{ij}
andy_{j}
.\begin{align*}
is already a math environment.\begin{aligned}
environment from amsmath. E.g. of its use: Alignment in equations