desciptive example of simulation using matlab

Attribution Non-Commercial (BY-NC)

94 views

desciptive example of simulation using matlab

Attribution Non-Commercial (BY-NC)

- Optimal Staffing Level of Network Operations and Management Centers
- Optimization Techniques Question Bank
- Question 3 Unit Opt
- 09.0 Integer Programming.pdf
- An Innovative Method of Die Design and Evaluation of Flow Balance for Thermoplastics Extrusion Profiles
- Linear Programming Module- A Conceptual Framework
- Models of Or
- FINAL OR
- Approximating the solution for the multiparametric 0-1-mixed integer linear programming problem with interval data
- Syllabus 205
- PhD Thesis Stephen John Sugden
- 355 Syllabus Based on Ragsdale 6th Edition(1)
- Fishback C064X
- A Review of Constraint Programming
- f2_27_05_2011.pdf
- Exam #1
- 0912f5090776cec64b000000
- Operation Research
- Ams Survey.ps
- overdetermmined system of linear equations

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

- Optimal Staffing Level of Network Operations and Management CentersUploaded byCyberJournals Multidisciplinary
- Optimization Techniques Question BankUploaded bysmg26thmay
- Question 3 Unit OptUploaded byBerry101
- 09.0 Integer Programming.pdfUploaded byAshoka Vanjare
- An Innovative Method of Die Design and Evaluation of Flow Balance for Thermoplastics Extrusion ProfilesUploaded bySoh Rab
- Linear Programming Module- A Conceptual FrameworkUploaded bySasquatch
- Models of OrUploaded byMahesh Rangaswamy
- FINAL ORUploaded byHimansu Sekhar Barik
- Approximating the solution for the multiparametric 0-1-mixed integer linear programming problem with interval dataUploaded byFernando Crema
- Syllabus 205Uploaded byaskar_cba
- PhD Thesis Stephen John SugdenUploaded bySteve Sugden
- 355 Syllabus Based on Ragsdale 6th Edition(1)Uploaded bychriskeys19
- Fishback C064XUploaded byTri Toro
- A Review of Constraint ProgrammingUploaded byATS
- f2_27_05_2011.pdfUploaded bysnadmin
- Exam #1Uploaded byStacc
- 0912f5090776cec64b000000Uploaded byMahardika Abdi Prawira
- Operation ResearchUploaded bySarlaJaiswal
- Ams Survey.psUploaded byVaibhav Acharya
- overdetermmined system of linear equationsUploaded bycuberbill1980
- Adaptive Robust Optimization for the Security Constrained Unit Commitment Problem.pdfUploaded byShafeek Ghreeb
- Bragin AnEfficientApproachForSolvingMIPProbemsUnderMonotinicityCondition1Uploaded byGaurav Kumar Badhotiya
- Convex OptUploaded byM Rameez Ur Rehman
- SepUploaded byhenrymallqui
- CAAVD SyllabusUploaded bythamaraikannan
- 06760333.pdfUploaded byAli Raza
- Maze Bridges2013 119Uploaded byDavid Berge
- IE511-1Uploaded bymhmd2222
- 01 Lp Graphical MethodUploaded byJEROME ORILLOSA
- 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

- Application Developers Guide.pdfUploaded bySantanu Das
- Laporan Progres 5Uploaded byEmiliyana Varida
- QC Xx Extend the Material Master SummaryUploaded byTom Marks
- Open Elective for CSE Related ProgrammesUploaded bykaparaveni
- Vertica Avoiding SegmentationUploaded byAshley Tolosa
- 10.1.1.86Uploaded byarkadiont
- C for ARM® Microcontrollers CD ROMUploaded bygousong
- Bit TwiddleUploaded byAkshay Shanbhag
- Java DB Reference ManualUploaded byayhaneln3230
- Error Running PdflatexUploaded byCedric
- Technical Reference Manual - System Parameters 3HAC17076-1_revG - Manuali UtiliUploaded byEl Beppe
- psUploaded byLouie Bello
- grep commands.docxUploaded bybaladivya15
- Csharp Methods(14)Uploaded byRakesh Rocky
- Student Guide Volume 2 Advanced SQLUploaded byapi-3748459
- Les 18Uploaded byapi-3720010
- Alagappa University Directorate of Distance Education 2008 Question PapersUploaded bympsmoorthy
- assembly.pdfUploaded bySK108108
- DS-5+SoCkit+WorkshopUSA.pdfUploaded byNguyen Tien
- Object Oriented ConceptsUploaded byMandeep Singh
- 64-Bit Insider Volume 1 Issue 12Uploaded byNayeem.khan
- Automated Web Testing Using SeleniumUploaded byFaceme Tester
- Assembly Language Prelim Reviewer 2017Uploaded byKristoff Avila
- WcfUploaded byfantaman123
- daaCodeForMscUploaded bycomputerstudent
- ruby-gdbmUploaded bynonnax
- MIT6_0001F16_ProblemSet0Uploaded byJohn Angel Herrera Salazar
- 200611 Steven Feuerstein Best Practice PLSQLUploaded byreuveng
- Sol 5Uploaded bydorsapiri
- Mexican Hat NetworkUploaded bySushant Ranade