iii - test page for apache installationstaff.ttu.ee/~jmajak/mer9020-2013-2.doc · web...

45
3. Komplektsete tehniliste süsteemide optimaalne projekteerimine OPTIMIZATION OF ENGINEERING SYSTEMS 3.1. Sissejuhatus Arvuti kasutusel põhinevad projekteerimismeetodid toetavad projekteerijat parimate ja aega vähem nõudvate lahendite leidmisel arvestades integreeritult erinevaid aspekte, nagu toote geomeetria, valmistamistehnoloogia, ressurssid, tootemaksumus, investeeringute vajadus, jms. Sealjuures iseloomustab arenguid üleminek üksiku toote projekteerimiselt sarnaste toodete pere projekteerimisele, ühe ettevõtte ressursside arvestamiselt - ettevõtete koostöövõrgule. Arvutite võimsuse kasv võimaldab tegeleda järjest keerukamate ja ressursimahukamate ülesannetega, on lisandunud samaaegse multidistsiplinaarse optimaalse projekteerimise kasutamise võimalused. Sellega seotud metoodika arendus on pälvinud üha enam teadlaste tähelepanu. Optimaalse projekteerimise arenguid iseloomustab püüe integreerida ühtsesse süsteemi üha rohkem ülesandeid. Integreeritud toodete optimaalse projekteerimise protsessi võib käsitleda mitmetasemlise hierarhilise tootekomponentide projekteerimise protsessina. Tootepere projekteerimine kujutab endast üldjuhul multikriteriaalse optimeerimise ulesannet, kus komponentide projekteerimisel tuleb arvestada erinevaid aspekte , seoseid erinevate komponentide ja aspektide vahel Sellega kaasneb projekteerimisülesannete keerukuse kasv, robustsete lahendite otsimise vajadus, jms.Valdkonna taolisi arenguid võib käsitleda kui uut paradigmat keerukate toodete ja nende valmistamisprotsesside projekteerimise metoodika ja arvutipõhiste vahendite arengus. 3.1.2. Projektlahendite otsimine ja optimeerimine Projektlahendite otsimise ja optimeerimise (DSO – Design search and optimization) metoodika areng on kestnud ligi nelikümmend aastat ja käesoleval ajal on projekteerijate käsutuses mitmed võimsad DSO-d toetavad süsteemid [vaata näiteks 3, 4 ]. Üha olulisemaks saab vajadus olemasolevaid meetodeid otstarbekalt kasutada. Üldisel juhul võib projektlahendite optimeerimist defineerida kui lahendite otsimist, millised annavad minimaalse (või maksimaalse) väärtuse erinevatele etteantud sihifunktsioonidele

Upload: vominh

Post on 21-Apr-2018

227 views

Category:

Documents


5 download

TRANSCRIPT

3. Komplektsete tehniliste süsteemide optimaalne projekteerimine OPTIMIZATION OF ENGINEERING SYSTEMS3.1. SissejuhatusArvuti kasutusel põhinevad projekteerimismeetodid toetavad projekteerijat parimate ja aega vähem nõudvate lahendite leidmisel arvestades integreeritult erinevaid aspekte, nagu toote geomeetria, valmistamistehnoloogia, ressurssid, tootemaksumus, investeeringute vajadus, jms.Sealjuures iseloomustab arenguid üleminek üksiku toote projekteerimiselt sarnaste toodete pere projekteerimisele, ühe ettevõtte ressursside arvestamiselt - ettevõtete koostöövõrgule. Arvutite võimsuse kasv võimaldab tegeleda järjest keerukamate ja ressursimahukamate ülesannetega, on lisandunud samaaegse multidistsiplinaarse optimaalse projekteerimise kasutamise võimalused. Sellega seotud metoodika arendus on pälvinud üha enam teadlaste tähelepanu. Optimaalse projekteerimise arenguid iseloomustab püüe integreerida ühtsesse süsteemi üha rohkem ülesandeid. Integreeritud toodete optimaalse projekteerimise protsessi võib käsitleda mitmetasemlise hierarhilise tootekomponentide projekteerimise protsessina. Tootepere projekteerimine kujutab endast üldjuhul multikriteriaalse optimeerimise ulesannet, kus komponentide projekteerimisel tuleb arvestada erinevaid aspekte , seoseid erinevate komponentide ja aspektide vahel Sellega kaasneb projekteerimisülesannete keerukuse kasv, robustsete lahendite otsimise vajadus, jms.Valdkonna taolisi arenguid võib käsitleda kui uut paradigmat keerukate toodete ja nende valmistamisprotsesside projekteerimise metoodika ja arvutipõhiste vahendite arengus.

3.1.2. Projektlahendite otsimine ja optimeerimineProjektlahendite otsimise ja optimeerimise (DSO – Design search and optimization) metoodika areng on kestnud ligi nelikümmend aastat ja käesoleval ajal on projekteerijate käsutuses mitmed võimsad DSO-d toetavad süsteemid [vaata näiteks 3, 4 ]. Üha olulisemaks saab vajadus olemasolevaid meetodeid otstarbekalt kasutada. Üldisel juhul võib projektlahendite optimeerimist defineerida kui lahendite otsimist, millised annavad minimaalse (või maksimaalse) väärtuse erinevatele etteantud sihifunktsioonidele ja rahuldavad etteantud piiranguid (tõkkeid) [ ]. Sihifunktsioonideks on tavaliselt toote maksumus, tarneaeg, toote tasuvus ning mitmed toodete tehnilis-majanduslikke omadusi kirjeldavad suurused. Lahendeid piiravad piirangud toote parameetritele, tootmissüsteemist tulenevad piirangud, kasutada olevad ressursid jm. Modelleerimiseks kasutatavad seosed võivad sealjuures olla esitatud matemaatiliste avaldistena, töömahukate simuleerimistena, või eksperimentide/jälgimiste tulemustena. Projekteerimise optimeerimise tulemus on seda effektiivsem, mida keerukam on lähteprobleem, kuna inimene ei suuda taolises keerulises olukorras otstarbekalt probleemi hinnata ja lahendada. Optimeerimistehnikate kasutamine muutub eriti vajalikuks, kui üksiku komponendi/operatsiooni projekteerimiselt minnakse üle süsteemi (toote või tootmisprotsessi) integreeritud optimeerimisele.

Üldiselt võib optimaalsete insenerilahenduste arenguid kirjeldada kolme perioodina [1]: alates 60ndatest töötati välja ja rakendati projekteerimiseks peamiselt mittelineaarse planeerimise mudeleid, 70ndate lõpus võeti kasutusele nn evolutsioonilise planeerimise meetodid, 80-ndatel ja 90ndatel lisandus nimetatutele projektlahendite väljundsõltuvuste modelleerimisele orienteeritud nn “asendusmudelite” (Response Surface Method) kasutuselevõtt.

Mittelineaarse planeerimise meetodid on reeglina rakendatatavad suhteliselt lihtsate projekteerimisülesannete korral, nad nõuavad pidevaid seoseid mudeli muutujate vahel, lubatud lahendite hulga kumerust jms. Evolutsioonilise planeerimise meetodid (geneetiline planeerimine, simuleeritud lõõmutamine (simulated annealing) jt) on esmajoones seotud stohhastilise optimeerimise ja globaalse optimumi leidmisega. Meetodi peamiseks puuduseks on suur vajalik arvutuste maht.Projektlahendite väljundsõltuvuste modelleerimise meetodid ei ole oma olemuselt optimeerimise meetodid. Nende kasutamise peamiseks eesmärgiks on suure arvutusmahuga, sh põhiliselt lõplike elementide meetodi kasutamisel baseeruvate analüüsi ülesannete integreerimine optimeerimisülesannetega ning lahenduse effektiivsuse tõstmine.

3.1.3. Asendusmudelid projektlahendite väljundsõltuvuste modelleerimisks.Projektlahendite rakendatavuse üheks olulisemaks kriteeriumiks on kulutused optimeerimisele. Projekteerimise keerukuse vähendamise üheks võimaluseks on väljundsõltuvuste modelleerimine asendusmudelite (surrogaatmudelite) kasutamise abil (RSM – Response surface Methods)(vaataka p1.1.) . RSM on defineeritud, kui kogum matemaatilisi ja statistilisi meetodeid, millised võimaldavad vähendada optimeerimisprotsessi keerukust, lahendada piiratud arvutiressursside juures keerukaid projekteerimisülesandeid.RSM kasutamine eeldab tehisintellektil baseeruvate iseõppivate meetodite rakendamist, millised baseeruvad otstarbekalt valitud õpetava kogumi kasutamisel. Õpetava kogumi valik omab suurt mõju otsitava asendumudeli kvaliteedile. Kirjanduses [1] on pakutud erinevaid soovitusi õpetava kogumi näidete valikuks . Antud projektis on kavandatud nende soovituste analüüs ja antud ülesannete klassi tarvis parimate variantide leidmine.Soovitused lähtuvad põhiliselt Katsete Planeerimise teooriast (Design of Experiment – DOE), milline on esmajoones mõeldud füüsikaliste eksperimentide tarvis otstarbekate katseplaanide koostamiseks [19]. Kasutusel on mitmed DOE meetodid, nagu näidete juhuslik valik, täisfaktoriaalne katseplaan, tsentraalne-komposiitplaan, osafaktoriaalne plaan, ortogonaalsed katseplaanid (Plackett ja Burmani skeem, Box-Benkeni skeem Tagushi skeem jt), jt skeemid [1, 19,]. Modelleerimisel tuleb arvestada projektlahendite muutumispiirkonna ebaregulaarsust (mitte-sidusust), piirkonnas kehtivaid piiranguid ja surrogaatmudeli iseloomu. Mudelite kvaliteedi hindamiseks tuleb kasutada õpetava kogumi punktidest sõltumatuid, nn “testpunkte”. Peamiseks probleemiks sealjuures on aja ja muud kulud, mis on seotud nii õpetava- , kui testkogumi realiseerimisega. Valides otstarbeka jälgimiste/simuleerimise skeemi, tuleb leida õpetava kogumi alusel otsitavad sõltuvused – so. süsteemi õpetada. Käesoleval ajal on selleks kasutusel erinevaid meetode [1,3,4], nagu: lineaarse, ruut- või kõrgemat järku polünoomi parameetrrite hindamine regresioonanalüüsi abil, splainid, “tuumikfunktsioonide (kernel functions)” kasutamine, närvivõrkude kasutamine jt.Uuritakse peamiselt teooria sobivust vaadeldavale ülesannete klassidele ja hinnata tulemuste usaldust, sh ka saadud mudelite robustsust (st lahendi vähest tundlikkust tingimuste muutusele ja vigadele).Üheks oluliseks probleemiks meetodi valikul on vajadus kasutada projekteerimise kirjeldamiseks nii nn “klassifitseerimise mudeleid”(diskreetsete suuruste nagu, materjalid, erinevate tehnoloogiad, töövahendid jms mõju hindamiseks) kui ka arvutus- või regressionmudeleid (pidevate suuruste mõju hindamiseks). Närvivõrkude kasutamisel baseeruvad meetodid võimaldavad õpetada mõlemat tüüpi mudeleid, mis on nende eeliseks [ ].

Valdavalt lähtutakse RSM kasutamisel seisukohast , et meil puuduvad eelnevad teadmised piirkonnas kehtivate sõltuvuste kohta. Tehniliste süsteemide projekteerimisel ei saa aga nii väita, kuna enamikel juhtudel on olemas teadmised uuritavatest nähtusest või protsessidest ja taoliste teadmiste kasutamine võib oluliselt tõsta modeleerimise effektiivsust, vähendada töömahtu. Üheks projekti ülesandeks on leida otstarbekaid meetode olemaolevate inseneriteadmiste kasutamiseks väljundsõltuvuste modelleerimiseks.

Trends in Design OptimizationDesign optimization paradigm has been providing us the rational synthesis means for engineering design.The essential outcome from computational design optimization is that it can generate the best solution under mathematical representation and procedures, if an original design problem is appropriately translated to a formal style. The outcome is more effective if an original design problem is more complicated, since human expertise cannot precisely manipulate such contents. This situation is obvious when design concerns shift from component-level optimality to system level optimality.The current trends in manufacturing activities are further spreading from system-level design to multiple-systems-level design. Design and manufacturing activities are restricted by various hidden aspects, such a design and development cost, learning effects and supply-chain in production, inventory for production and services, apart from the direct aspects, i.e. single-system-level performance and cost. The viewpoint on multiple products extends the optimality domain to those hidden aspects beyond the traditional one. The engineering challenge to simultaneously design multiple products is earning much attention toward possibility in the design research community in the last years. This new research field is characterized with several terms: product variety, product family, product platform, modular product, etc. 3.2. MATHEMATICAL PROBLEM STATEMENT In this section we describe a step-by-step procedure for creating optimization models, and then describe the features of unconstrained and constrained problems. Formulation of Optimization Models The step-by-step procedure for formulating an optimization model is as follows:

1. Decision Variables Identify those aspects of a problem that can be adjusted to improved performance. Represent the decision variables by algebraic symbols.

2. Design Constraints Identify the restrictions or constraints that bound a problem. Whenever possible, express the restrictions/constraints as mathematical equations.

3. Design Objectives Express the system effectiveness measures as one or more objective functions.

As we will soon see, the design constraints and design objectives can sometimes be expresses as mathematical functions of the decision variables.

3.2.1. Optimeerimisülesannete tüübid (Types of Optimization Tasks)Eksisteerib teadusharu, operatsiooni analüüs (operation reseacrh), mis pretendeerib otsustusprotsesside teooriale. “Operatsiooni analüüs on meetodite kogum , mis on ettenähtud kõige efektiivsemate ja ökonoomsemate otsuste leidmiseks”.Operatsioonianalüüs rõhutab vajadust ühendada juhitavate protsesside (otsuste) kvantitatiivn eaj kvalitatiivne analüüs. Otsustusteoorias võib välja tuua kaks erisuunalist haru: Deskriptiivne (kirjeldav) otsustusteoora

Preskriptiivne (normatiivne ) otsustusteooria.

Sõltuvalt kasutatavate mudelite iseloomust võib olla tegemist: Determineeritud ülesandega Stohhastilise ülesandegavõi : Ühesammulise otsustusega Mitmesammulise otsustusega

Lahenduse liigist sõltuvalt: Analüütilise lahendusega Numbrilise lahendusega jms.

3.2.2. Mitme-kriteriaalsed (mitme-eesmärgilised) optimaalse valiku ülesanded

Inseneripraktikas on võimalik vastu võtta ja teostada enamikel juhtudel vaid üksainus otsus. Vastuvõetud otsust saab lugeda parimaks (optimaalseks) ainult sel juhul , kui eksisteerib võimalus järjestada alternatiivsed variandid eesmärgi saavutamise astme (kasulikkuse) alusel. Tavaliselt on projekteerimise ülesanne märksa keerukam ja ei õnnestu leid ühte üldist eesmärgi funktsiooni (sihifunktsiooni). Sellest tuleneb vajadus eesmärkide süsteemi formuleerimiseks ja analüüsiks, nende koosmõju hindamiseks. Sageli tuleb osa eesmärk eesitada piirangutena, lihtsustades sellega algülesannet. Mitme-eesmärgiga optimaalse valiku ülesannete tekkepõhjuseid võib esitada järgmiselt: Ühe optimeerimisülesande esitamine mitme (põhiliselt vastuolulise) kriteeriumiga Erinevate spetsialistide (isikute ) kasulikkuse võrdlemine ja kooskõlastatud valik.

Ühe optimeerimisülesande esitamine mitme (põhiliselt vastuolulise) kriteeriumiga

Tegemist on näiteks erinevate projektidega (lahendustega), mida hinnatakse erinevatest eesmärkidest lähtudes.Lahendada tulevad järgmised ülesanded: Probleemi (situatsiooni) kirjeldus Otsuse tegemiseks vajaliku eesmärkide süsteemi kirjeldus, vektor Alternatiivsete otsustamisvariantide määramine, vektor ,

tulemusena saadakse optimaalse valiku ülesande lähtetabel kujul:Alternatiivsed otsused

Eesmärkide süsteem

Alternatiivsete otsuste piirangute määramine, lubatud lahendite hulga määramine Parimate lahendite hulga välja sõelumine , Pareto optimaalsed lahendid Komplekshinnangute rakendamine parimate lahendite hulgale, optimaalse lahendi

leidmine

Optimaalse valiku näide 1Lähteandmed

Otsus (valiku alternatiiv)

Valiku kriteeriumid

A 1 2 1B 2 4 1C 3 3 2D 4 4 2E 5 4 4

Lähenemine 1. Pareto optimaalse hulga määramine:

Figure Dominating of criteria

Lahend B domineerib lahendi A üle Lahend D domineerib lahendi C üle.

Pareto optimaalne lahendite hulk on: B,D,E.

Otsus (valiku alternatiiv)

Valiku kriteeriumidMax G1 Max G2 Min G3

B 2 4 1D 4 4 2E 5 4 4

Lähenemine 2. Kriteeriumi-funktsioonide normeerimineNormeerimise tulemusena ühtlustatakse kriteeriumide muutuspiirkonnad kujule, 0<=Gi<=1.0

kasutades valemit: ja teisendades kriteeriumid (näiteks ) max peale: max Gi

= - min GiOtsus (valiku alternatiiv)

Valiku kriteeriumidMax G1 Max G2 Max(- G3)

A 0 0 1B 0.25 1 1C 0.5 0.5 0.67D 0.75 1 0.67E 1 1 0

Lubades kõrvalekallet parimast tasemest näiteks 33%, saame parimaks lahendiks D

Lubades kõrvalekallet parimast tasemest 50%, same parimateks lahendid C ja D

Lähenemine 3. Eelistusfunktsioonide määramineDefineeritakse eelistusfunkstioonid näiteks järgmiselt (joonis)

Lihtsustatult võime määrata lahendite eelistused kriteeriumide järgi näiteks kujul:ideaalne lahend Gi = >5.0 G2 => 4.0 -G3 => 4.0väga hea lahend 4.0<=G1<5.0 3.5<=G2<4.0 3.25<=-G3<4.0hea lahend 3.0<= G1 <4.0 3.0<= G2 <3.5 2.5<= -G3 <3.25rahuldav lahend 2.0<=G1<3.0 2.5<=G2<3.0 1.75<=-G3<2.5mitte soovitatav lahend 1.00< G1 <2.0 2.0< G2 <2.5 1.0< -G3 <1.75lubamatu lahend G1 <=1.0 G2 <=2.0 -G3 <=1.0

Hinnatakse iga lahendi eelistused kriteeriumide järgiOtsus (valiku alternatiiv)

Valiku kriteeriumidMax G1 Max G2 Max(- G3)

A lubamatu lubamatu ideaalneB rahuldav ideaalne ideaalneC hea hea väga heaD väga hea ideaalne heaE ideaalne ideaalne lubamatu

Nõudes näiteks vähemalt head lahendit, saame optimaalseks valikuks D (lähedase tulemuse annaks valik C)

Eelistusfunktsioone võib defineerida mitmeti:

Optimaalse valiku näide 2

Erinevate spetsialistide (isikute ) kasulikkuse võrdlemine ja kooskõlastatud valikAlternatiiv Isik I1 Isik I2 Isik I3a 0,8 0,15 0,2b 0,5 0,4 0,3c 0,35 0,9 0,1

Võimalikus erinevad lahendusvariandid Ordinaalne võrreldamatus, erinevate isikute eelistusi ei saa ühel skaala järjestada Ordinaalne võrreldavus, Erinevate isikute võrdlemine ühel skaalal on lubatud Kardinaalne võrreldamatus, Grupi liikmed määravad oma eelistuse mõõdetava ühise

kasulikkuse funktsiooniga (kaaludega). Isiku kasulikkuse erinevusi võib vaadelda kui eelistuse tugevust , kuid neid ei saa liita.

Kardinaalne võrreldavus, on tegemist mõõdetava kasulikkusfunktsiooniga, näiteks:

,

Kus m on grupil liikmete arv ja erinevatele grupi liikmetele omistatud kaalud.

3.3. Definition of Optimization problemThe goal of an optimization problem can be formulated as follows: find the combination of parameters (independent variables) which optimize a given quantity, possibly subject to some restrictions on the allowed parameter ranges. The quantity to be optimized (maximized or minimized) is termed the objective function; the parameters which may be changed in the quest for the optimum are called control or decision variables; the restrictions on allowed parameter values are known as constraints. A maximum of a function is a minimum of . Thus, the general optimization problem may be stated mathematically as:  

where is the objective function, is the column vector of the independent variables, and is the set of constraint functions. Constraint equations of the form are

termed equality constraints, and those of the form are inequality constraints. Taken together, and are known as the problem functions.

3.3.1. Klassikalised optimeerimisülesanded. Optimization by Differential Calculus.Funktsiooni maksimumi ja miinimumi määramine

Local Global Minimum or Maximum of FunctionsA sufficient condition for a stationary point x* to be an extreme point is that the matrix of second partial derivatives (also called the Hessian matrix) of f(x) evaluated at x* is: (1) positive definite when x* is a minimum point, and (2) negative definite when x* is a maximum point.

3.3.2. Lagrange’i meetodEeldame , et on sihifunktsioon

Lagrange’i funktsioon L avaldub kujul:

Optimaalne punkt/lahend (x,y) peab rahuldama tingimus (võrrandsüsteemi)

3.4. Matemaatilise planeerimise meetodid3.4.1. Üldine planeerimise ülesanne

Leida Tingimusel, et sihifunktsioon f:

ja oleks rahuldatud tõkked:

3.4.2. Lineaarne planeerimineÜlesande püstitus:Antud on m*n maatriks A ja m vektor b ning n vektor c, Leida:n vektor mis annab maksimumi tingimustel ehk:

Näide

Max (x1)Tingimustel x1 <= 3x1 + x2<= 5x=> 0

Linear ProgrammingThe standard form of a linear programming problem with m constraints and n variables is as follows:

Mimimize (or Maximize) Z = c1 * x1 + c2 * x2 + .... + cn * xn

Subject to:

a11 * x1 + a12 * x_2 + ... + a1n * xn <= b1a21 * x1 + a22 * x2 + ... + a2n * xn <= b2…….....am1 * x1 + am2 * x2 + ... + amn * xn <= bm

x1 >= 0; x2 >= 0; ..... xn >= 0.Matrix Notation In matrix form, the standard linear programming problem is:

Minimize (or maximise) Z = C*XSubject to A*X <= B, X >= 0

Here, C is a 1-by-n row vector for the system cost, A is a m-by-n coefficient matrix, X is a n-by-1 decision vector, and B is a m-by-1 requirement/constraint vector.

Example. Suppose that we wish to maximize

Objective = 10*x1 + 11*x2Subject to the constraint pair: 5*x1 + 4*x2 <= 40 2*x1 + 4*x2 <= 24and x1 >= 0 and x2 >= 0. Together these four constraints define the feasible domain shown in Figure.

Figure. Graphical Solution of Import Problem

A number of computationally efficient algorithms have been devised for the calculation of unique solutions (when they exist). Unbounded Feasible Domain Figure X shows a scenario where the feasible domain is unbounded. The arrow shows the direction of increasing objective function value.

Figure. Optimization Problem with Unbounded Feasible Domain

Even though the feasible domain is unbounded, a solution to the minimum objective function exists (it lies at the origin). However, a maximum value for the objective function does not exist. Corner point solution methods Theoretical considerations in linear optimization indicate that an optimal solution to any problem will lie at a corner point (or extreme point) within the feasible domain. Hence, in the corner-point solution method, we find the optimal solution by systematically evaluating the objective function at all of the corner points in the feasible design space. Example. Figure 6 shows the feasible domain of the aforementioned problem together with the objective function evaluated at a corner point.

Figure . Graphical Solution of Import Problem

NäitedProduct-mix ProblemA production resource optimisation problem is solved by identifying the firm possesses (materials and labour) and allocating them in most efficient way, i.e. the products and their amounts are determined to ensure maximum profit.

Suppose, that according to firm's five-year plan five main items should be produces: A, B, C, D, E. Since any of this items requires particular amount for raw material and labour input, the analysis will be performed in order to find out:1. Is used product mix optimal?2. If not, what product mix will assure the maximal profit?

In maximising profit two major restrictions are encountered: 1. All costs related to raw materials procurement may not exceed those presented in plan2. 2. Labour constraint should be considered also, suppose that there are 300 workers

directly employed in the production, total labour hours available for six month period will be

300*8*22*6=316 800(H)

Times to produce one item as well as revenues and raw material costs for each item are presented in table

No. Item Process in time,

H

Raw material cost, kr

Revenuekr

1 A 0,43 22,80 8,502 B 0,74 46,80 15,003 C 0,48 47,30 9,704 D 0,35 27,80 7,005 E 0,46 32,30 9,20

Since the objective is to maximise profit, the objective function may be written as follows

Where amounts of products A, B, C, D, E in thousands

The constraints may be written as follows:

The solution for the proposed task is

Objective function value: 6 357,313 kr.

That means, if we'll produce 297,426 products A and 255,279 products B, we'll get maximal profit of 6 357,313 kr. Production of any amount products C, D, E under current conditions will only diminish net profit.Computational Efficiency (complexity) of the Linear Programming (Simplex) methodIt has been pointed out by many researchers in mathematical programming that the simplex method, viewed purely from a theoretical standpoint, is not an efficient method, since it examines adjacent basic feasible solutions only (i.e., changing one basic variable at a time). It is felt that the method can move faster to an optimal solution if it examines nonadjacent solutions as well (i.e., changing more than one basic variable at a time). But many of the suggested variants to the simplex method did not produce any appreciable change in the total computational time. Hence the basic simplex method is still considered to be the best procedure for solving LP problems. A survey of many of the variants of the simplex method is given by Barnes and Crisp.

The computational efficiency of the simplex method depends on the number of iterations (basic feasible solutions) required to reach the optimal solution, and the total computer time needed to solve the problem. Much effort has been spent on studying computational efficiency with regard to the number of constraints and the decision variables in the problem.

Empirical experience with thousands of practical problems shows that the number of iterations of a standard linear program with m constraints and n variables varies between m and 3m, the average being 2m. A practical upper bound for the number of iterations is 2(m +

n), although occasionally problems have violated this bound.Computational time is found to vary approximately in relation to the cube of the number

of constraints in the problem (m³). For example, if Problem A hastwice as many constraints as Problem B, then the computer time for Problem A will be about eight times that of Problem B.The computational efficiency of the simplex method is more sensitive to the number of constraints than to the number of variables. Hence the general recommendation is to keep the number of constraints as small as possible by avoiding unnecessary or redundant constraints in the formulation of the LP problem.

SENSITIVITY ANALYSIS IN LINEAR PROGRAMMINGSometimes it's not enough only to find the optimal production amounts but is necessary to find out when the production of neglected items become profitable. Sensitivity analysis may help in this case. In all LP models the coefficients of the objective function and the constraints are supplied as input data or as parameters to the model. The optimal solution obtained by the simplex method is based on the values of these coefficients. In practice the values of these coefficients are seldom known with absolute certainty, because many of them are functions of some uncontrollable parameters. For instance, future demands, the cost of raw materials, or the cost of energy resources cannot be predicted with complete accuracy before the problem is solved. Hence the solution of a practical problem is not complete with the mere determination of the optimal solution.Sensitivity analysis is the study of how sensitive optimal solutions are to errors in data, model parameters, and changes to inputs in the linear programming problem. Sensitivity analysis is important because it enables flexibility and adaptation to changing conditions -- sensitivity analysis checks relationships such as the impact of changes in external (uncontrollable) variables and parameters, and decision variables, on the system outputs/outcome. The result can be increased confidence in a model and the decision making situations supported by the model.

Two important applications of sensitivity analysis are adding details to models to eliminate large sensitivities, and obtaining better information about estimates of sensitive input parameters and modelling parameters.

Questions we want to Answer by modelling The sensitivity analysis provides two kinds of useful information:1. Allowable increase/decrease in objective coefficient ranges2. Allowable increase/decrease in right-hand side ranges.If any of the values are in these allowable ranges, the optimal value will remain unchanged.

Each variation in the values of the data coefficients changes the LP problem, which may in turn affect the optimal solution found earlier. In order to develop an overall strategy to meet the various contingencies, one has to study how the optimal solution will change with changes in the input (data) coefficients. This is known as sensitivity analysis or post-optimality analysis.Other reasons for performing a sensitivity analysis are:

1. Some data coefficients or parameters of the linear program may be controllable; for example, availability of capital, raw material, or machine capacities. Sensitivity analysis enables us to study the effect of changes in these parameters on the optimal solution. If it turns out that the optimal value (profit/cost) changes (in our favour) by a considerable amount for a small change in the given parameters, then it may be worthwhile to implement some of these

changes. For example, if increasing the availability of labour by allowing overtime contributes to a greater increase in the maximum return, as compared to the increased cost of overtime labour, then we might want to allow overtime production.

2. In many cases, the values of the data coefficients are obtained by carrying out statistical estimation procedures on past figures, as in the case of sales forecasts, price estimates, and cost data. These estimates, in general, may not be very accurate. If we can identify which of the parameters affect the objective value most, then we can obtain better estimates of these parameters. This will increase the reliability of our model and the solution.

3.4.3. PARAMETRIC PROGRAMMINGThe discussion of sensitivity analysis in the previous section considered the effect of variations in the input coefficients when these coefficients are changed one at a time. When simultaneous variations occur in the input data, one can use 100% rule. In this section, we consider the effects of simultaneous changes in data, where the coefficients change as a function of one parameter. Hence, this is called parametric programming, and is simply an extension of sensitivity analysis. We shall consider the following parametric problems:(1)cost problem, and (2) the right-hand-side problem.The Parametric Cost ProblemConsider a linear program of the form:Minimize: Subject to: Ax=b x>=0where c is the given cost vector, c* is the given variation vector, and λ is an unknown positive or negative parameter. Varying the value of λ changes the cost coefficients of all the variables. We are interested in finding the family of optimal solutions for all values of λ in the range - to + .Parametric Right-Hand-Side ProblemThe right-hand-side constants in a linear programming problem represent the limits on the resources and the outputs. It is not necessary that all the resources be independent of one another. It is quite possible in a practical problem that a shortage of one resource may be accompanied by shortages in other resources at varying levels. This is true of the outputs as well. For example, consider a manufacture of electrical appliances. A shortage of electricity (or increased utility cost) may affect the demands for all his products at varying degrees depending on their energy consumptions. In all these problems we are considering simultaneous changes in the right-hand-side constants when they are functions of one parameter, and studying their effects on the optimal solution.Consider a parametric right-hand-side problem of the form:

Maximize: Subject to:

where:b is a known right-hand-side vector,b* is the variation vector, andα is an unknown parameter

As the value of α changes, the values of the right-hand-side constants change. We are

interested in determining the family of optimal solutions for all values of α from - to + .

3.4.4. Duaalne planeerimisülesanneLähteülesanne:

Duaalne ülesanne .

The primal linear program solution answers the tactical question when it tells us how much to produce. But the dual can have far greater impact because it addresses strategical issues regarding the structure of the business itself.

The Use of Microsoft Solver for Sensitivity Analysis

Sensitivity Limits for Right-Hand SidesSensitivity Limits for Objective Coefficients

The present primal optimal quantities will be exactly the same for any level of profit falling with those limits.

For example, if the table and chair profits are both $10, only P changes, to $10(4) + 10(9) = $130.

Post-Optimality AnalysisPerhaps the most important role of the dual planning is helping the decision maker improve the business itself.That can be done with a post-optimality analysis in which a series of changes are made to the problem structure ( and hence business environment).

Some possible Decisions and Changes are: Find economic bottlenecks, get more resources: Authorize overtime or train new employees. Install faster machines or expand plant. Target marketing, expand profitable products. Adjust pricing. Solve New LPs after each possible change.

3.4.5. Täisarvuline planeerimine. Integer ProgrammingDiskreetsete muutujatega ülesande optimeerimine

Combinatorial and Integer Optimization. Integer ProgrammingIn all the optimization techniques considered so far, the design variables are assumed to be continuous, which can take real value. In many situations, it is entirely appropriate and possible to have fractional solutions. However, there are practical problems in which the fractional values of design variable are neither practical or physically meaningful. That's why we need to introduce integer programming.

When all the variables are constrained to take only integer values in an optimization problem, it is called an "all integer programming problem", when only some variables are restricted to take integer values, the optimization problems is called a mixed integer programming problem.

The versatility of the combinatorial optimization model stems from the fact that in many practical problems, activities and resources, such as machines, airplanes and people, are indivisible. Also, many problems have only a finite number of alternative choices and consequently can appropriately be formulated as combinatorial optimization problems -- the word combinatorial referring to the fact that only a finite number of alternative feasible solutions exists. Combinatorial optimization models are often referred to as integer programming models where programming refers to "planning" so that these are models used in planning where some or all of the decisions can take on only a finite number of alternative possibilities.

Combinatorial optimization is the process of finding one or more best (optimal) solutions in a well defined discrete problem space. Such problems occur in almost all fields of management (e.g. finance, marketing, production, scheduling, inventory control, facility location and layout, data-base management), as well as in many engineering disciplines (e.g. manufacturing process planning,VLSI-circuitry design and testing, design and analysis of data networks, determination of minimum energy states for alloy construction, energy resource-planning models, logistics of electrical power generation and transport, the scheduling of lines in flexible manufacturing facilities, and problems in crystallography).

We assume throughout this discussion that both the function to be optimized and the functional form of the constraints restricting the possible solutions are linear functions. Although some research has centered on approaches to problems where some or all of the functions are nonlinear, most of the research to date covers only the linear case.

The general linear integer model is

subject to:

where B is the set of zero-one variables, I is the set of integer variables, C is the set of continuous variables. The data lj and uj are the lower and upper bound values, respectively, for variable xj. If C = I ={0}, then the problem is referred to as a pure 0-1 linear-programming problem; if C={0}, the problem is called a pure integer (linear) programming problem. Otherwise, the problem is a mixed integer (linear) programming problem.

3.4.6. Mittelineaarne planeerimineEnamik praktikas kerkivatest planeerimisülesannetest püütakse esitada lineaarsetena, tarvitseb vaid põhilised seosed aproksimeerida lineaarsete funktsioonide abil. Sageli tuleb aga projekteerimisülesannetes mõned kitsendused või sihifunktsioon esitada mittelineaarse sõltuvusega , saame mittelineaarse planeerimise ülesande.

Mittelineaarset planeerimist võib esitada kujul:

Lagrange`i funktsiooni kasutamine sobib ülesandele:.

Näide. Sihifunktsiooni esitamine

Näide Mittelineaarse optimeerimise näide

Lubatavate suundade( gradientide) meetod

Joonis . Mittelineaarse optimeerimise näide

Kodutöö 4. Lineaarse (mittelineaarse) optimeeerimise ülesande lahendamine Excel Solveriga Kasutades Excel Solveri vahendeid püstitada ja lahendada lineaarse (mittelineaarse) planeerimise ülesanne . Hinnata (analüüsida ) optimaalset lahendit. lahendades järgmisi ülesandeid:

1. Optimeerimusmudeli koostamine, lähtudes oma valdkonnale valitud tüüpilisest ülesannete tüüpidest(kas lineaarne või mittelineaarne mudel) .sh optimeeritavate parameetrite(kas pidevad või diskreseetsed väärtused) , sihifunktsiooni ja tõkkete funktsioonide esitamine Excelis

2. Optimeerimisülesande püstitamine ja lahendamine Excel Solveriga.3. Lahendite analüüs, sh tõkete analüüs, lahendi tundlikkus hindamine.

Näide: Mittelineaarse planeerimise näide Excel Solveriga(Lihtsa) mittelineaarse planeerimise mudeli esitamine Excelis.

Pöördumine Solveri poole

Kodutöös 4 võib Exceli asemel kasutada ka MATLABI vahnedeid.

Küsimused seoses kodutööga 4

Kirjeldada ning põhjendada optiimaalse planeerimise mudeli , sihifunktsiooni ja tõkete valikut.

Anda hinnang leitud lahenditele Hinnata kuidas oleks võimalik optimaalsuse taset parandada.

3.4.8. Stohhastiline planeerimineStohhastiline planeerimine uurib juhuslikest parameetritest sõltuvate ekstreemumülesannete lahendusmeetodeid ja teooriat. Sellistes ülesannetes pole sageli võimalik täpselt arvutada funktsioonide väärtusi, neid suurusi saab vaid hinnata statistiliste meetodite abil.

Juhuslike parameetrite korral algavad raskused juba ülesande püstitamisel, kui tuleb adekvaatselt arvestada mittetäielikku informatsiooni korral tekkivaid probleeme. Lihtsustatult võib stohhastilise planeerimise ülesande püstitusi esitada järgmiselt: M-mudel. Kõik juhuslikud suurused asendatakse nende kekkväärtustega. P- mudel. Osa või kõik kitsendused peavad olema täidetud etteantud tõenäosusega. Kaheetapiline ülesanne. Põhineb trahvifunktsiooni meetodil . Minimiseerimise korral

liidetakse sihifunktsioonile keskmine trahv kitsenduste rikkumise eest. Lahendite jaotuse hindamine jne.

3.4.9. Multiobjective Optimization Models For Engineering Design Most real world decision-making and design problems are inherently multiobjective. Yet, many mathematical programming models, such as linear programming (LP) models, require that the decision maker (DM) construct one aggregate objective function that is usually subjected to constraints. Additionally, most real-world objectives exist in an imprecise environment. And yet, many mathematical programming frameworks require precise statements of the objectives at the problem formulation stage. These observations bring to light serious impediments to the practical application of mathematical programming. Thus, the practitioner would benefit immensely from a general framework for decision-making that possesses two key features:

First, the framework must allow the problem formulation to retain its multiobjective character (i.e., the DM should not be forced to form a weighted sum of several criteria for the sole purpose of conforming to the prevailing mathematical paradigm).

Second, the problem statement should allow for the possibility of deliberate imprecision in the statement of the preferences.

It is suggested that Goal Programming (GP) possesses the first feature, while Physical Programming possesses both, making the latter a more versatile tool. Goal programming, generally applied to linear problems, deals with the achievement of prescribed goals or targets. First reported by Charnes and Cooper (1955, 1961), it was extended by Ijiri (1965), Lee (1972), and Ignizio (1976). The original approach by Charnes and Cooper is known as the Archimedean approach and is non-preemptive in that goals are comparable and differ by numerical weights and can be represented by a utility function. Many researchers feel that utility functions offer the ideal way to solve a multiple objective program (Steuer (1989)). Traditionally, it has been considered nearly impossible to obtain a mathematical representation of the DM’s true preference (utility function) (Cohon (1978), Stadler (1988)).

The major advantage of using a utility function approach is that if it is correctly assessed and used, it will practically ensure the most satisfactory solution to the DM. Unfortunately, no practical approach exists for forming utility functions in a multiobjective setting. Unlike the single objective utility function case, the multiobjective utility function must properly account for the inter-sensitivity (or inter-dependence) among its individual terms/criteria.Multiple Criteria Decision Making (MCDM) is a branch of Operations Research/ Management Science which is concerned with the methods and procedures by which multiple criteria can be formally incorporated into the analytical process. MCDM can be divided into two parts, viz., Multiattribute Decision Analysis (MDA) and Multiple Criteria Optimization (MCO). The former is often applicable to problems with a small number of alternatives in a probabilistic environment, while the latter is applied to deterministic problems where the number of feasible alternatives is large. Linear goal programming (GP) falls under the category of MCO, which is broad in scope.The proper formation of an aggregate objective function requires the verbal and mathematical expression of both intra- and inter-criteria preference. In the linear domain, GP is the only method that expresses intra-criterion preference. This expression of preference is typically achieved in a rather crude way. A single scalar goal and two deviational variables to which two weights are associated are employed, resulting in a bilinear function. The only fundamental deviation from this formulation paradigm (known to these authors) was proposed by Charnes and Cooper (1977) where a piecewise linear minimizing function for each criterion is possible. While this approach brings significant new flexibility to the problem formulation, the lack of a method for determining a large number of resulting weights and target range-limits made this method impractical. To address the difficulties associated with setting weights and goals, some researchers have undertaken the development of goal programming approaches that allow for a fuzzy problem formulation environment (Narasimhan (1980), Odom et al. (1979)), where fuzzy sets are employed. However, these approaches, too, require the prescription of a scalar goal for each criterion. What sets them apart from conventional goal programming is: their algorithms treat the goals with a certain degree of uncertainty, thereby making them less sensitive to the goal values.

3.4.10. Dünaamiline planeerimineDünaamilist optimeerimist kasutatakse mitmesammuliste optimeerimisülesannete lahendamiseks. Dünaamilist planeerimist tuleb esmajoones mõelda kui teatud mõtlemise/analüüsi instrumenti.

3.4.11. Mängude teooriaKonfliktsituatsioonid. Mänguteooria põhimõisted.Inimkollektiivide tegevuses kohtume sageli olukordi , kus soovitatava eesmärgi saavutamine ei sõltu ainult selle kollektiivi tegevusest. Niisuguseid situatsioone , kus lõpptulemus sõltub vähemalt kahe poole tegevusest ning nende poolte huvid täielikult ei ühti , nimetatakse konfliktsituatsioonideks. Matemaatilist distsipliini , mis uurib võimalusi optimaalsete tegutsemiseeskirjade väljatöötamiseks konfliktsituatsioonides nimetatakse mänguteooriaks, vastavaid abstraktseid mudeleid nimetatakse mängudeks.Selleks , et mängu saaks matemaatiliste meetoditega uurida , tuleb kõigepealt täpselt formuleerida mängu reeglid,. Nendes reeglites peavad olema fikseeritud mängijate võimalikud aktsioonid (käigud), mängu kulgemisest saadava informatsiooni ulatus, tingimused , millal mäng lõppeb ja meetod mängu tagajärgede leidmiseks igal konkreetsel juhul. Mängu normaalkuju

Olgu iga mängija (i=1,…,n) jaoks antud tema strateegiate hulk ja reaalarvuliste väärtustega võidufunktsioon mis on määratud otsekorrutisel (st iga valiku

korral on määratud reaalarv Siis nende hulkade

ja funktsioonide süsteemi nimetatakse n isiku normaalkujuliseks mänguks.

Tavaliselt vaadeldakse mänge ainult normaalkujul, kusjuures tavaliselt eeldatakse, et tegemist on nullsummaga mänguga, st strateegiate igasuguse valiku korral kehtib võrdsus

.

Mängu maatriksOlgu mängijad Aja B , nende võimalikus strateegiad ja Mängija Astrateegia ja mängija B strateegia võidufunktsioonide väärtusi tähistame vastavalt

. Nullsumamga mängu korral .Kasutades neid tähiseid iga strateegia ja mängija korral saame mängu maatriksi kujul:

B1 B2 ….. BnA1 a11 a12 …. a1nA2 a21 a22 …. a2n….. ….. …… ….. …..Am am1 am2 …... amn

Joonis. Mängu maatriksNäide

B1 B2A1 3 -2A2 -12 8

Sadulpunkt ja selle leidmineVaatleme mängu

B1 B2 B3 B4A1 6 0 1 5A2 5 4 2 3A3 -1 5 1 0

Mängijale A parim garanteeritud ohutuim võit on 2, strateegia A2. Mängija B ohutuim strateegia on B3, , halvima võimaliku tulemusega –2.: Kui mõlemad mängijad kasutavad oma ohutumaid strateegiad osutub mängu tagajärjeks a23=2 ja b23=-2. Lihtne on kontrollida , et kui üks mängijatest loobub oma ohutuima strateegia kasutamisest , siis sellest tema võit ainult väheneb. Mängu maatriksi vastavat elementi nimetatakse sadulpunktiks.Mängu sadulpunkt ei tarvitse olla üheselt määratud. 4. Tehniliste süsteemide ja – protsesside simuleerimine.

Simulation 4.1. BASIC CONCEPTS

Simulation analysis is a natural and logical extension to the analytical and mathematical models inherent in operations research. The preceding chapters of this material have been concerned with formulating decision models that not only closely approximate the real-world environment but also produce answers through standard numerical and/or mathematical manipulations of the resulting equations. It is evident that there are many situations that cannot be represented mathematically because of the stochastic nature of the problem, the complexity of problem formulation, or the interactions needed to adequately describe the problem under study. For many situations defying mathematical formulation, simulation is the only tool that might be used to obtain relevant answers.

The word simulation has been used rather loosely in the preceding discussion. Therefore, before we proceed it will be necessary to develop a working definition of this term. The following definition has been adopted from Naylor et al.

Simulation is a numerical technique for conducting experiments on a digital computer, which involves logical and mathematical relationships that interact to describe the behaviour and structure of a complex real-world system over extended periods of time.

Simulation has often been described as the process of creating the essence of reality without ever actually attaining that reality itself. Simulation will involve the construction, experimentation, and manipulation of a complex model on a digital computer.

Although simulation is sometimes viewed as a "method of last resort," often to be employed when all else fails, recent advances in simulation methodologies, software availability, and technical developments have made simulation one of the most widely used and accepted tools in systems analysis and operations research. Most recent surveys on the use of operations research methodologies place simulation analysis either first or second to linear programming applications. In addition to the reasons previously stated, Naylor has suggested that simulation analysis might be appropriate for the following reasons.

1. Simulation makes it possible to study and experiment with the complex internal actions of a given system whether it be a firm, an industry, an economy or some subsystem of one of them.2. Through simulation, one can study the effects of certain information, organizational and environmental changes of the operation of a system by making alterations in the model of the system and by observing the effects of these alterations on the system behaviour.3. A detailed observation of the system being simulated may lead to a better understanding of the system and to suggestions for improving it, which otherwise would be unobtainable.4. Simulation can be used as a pedagogical device for teaching both students and practitioners basic skills in theoretical analysis, statistical analysis, and decision making.5. The experience of designing a computer simulation model may be more valuable than the actual simulation itself. The knowledge obtained in designing a simulation studies frequently suggests changes in the system being simulated. The effects of these changes can then be tested via simulation before implementing them on the actual system.6. Simulation of complex systems can yield valuable insight into which variables are more important than the others in the system and how these variables interact.7. Simulation can be used to experiment with new situations about which we have little or no information, so as to prepare for what may happen.8. Simulation can serve as a "pre-service test" to try out new policies and decision rules for operating a system, before running the risk of experimenting on the real system.9. For certain types of stochastic problems the sequence of events may be of particular importance. Information about expected values and moments may not be sufficient to describe the process. In these cases, simulation methods may be the only satisfactory way of providing the required information.10. Simulation analysis can be performed to verify analytical solutions.

11. Simulation enables one to study dynamic systems in either real time or expanded time.12. When new elements are introduced into a system, simulation can be used to anticipate bottlenecks and other problems that may arise in the behaviour of the system.

Simulation analysis always begins with a model of the system that needs to be studied. In digital computer simulation this step is accomplished through the construction of a computer program that "describes" the system under study to the appropriate computer configuration.

THE PHILOSOPHY, DEVELOPMENT AND IMPLEMENTATION OF SIMULATION MODELLINGSimulation is one of the easiest tools of management and engineering sciences to use, but probably one of the hardest to apply properly and perhaps the most difficult from which to draw accurate conclusions. With the widespread use of powerful computers, simulation is readily available to most managers and engineers engaged in operations research activities. However, the skills required to develop and to operate an effective simulation model are substantial. The variability or dispersion of simulation results is a significant problem and may require long and complex simulation analysis to – to draw meaningful conclusions from the simulation.

Pre-simulation ActivitiesIn any general view of situations in which systems simulation is used, the first activity is a recognition of the problem. This recognition leads directly to the study and analysis of the system itself and culminates in the establishment of an objective directed toward solving the problem. Typical objectives could be categorized follows:

Characterization of system performance: Selection of operation parameters for an existing system. Selection of operation parameters for a proposed system. Exploration of system behaviour. Modification of an existing system. Design of a new system.

Simulation is the appropriate technique where it is not feasible to experiment on the system itself or where direct analytic techniques are not available.

GENRATION OF RANDOM DEVIATES (pseudo-random numbers)In nearly all simulation experiments there exists a need for generating random statistical deviates from a certain distribution. The distribution will be the one that adequately describes and represents the physical process involved at that point in the experiment. During an actual simulation experiment, this process of generating a random deviate from a particular distribution may have to be done many times for many distributions, depending on the complexity of the model being investigated by the experiment.GENERATION OF RANDOM NUMBERSProducing a number by same algorithm takes away same of randomness that it should process. A “truly" random" number or occurrence can be produced only by same physical phenomenon, such as white noise. For this reason , numbers produced by algorithms are correctly referred to, as pseudorandom numbers. Understanding this, pseudorandom numbers shall from this point be referred to as random numbers.

DESIGN OF SIMULATION EXPERIMENTSOnce a simulation model has been constructed and meaningful system statistics are being generated, the experimenter may be interested in learning more about the underlying structure

or properties of the system being studied, In particular, it might be desirable to quantify the effects of deliberately changing relevant factors over a given region of interest. Through an investigation of simulation output it is possible to create a response surface in which the various factors involved are designated at different levels of operation. To characterize these surfaces, experimental designs are often used to analyze, quantify, and predict the effects of response-surface change. Experimental designs such as full factorials, latin squares, fractional designs, and rotatable designs have been successfully employed with digital simulation experiments. Through the use of linear and curvilinear regression, the results of these experiments have been reduced to formulas that can predict system behaviour over a wide range of changes. The primary purpose of experimental designs is to determine which variables are most important, how these variables influence the response of our simulation model, and why certain results occur as they do in the simulation experiment. Experimental designs are expected to play an increasingly important role in future analysis of digital simulation output.

OPTIMIZATION OF SIMULATION PARAMETERSAlthough simulation is primarily a tool for systems analysis, there is no reason why one should not employ it for systems optimization when the model is appropriate. Optimization of simulation experiments can be achieved through an interface with the tools of linear and nonlinear programming.

4.2. Simulating the technical system using SIMULINK

Simulink, developed by The MathWorks, is a tool for modeling, simulating and analyzing multidomain dynamic systems. Its primary interface is a graphical block diagramming tool and a customizable set of block libraries. It offers tight integration with the rest of the MATLAB environment and both drive MATLAB or be scripted from it. Simulink is widely used in control theory and digital signal processing for multidomain simulation and design.

IntroductionSimulink® is an environment for multidomain simulation and Model-Based Design for dynamic and embedded systems. It provides an interactive graphical environment and a customizable set of block libraries that let you design, simulate, implement, and test a variety of time-varying systems, including communications, controls, signal processing, video processing, and image processing. Simulink is integrated with MATLAB®, providing immediate access to an extensive range of tools that let you develop algorithms, analyze and visualize simulations, create batch processing scripts, customize the modeling environment, and define signal, parameter, and test data. Key Features

← Extensive and expandable libraries of predefined blocks ← Interactive graphical editor for assembling and managing intuitive block diagrams ← Ability to manage complex designs by segmenting models into hierarchies of design

components ← Model Explorer to navigate, create, configure, and search all signals, parameters,

properties, and generated code associated with your model ← Application programming interfaces (APIs) that let you connect with other simulation

programs and incorporate hand-written code ← Embedded MATLAB™ Function blocks for bringing MATLAB algorithms into

Simulink and embedded system implementations

← Simulation modes (Normal, Accelerator, and Rapid Accelerator) for running simulations interpretively or at compiled C-code speeds using fixed- or variable-step solvers

← Graphical debugger and profiler to examine simulation results and then diagnose performance and unexpected behavior in your design

← Full access to MATLAB for analyzing and visualizing results, customizing the modeling environment, and defining signal, parameter, and test data

← Model analysis and diagnostics tools to ensure model consistency and identify modeling errors

Simulink Basics TutorialSimulink is a graphical extension to MATLAB for the modeling and simulation of systems. In Simulink, systems are drawn on screen as block diagrams. Many elements of block diagrams are available (such as transfer functions, summing junctions, etc.), as well as virtual input devices (such as function generators) and output devices (such as oscilloscopes). Simulink is integrated with MATLAB and data can be easily transferred between the programs. In this tutorial, we will introduce the basics of using Simulink to model and simulate a system. Simulink is supported on Unix, Macintosh, and Windows environments, and it is included in the student version of MATLAB for personal computers.

Starting SimulinkSimulink is started from the MATLAB command prompt by entering the following command:

simulinkThe Simulink Library Browser window should now appear on the screen. Most of the blocks needed for modeling basic systems can be found in the subfolders of the main "Simulink" folder (opened by clicking on the "+" in front of "Simulink").  Once the "Simulink" folder has been opened, the Library Browser window should look like:

Basic ElementsThere are two major classes of elements in Simulink: blocks and lines. Blocks are used to generate, modify, combine, output, and display signals. Lines are used to transfer signals from one block to another. BlocksThe subfolders underneath the "Simulink" folder indicate the general classes of blocks available for us to use:

Continuous:  Linear, continuous-time system elements (integrators, transfer functions, state-space models, etc.)

Discrete:  Linear, discrete-time system elements (integrators, transfer functions, state-space models, etc.)

Functions & Tables:  User-defined functions and tables for interpolating function values

Math:  Mathematical operators (sum, gain, dot product, etc.) Nonlinear:  Nonlinear operators (coulomb/viscous friction, switches, relays, etc.) Signals & Systems:  Blocks for controlling/monitoring signal(s) and for creating

subsystems Sinks:  Used to output or display signals (displays, scopes, graphs, etc.) Sources: Used to generate various signals (step, ramp, sinusoidal, etc.)

Blocks have zero to several input terminals and zero to several output terminals. Unused input terminals are indicated by a small open triangle. Unused output terminals are indicated by a small triangular point. The block shown below has an unused input terminal on the left and an unused output terminal on the right.

LinesLines transmit signals in the direction indicated by the arrow. Lines must always transmit signals from the output terminal of one block to the input terminal of another block. One exception to this is that a line can tap off of another line.  This sends the original signal to each of two (or more) destination blocks, as shown below:

Lines can never inject a signal into another line; lines must be combined through the use of a block such as a summing junction. A signal can be either a scalar signal or a vector signal. For Single-Input, Single-Output systems, scalar signals are generally used. For Multi-Input, Multi-Output systems, vector signals are often used, consisting of two or more scalar signals. The lines used to transmit scalar and vector signals are identical. The type of signal carried by a line is determined by the blocks on either end of the line. Building a SystemTo demonstrate how a system is represented using Simulink, we will build the block diagram for a simple model consisting of a sinusoidal input multiplied by a constant gain, which is shown below:

This model will consist of three blocks:  Sine Wave, Gain, and Scope.  The Sine Wave is a Source Block from which a sinusoidal input signal originates.  This signal is transferred through a line in the direction indicated by the arrow to the Gain Math Block.  The Gain block modifies its input signal (multiplies it by a constant value) and outputs a new signal through a line to the Scope block.  The Scope is a Sink Block used to display a signal (much like an oscilloscope).We begin building our system by bringing up a new model window in which to create the block diagram.  This is done by clicking on the "New Model" button in the toolbar of the Simulink Library Browser (looks like a blank page).  Building the system model is then accomplished through a series of steps:

1. The necessary blocks are gathered from the Library Browser and placed in the model window.

2. The parameters of the blocks are then modified to correspond with the system we are modelling.

3. Finally, the blocks are connected with lines to complete the model. Each of these steps will be explained in detail using our example system.  Once a system is built, simulations are run to analyze its behavior.  Gathering BlocksEach of the blocks we will use in our example model will be taken from the Simulink Library Browser.  To place the Sine Wave block into the model window, follow these steps:

1. Click on the "+" in front of "Sources" (this is a subfolder beneath the "Simulink" folder) to display the various source blocks available for us to use.

2. Scroll down until you see the "Sine Wave" block.  Clicking on this will display a short explanation of what that block does in the space below the folder list:

     3.  To insert a Sine Wave block into your model window, click on it in the Library Browser and drag the block into your workspace.The same method can be used to place the Gain and Scope blocks in the model window.   The "Gain" block can be found in the "Math" subfolder and the "Scope" block is located in the "Sink" subfolder.  Arrange the three blocks in the workspace (done by selecting and dragging an individual block to a new location) so that they look similar to the following:

Modifying the BlocksSimulink allows us to modify the blocks in our model so that they accurately reflect the characteristics of the system we are analyzing.  For example, we can modify the Sine Wave block by double-clicking on it.  Doing so will cause the following window to appear:

This window allows us to adjust the amplitude, frequency, and phase shift of the sinusoidal input.  The "Sample time" value indicates the time interval between successive readings of the signal.  Setting this value to 0 indicates the signal is sampled continuously.Let us assume that our system's sinusoidal input has:

Amplitude = 2 Frequency = pi Phase = pi/2

Enter these values into the appropriate fields (leave the "Sample time" set to 0) and click "OK" to accept them and exit the window.  Note that the frequency and phase for our system contain 'pi' (3.1415...).  These values can be entered into Simulink just as they have been shown. Next, we modify the Gain block by double-clicking on it in the model window.  The following window will then appear:

Note that Simulink gives a brief explanation of the block's function in the top portion of this window.  In the case of the Gain block, the signal input to the block (u) is multiplied by a constant (k) to create the block's output signal (y).  Changing the "Gain" parameter in this window changes the value of k.For our system, we will let k = 5.  Enter this value in the "Gain" field, and click "OK" to close the window.The Scope block simply plots its input signal as a function of time, and thus there are no system parameters that we can change for it.  We will look at the Scope block in more detail after we have run our simulation. Connecting the BlocksFor a block diagram to accurately reflect the system we are modeling, the Simulink blocks must be properly connected.  In our example system, the signal output by the Sine Wave block is transmitted to the Gain block.  The Gain block amplifies this signal and outputs its new value to the Scope block, which graphs the signal as a function of time.  Thus, we need to

draw lines from the output of the Sine Wave block to the input of the Gain block, and from the output of the Gain block to the input of the Scope block.Lines are drawn by dragging the mouse from where a signal starts (output terminal of a block) to where it ends (input terminal of another block).  When drawing lines, it is important to make sure that the signal reaches each of its intended terminals.   Simulink will turn the mouse pointer into a crosshair when it is close enough to an output terminal to begin drawing a line, and the pointer will change into a double crosshair when it is close enough to snap to an input terminal.  A signal is properly connected if its arrowhead is filled in.  If the arrowhead is open, it means the signal is not connected to both blocks.  To fix an open signal, you can treat the open arrowhead as an output terminal and continue drawing the line to an input terminal in the same manner as explained before.

Properly Connected Signal Open Signal When drawing lines, you do not need to worry about the path you follow.  The lines will route themselves automatically.  Once blocks are connected, they can be repositioned for a neater appearance.  This is done by clicking on and dragging each block to its desired location (signals will stay properly connected and will re-route themselves).After drawing in the lines and repositioning the blocks, the example system model should look like:

In some models, it will be necessary to branch a signal so that it is transmitted to two or more different input terminals.  This is done by first placing the mouse cursor at the location where the signal is to branch.  Then, using either the CTRL key in conjunction with the left mouse button or just the right mouse button, drag the new line to its intended destination.  This method was used to construct the branch in the Sine Wave output signal shown below:

The routing of lines and the location of branches can be changed by dragging them to their desired new position.  To delete an incorrectly drawn line, simply click on it to select it, and hit the DELETE key.Running SimulationsNow that our model has been constructed, we are ready to simulate the system.  To do this, go to the Simulation menu and click on Start, or just click on the "Start/Pause Simulation" button in the model window toolbar.