Neural Network Weight Matrix Synthesis Using Optimal Control Techniques