In: Computer Science
PLEASE MAKE UP ANY 3 NONLINEAR PROGRAMMING PROBLEMs BY YOUR OWN AND SOLVE IT in either EXCEL, matlab or lingo.
Answer:-
solving nonlinear programming problems by using matlab:-
You can include nonlinear constraints by writing a function that computes both equality and inequality constraint values. A nonlinear constraint function has the syntax
[c,ceq] = nonlinconstr(x)
The function c(x) represents the constraint c(x) <= 0. The function ceq(x) represents the constraint ceq(x) = 0.
|
Note: You must have the nonlinear constraint function return both c(x) and ceq(x), even if you have only one type of nonlinear constraint. If a constraint does not exist, have the function return [] for that constraint. |
For example, if you have the nonlinear equality constraint x1^2+x2=1 and the nonlinear inequality constraint x1x2 ≥ –10, rewrite them as
x1^2+x2−1=0,
−x1x2−10≤0,
and then solve the problem using the following steps.
For this example, solve the problem
minf(x)=e^x1(4x1^2+2(x2)^2+4x1x2+2x2+1).
Step 1: Write a file objfun.m.
Step 2: Write a file confuneq.m
for the nonlinear constraints.
Step 3: Invoke constrained
optimization routine.

Output when j.m in the above photo is run:-

Note that ceq is equal to 0 within the default tolerance on the constraints of 1.0e^-006 and that c is less than or equal to 0, as desired.
Note:- you can do the same procedure for different functions using different equality and inequality constraints