You want to review how Tcl works
http://philip.greenspun.com/tcl/The answer is simple, there are many examples around the toolkit of dynamic variable names.
[set cat_${category_id}] will return the value of the variable you are looking for.
$cat_${category_id} is parsed as $cat_ $category_id since the parser does not do to passes.
NOTE that the index of an array is evaluated betfore the variable reference so $cat($category_id) will work where $cat_${category_id} will not.