94 views

Uploaded by Neeraj Gupta

desciptive example of simulation using matlab

- code
- Question 3 Unit Opt
- Corsano G. Montagna J.M. Iribarren O.A. Aguirre P.A. Mathematical Modeling Approaches for Optimization of Chemical Processes (Nova Science Publishers 2009)(ISBN 9781604569421)(O)(103s) (2)
- zimmerman
- t3 Renmod h1c106097 Ghifari Razi
- The ϵ-capacity of a gain matrix and tolerable disturbances: Discrete-time perturbed linear systems
- production planning
- Methods of Line Balancing
- 7. Alwan
- Capacitated Facility Location Problem With General Operating and Building Cost
- OptimizationPPT-41
- Cim 2010
- ILP
- A Comparative Study of CHMs in CMOPs
- A New Approach to Solve Type-2 Fuzzy Linear Programming Problem Using Possibility, Necessity, and Credibility Measures
- 2. Transportation Model
- MENG4440-02-Lecture01
- Sylabus Phd
- Operation research paper
- European Journal of Operational Research Volume 90 Issue 1 1996 [Doi 10.1016%2F0377-2217%2894%2900246-0] a.B.M. Zohrul Kabir; Ahmed S. Al-Olayan -- A Stocking Policy for Spare Part Provisioning Under

You are on page 1of 11

DATE: 04/09/2013

Q.1. Find the solution of the following Linear Programming problem using MATLAB function linprog and Optimization Tool. a) Minimize subject to f=-x1-2x2-x3 2x1-x2+5x3<=6 2x1+x2-x3<=2 4x1+x2+x3<=6, MATLAB Code:

clc; f=[-1 -2 -1]; A=[2 -1 5;2 1 -1;4 1 1]; b=[6;2;6]; lb=[0 0 0]; [x,fval]=linprog(f,A,b,[],[],lb,[])

Optimization Tool:

62

Remarks: The feasible optimal solution has been obtained using MATLAB m.file code as well as optimization tool . b) Minimize subject to f=-3x1-2x2 x1-x2<=1 3x1-2x2<=6, MATLAB Code:

clear all; close all; clc; f=[-3 -2]; A=[1 -1;3 -2]; b=[1;6]; lb=[0;0]; [x,fval]=linprog(f,A,b,[],[],lb,[])

Result: Exiting: One or more of the residuals, duality gap, or total relative error has stalled: the dual appears to be infeasible (and the primal unbounded). (The primal residual < TolFun=1.00e-008.) x = 1.0e+014 * 3.2081 4.8121 fval = -1.9248e+015 Optimization Tool:

63

Remarks: The solution of the minimization function was unbounded. So solution is infeasible solution.

c) Minimize subject to

MATLAB Code:

clear all; close all; clc; f=[-40 -100]; A=[10 5;4 10;2 5]; b=[2500;2000;900]; lb=[0;0]; [x,fval]=linprog(f,A,b,[],[],lb,[])

64

d) Minimize subject to

65

MATLAB Code:

clear all; close all; clc; f=[-1 -2 -1]; A=[2 1 -1;2 -1 5;4 1 1]; b=[2;6;6]; lb=[0 0 0]; [x,fval]=linprog(f,A,b,[],[],lb,[])

Result: Optimization terminated. x= 0.0000 4.0000 2.0000 fval = Optimization Tool: -10.0000

DATE:18/09/2013

Q.2 Find the solution of the following non-linear optimization problem using the MATLAB function fmincon. Minimize Subject to f=9.82x1x2+2x2 g1=2500/x1x2-500<=0; g2=2500/x1x2-((x12+x22)/0.5882)<=0; g3=-x1+2<=0; g4=x1-14<=0; g5=-x2+0.2<=0; g6=x2-0.8<=0; MATLAB Code : a) With Non Linear Function solver fmincon: The objective function objpara.m

function y =objpara(x) y=9.82*x(1)*x(2)+2*x(1);

function [c,ceq]=nonlconstr(x) c=[(2500/(pi*x(1)*x(2)))-500; (2500/(pi*x(1)*x(2)))-((pi*(x(1)^2+x(2)^2))/0.5882); -x(1)+2;x(1)-14;-x(2)+0.2;x(2)-0.8]; ceq=[];

clc; clear all; x0=[7 0.4]; f=objfun(x0); [c,ceq]=nonlconstr(x0); [x,fval]=fmincon(@objfun,x0,[],[],[],[],[],[],@nonlconstr) [c,ceq]=nonlconstr(x)

Result: Active inequalities (to within options.TolCon = 1e-006): x= fval = c= 9.0638 35.9287 -61.0125 67 0.2000

Optimization Tool:

Remarks: The solution of non-linear optimization problem has been obtained using MATLAB function fmincon.

68

Q.3 Find the solution of the following non-linear optimization problem using the MATLAB function ga (Genetic Algorithm). Minimize Subject to f=9.82x1x2+2x2 g1=2500/x1x2-500<=0; g2=2500/x1x2-((x12+x22)/0.5882)<=0; g3=-x1+2<=0; g4=x1-14<=0; g5=-x2+0.2<=0; g6=x2-0.8<=0; xi>=0 for i=1,2.

MATLAB Code: First, create the objective function an M-file named spobf_1.m as follows:

function f=spobj_1(x) f=9.82*x(1)*x(2)+2*x(1);

function [c,ceq]=simple_constraint(x) c=[(2500/(pi*x(1)*x(2)))-500; (2500/(pi*x(1)*x(2)))-((pi*(x(1)^2+x(2)^2))/0.5882)]; ceq=[];

To minimize the fitness function, you need to pass a function handle to the fitness function as the first argument to the ga function, as well as specifying the number of variables as the second argument. Lower and upper bounds are provided as LB and UB respectively. In addition, you also need to pass a function handle to the nonlinear constraint function.

ObjectiveFunction = @spobj_1; nvars = 3; % Number of variables LB = [2 0.2]; % Lower bound ConstraintFunction = @simple_constraint; [x,fval]=ga(ObjectiveFunction,nvars,[],[],[],[],LB,[14 0.8],ConstraintFunction)

Result: Optimization terminated: average change in the fitness value less than options.TolFun and constraint violation is less than options.TolCon. x= fval = Optimization Tool: 9.0632 35.9300 0.2000

69

Remark: The solution of the non-linear optimization problem using the MATLAB function ga (Genetic Algorithm) has been obtained.

Q.4 Find the solution of the following linear programming problem using MATLAB function ga (Genetic Algorithm). Minimize Subject to f=-x1-2x2-x3 2x1+x2-x3<=2 2x1-x2+5x3<=6 4x1+x2+x3<=6, xi>=0 for i=1,2,3.

70

function f=spobj(x) f=-x(1)-2*x(2)-x(3);

clc; close all; clear all; a=[2 1 -1;2 -1 5;4 1 1]; b=[2;6;6]; [x,fval,exitflag]=ga(@spobj,3,a,b,[],[],[0;0;0],[])

Result: Optimization terminated: average change in the fitness value less than options.TolFun. x= fval = exitflag = 0.0087 -9.9229 1 3.9644 1.9855

Optimization Tool:

Remark: The solution of linear programming problem has been obtained using ga function. 71

DATE: 25/09/2013

Q.5 Find the minimum solution of the following function using MATLAB simulated annealing function. f=500-20x1-26x2-4x1x2+4x12+3x22

function f=spobj_4(x) f=500-20*x(1)-26*x(2)-4*x(1)*x(2)+4*(x(1)^2)+3*(x(2)^2);

OptimizationTool:

Remark: The minimum value of the function using MATLAB function simulated annealing has been obtained.

72

- codeUploaded bymy09
- Question 3 Unit OptUploaded byBerry101
- Corsano G. Montagna J.M. Iribarren O.A. Aguirre P.A. Mathematical Modeling Approaches for Optimization of Chemical Processes (Nova Science Publishers 2009)(ISBN 9781604569421)(O)(103s) (2)Uploaded byHariharan Srinivasan
- zimmermanUploaded byRavi Vij
- t3 Renmod h1c106097 Ghifari RaziUploaded byghifari razi
- The ϵ-capacity of a gain matrix and tolerable disturbances: Discrete-time perturbed linear systemsUploaded byIOSRjournal
- production planningUploaded byMehmet Sukru Koseoglu
- Methods of Line BalancingUploaded byKandukuri Partha
- 7. AlwanUploaded byElavarasan Parthasarathy
- Capacitated Facility Location Problem With General Operating and Building CostUploaded byAlejaNdra
- OptimizationPPT-41Uploaded byMichael G. Tadesse
- Cim 2010Uploaded byKatty Monsalve
- ILPUploaded byahmedelebyary
- A Comparative Study of CHMs in CMOPsUploaded byRam Nice
- A New Approach to Solve Type-2 Fuzzy Linear Programming Problem Using Possibility, Necessity, and Credibility MeasuresUploaded byAnonymous vQrJlEN
- 2. Transportation ModelUploaded byArpit Sahni
- MENG4440-02-Lecture01Uploaded byOmar Bahgat
- Sylabus PhdUploaded byKim J Seelan
- Operation research paperUploaded bysangeet83
- European Journal of Operational Research Volume 90 Issue 1 1996 [Doi 10.1016%2F0377-2217%2894%2900246-0] a.B.M. Zohrul Kabir; Ahmed S. Al-Olayan -- A Stocking Policy for Spare Part Provisioning UnderUploaded byapriliaratnaah
- Crane OptimizationUploaded byNaul Neyugn
- Project GuidelineUploaded byMohamed Farag Mostafa
- Or Chapter 2Uploaded byahmed shaban
- Weston 2017 - Strategic Capacity.pdfUploaded byMarcela Paz Riquelme Herrera
- g.txtUploaded byIvan Kokorin
- Prob_1_1Uploaded bymiguelgtturbo
- Nonlinear Model Predictive Control UAVUploaded bySohibul Hajah
- 06871358Uploaded bySiva Ranjani
- K9 - Model LokasiUploaded bydonny_3009
- Session1 OptUploaded byahmedaboshady

- Nptel Jan2019 a4 SolUploaded byNeeraj Gupta
- MaglevUploaded byNeeraj Gupta
- Tkk Neeraj Pat FinalUploaded byNeeraj Gupta
- Article DetailsUploaded byNeeraj Gupta
- Computer Science Python Book Class XIUploaded byvandana_dulani@yahoo.com
- NCERT Class 9 English Part 2Uploaded byNeeraj Gupta
- NCERT Class 6 English Part 2Uploaded byNeeraj Gupta
- Assignment 7Uploaded byNeeraj Gupta
- Assignment 6.docUploaded byNeeraj Gupta
- m MethodUploaded byNeeraj Gupta
- Barron_GREUploaded bymuddasani1986
- Assignment_1 SolvedUploaded byNeeraj Gupta
- CRT PPTUploaded byNeeraj Gupta

- Comm291 Practice MidtermUploaded byal3ung
- FLX Force Sensor Study GuideUploaded byMisato Kinomoto
- Columbus - Tool for Reverse Engineering Large Object Oriented Software SystemsUploaded byMike
- Logging and Debugging in Nokia (Alcatel-Lucent) SR OS and Cisco IOS XR _ KarneliukUploaded byJesus Rosales
- Bridge Lesson PlanUploaded byPravat Satpathy
- 237654933-mathematics-t-form-6-150913054948-lva1-app6892Uploaded by绝醒
- 158Uploaded bySilviu Prise
- LPC2478.pdfUploaded bydecosat2012
- Direct method to solve Volterra integral equation of the first kind using operational matrix with block-pulse functionsUploaded byPriyanka Nemani
- Paper Crane Lesson PlanUploaded byAngela Joan Yedersberger
- Improved System OperationUploaded byRafi Muhammed
- 2720 (Part-VII).pdfUploaded bySoundar Pachiappan
- elec2796_5Uploaded byvijay_786
- 6th sem syllabus ip university btech maeUploaded byAshish
- Ventilation in Hospital ProjectsUploaded byMAGDY KAMEL
- art3Uploaded bymarrukhj
- Flight Controls Quiz(Answers)Uploaded byDean Zouari
- SCADA vs DCS DescriptionUploaded by1t3stunit
- Flurocent LampUploaded byNagineni Naresh
- 41 the Handil Oil Field in East MalimantanUploaded byMartyson Yudha Prawira
- CK12 Prob Stat BasicUploaded byMasterofminds
- major_exam2_032.pdfUploaded byGenc Gashi
- 17 Stirling Numbers of Second TypeUploaded bybmandar
- ch4_p01-32Uploaded byJeanne Jackson
- UNIT 3Uploaded byS Manikandan
- t002 Magnetic Crack WorkingUploaded bychidambaram kasi
- ismouseclick()Uploaded byfaro62
- Optimizacion UgUploaded byMilan LLanque Conde
- Kawale_MSc_Thesis_Final.pdfUploaded byShehzad Ahmed
- Interference and DiffractionUploaded bymumtazali