matlab,nonlinear-optimization,scip

Ok, so after enlightenment by J. Currie, an Opti toolbox developer, I understood the cause of the problem above. The first call to the objective with a vector of scipvar variables is actually a parser sweeping the objective function to see if it can be properly mapped to something that...

optim expects its second argument to be a function. Also, the second and third arguments to f are fixed and need to be specified: optim(c(50, 1, 2), f, x = x, yexp = yexp) This would also work: optim(c(50, 1, 2), function(p) f(p, x, yexp)) You could also use nls...

matlab,constraints,equality,nonlinear-optimization,inequality

I believe fmincon is well suited for your problem. Naturally, as with most minimization problems, the objective function is a multivariate scalar function. Since you are dealing with a vector function, fmincon complained about that. Is using the norm the "best" approach? The short answer is: it depends. The reason...

python,numpy,scipy,nonlinear-optimization

As @Jblasco suggested, you can minimize the sum of squares. scipy.leastsq() is designed for such problems. For your example, the code would be: import scipy.optimize as sopt xx0 = np.array([0., 0., 0.]) # starting point rslt = sopt.leastsq(fun, xx0, full_output=True) print("The solution is {}".format(rslt[0])) Look at the other entries of...

matlab,least-squares,nonlinear-optimization

My favorite is lsqcurvefit from the Optimization toolbox. From the documentation you see that it requires: function handle (fun) starting values for the parameters (x0) additional non-fitted parameters (xdata) which in your case do not exist data values (ydata) Options can be set optimset where you can specify one of...

r,mathematical-optimization,solver,nonlinear-optimization

Try different starting values (initScal) than zero; the sum( w * 0^2) = 0 for all w.

matlab,matlab-guide,matlab-compiler,nonlinear-optimization

Your function is incorrect as far as I can see. This line: xprime=[ alpha*I*(1-c) + c*(- k_f - k_d - k_n * s - k_p*(1-q)); lambda_b * c* P_C - lambda_r *(1-q)*s; k_p * c *(P_C / P_Q)- gamma * q]; should be: xprime=[ alpha*I*(1-x(1)) + x(1)*(- k_f - k_d...

matlab,curve-fitting,nonlinear-optimization

Use parameter #5, the lower bound. Right now you are passing [] which means "all variables are unbounded below". Use a lower bound of zero (vectorized of course) to make them non-negative.

sas,nonlinear-functions,nonlinear-optimization,enterprise-guide

First, there is no WYSIWYG in EG that I know of to do this. You can use a number of procedures, getting them to converge (PROC MODEL comes to mind as a likely candidate) is not easy. I used PROC OPTMODEL from SAS/OR in this example. data test; do i=1...