[Tex/LaTex] Optimization formulas in LaTeX

equations

This is the code I'm using for my optimization problem.

$$\begin{array}{rrclcl} \displaystyle \min_{w,b,\xi} & \multicolumn{3}{l}{\frac{1}{2}w^{t}w+C\sum_{i=1}^{N}{\xi_{i}}}\\ \textrm{s.t.} & y_{i}(w\phi(x_{i}+b))+\xi_{i}-1\\ &\xi\geq0 \\ \end{array}$$


This is the result:

I want third argument (\xi\geq0) under yi. How can I do that? How can I add i=1 and N under and above summation?

this is very easy to accomplish using the aligned environment from amsmath:
\documentclass{article}
\begin{aligned} \min_{w,b,\xi} \quad & \frac{1}{2}w^{t}w+C\sum_{i=1}^{N}{\xi_{i}}\\ \textrm{s.t.} \quad & y_{i}(w\phi(x_{i}+b))+\xi_{i}-1\\ &\xi\geq0 \\ \end{aligned}

(in the future, please make your code a full compilable example, from \documentclass through \end{document}.)