function [k] = k_optimal(beta, q,r) % % Written by: % -- % John L. Weatherwax 2007-07-01 % % email: wax@alum.mit.edu % % Please send comments and especially bug reports to the % above email address. % %----- k = -beta + sqrt( beta^2 + q/r );