Suppose we have $N$ risky assets $r_1$, $r_2$, ... , $r_N$ with a covariance matrix C. If we want to build a portfolio $\omega = (\omega_1, \ldots, \omega_N)^t$ (I loosely denote the portfolio with the weights vector $\omega$) with a minimum variance we solve the following optimization problem: $$ \omega^tC\omega \longrightarrow \min $$ subject to $$ \omega^t.1_N = 1 \\ \omega \geq 0_N $$ where $1_N$ and $0_N$ are column vectors of dimension $N$ with ones and zeros, respectively. This problem could be solved, for example, with Lagrange multipliers and the problem is a convex optimization problem.
Now let us add a risk-free asset $r_f$. If we now want to build a portfolio how does the optimization problem change? In my research I've seen that people refer to Sharpe ratio optimization but I couldn't identify the rigorous mathematical formulation, only strategies for a solution.
So how is the model above adapted?