Solve a linear programming problem specified using algebraic form. The objective function and the constraints are expressions in x and y.
Solve a linear programming problem specified using Matrix form.
Quadratic programming problems can be specified in algebraic form or in Matrix form.
Nonlinear programs can be specified in algebraic form or in Matrix form.
You should provide the gradient of the objective function if you want to use NLPSolve in Matrix form.
>
|
obj := proc(v)
10*v[1]^2 - 2*v[1]*v[2]^2 + v[2]^4 + 1 - 2*v[2] + v[2]^2
end proc:
|
>
|
objgrad := proc(v, w)
w[1] := 20*v[1] - 2*v[2]^2:
w[2] := -4*v[1]*v[2] + 4*v[2]^3 - 2 + 2*v[2]
end proc:
|