Solution of linear and nonlinear equations by optical methods.