A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.12.

Slides:



Advertisements
Similar presentations
Calypso Construction Features
Advertisements

A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.20.
Introduction to Excel Formulas, Functions and References.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.24.
Linear Kinematics Chapter 3. Definition of Kinematics Kinematics is the description of motion. Motion is described using position, velocity and acceleration.
Basic Spreadsheet Functions Objective Functions are predefined formulas that perform calculations by using specific values, called arguments, in.
Lesson 14 Creating Formulas and Charting Data
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.17.
1 A Core Course on Modeling ACCEL (continued) a 4 categories model dominance and Pareto optimality strength algorithm Examples Week 5 – Roles of Quantities.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.13.
Quadratic Functions and Equations
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.6.
CHAPTER 2 D IRECT M ETHODS FOR S TOCHASTIC S EARCH Organization of chapter in ISSO –Introductory material –Random search methods Attributes of random search.
Describing Quantitative Data with Numbers Part 2
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.16.
Copyright © 2009 Pearson Education, Inc. PHY093 – Lecture 2a Motion with Constant Acceleration 1 Dimension 1.
16 MULTIPLE INTEGRALS.
Physics and Measurements.
More on Asset Allocation
Estimating a Population Proportion
“Teach A Level Maths” Statistics 1
The World’s Largest Ferris Wheel
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.28.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.15.
Perimeter Of Shapes. 8cm 2cm 5cm 3cm A1 A2 16m 12m 10m 12cm 7cm.
1 A Core Course on Modeling Examples street lanterns planets and gravity Week 4 – The Function of Functions.
Rates of Reactions Why study rates?
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.14.
QUADTRATIC RELATIONS. A relation which must contain a term with x2 It may or may not have a term with x and a constant term (a term without x) It can.
13.5 – The Cosine Function.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.30.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.25.
P1 Chapter 12 & 15 CIE Centre A-level Pure Maths © Adam Gibson.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.12.
In Chapters 6 and 8, we will see how to use the integral to solve problems concerning:  Volumes  Lengths of curves  Population predictions  Cardiac.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.10.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.9.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.2.
CCGPS Coordinate Algebra Unit 4: Describing Data.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 S.29.
A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.4.
Chapter 6 ANALYZING DATA STATISTICALLY There are several commonly used parameters that allow us to draw conclusions about the characteristics of a data.
WBHS Advanced Programme Mathematics
INTRODUCTION TO STATISTICS
Probability & Statistics
Probability and Statistics
Characteristics of Quadratic Functions
Introduction to Summary Statistics
Introduction to Summary Statistics
Introduction to Summary Statistics
Introduction to Summary Statistics
Two-Source Constructive and Destructive Interference Conditions
Introduction to Summary Statistics
Introduction to Summary Statistics
Box and Whisker Plots Algebra 2.
Introduction to Summary Statistics
Introduction to Summary Statistics
Inferential Statistics
Where did we stop? The Bayes decision rule guarantees an optimal classification… … But it requires the knowledge of P(ci|x) (or p(x|ci) and P(ci)) We.
1 FUNCTIONS AND MODELS.
Introduction to Summary Statistics
Statistics 1: Introduction to Probability and Statistics
Lesson 4: Introduction to Functions
Introduction to Summary Statistics
Range, Width, min-max Values and Graphs
Introduction to Summary Statistics
Introduction to Summary Statistics
Confidence Intervals = Z intervals on your Calculator
Bell Ringer Solve 8x-4=52 D.E.A.R.
Presentation transcript:

A core Course on Modeling Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 P.12

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation Remember: maxInt = max r  road c*B(r) = max r  road c*(  n p h/|L n -r| 3 ) = max r  road c*(  n p h/|L n -r| 3 )

Applying SPEA to the lantern problem Step 1: translate fromulas to an ACCEL implementation Remember: maxInt = max r  road c*B(r) = max r  road c*(  n p h/|L n -r| 3 ) = max r  road c*(  n p h/|L n -r| 3 ) Earlier we worked with a simpler formula: p/|L n -r| 2. The extra factor h/|L n -r| accounts for the effect that the brightness due to lightrays, entering under an angle , is reduced with a factor cos . Notice that cos  = h/|L n -r|.

Applying SPEA to the lantern problem Step 1: translate fromulas to an ACCEL implementation Remember: maxInt = max r  road c*B(r) = max r  road c*(  n p h/|L n -r| 3 ) = max r  road c*(  n p h/|L n -r| 3 ) minInt = min r  road c*B(r) = min r  road c*(  n p h/|L n -r| 3 ) = min r  road c*(  n p h/|L n -r| 3 )

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written as max r  road B(r), where B(... ) is a function returning the total intensity in point r = (l,w). (Height of r is 0, so we ignore the 3rd coordinate.)

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written as max r  road B(r) = max (l,w)  road B(l,w), We use quantified expressions: max r  domain B(r)  in ACCEL: #(r, domain, B(r), max) Remember from Chapter 2?

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written as max r  road B(r) = max (l,w)  road B(l,w), We use quantified expressions: max r  domain B(r)  in ACCEL: #(r, domain, B(r), max)

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written as max r  road B(r) = max (l,w)  road B(l,w), We use quantified expressions: max r  domain B(r)  in ACCEL: #(r, domain, B(r), max) A dummy quantity is the first argument of the ACCEL #(...,...,...,...) function

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written as max r  road B(r) = max (l,w)  road B(l,w), We use quantified expressions: max r  domain B(r)  in ACCEL: #(r, domain, B(r), max) The domain is a set of values, that will be assumed by the dummy. The domain is the second argument in the ACCEL # (...,...,...,...) function.

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written as max r  road B(r) = max (l,w)  road B(l,w), We use quantified expressions: max r  domain B(r)  in ACCEL: #(r, domain, B(r), max) There is a term, probably depending on the dummy (in this case B(r), depending on r) that is to be evaluated for each value of the dummy taken from the domain. This is the third argument.

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written as max r  road B(r) = max (l,w)  road B(l,w), We use quantified expressions: max r  domain B(r)  in ACCEL: #(r, domain, B(r), max) The instruction ‘max’ tells us what we should do with the outcomes of the term B(r): we should take the maximum. Other quantifications are e.g. the min(imum) or add (summation) and others. This is the fourth argument.

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written as max r  road B(r) = max (l,w)  road B(l,w), We use quantified expressions. These can be nested: max (l,w)  domain B(l,w) =max l  domainL M(l) where M(l) = max w  domainW B(l,w)

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written as max r  road B(r) = max (l,w)  road B(l,w), We use quantified expressions. These can be nested: max (l,w)  domain B(l,w) =max l  domainL M(l) so: max (l,w)  domain B(l,w) = max l  domainL ( max w  domainW B(l,w) ) max l  domainL ( max w  domainW B(l,w) )

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written as max r  road B(r) = max (l,w)  road B(l,w), We use quantified expressions. These can be nested: max l  domainL ( max w  domainW B(l,w))  in ACCEL: #(l, domainL, M(l), max)

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written as max r  road B(r) = max (l,w)  road B(l,w), We use quantified expressions. These can be nested: max l  domainL ( max w  domainW B(l,w))  in ACCEL: #(l, domainL, #(w, domainW, B(l,w), max), max)

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written in ACCEL as: #(l,domainL,#(w,domainW,B(l,w),max),max)

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written in ACCEL as: #(l,domainL,#(w,domainW,B(l,w),max),max) domainL= [0,1,2,...roadLength]=vSeq(0,roadLength+1)

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written in ACCEL as: #(l,domainL,#(w,domainW,B(l,w),max),max) domainL= [0,1,2,...roadLength]=vSeq(0,roadLength+1) domainW= [0,1,2,...roadWidth]=vSeq(0,roadWidth+1)

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written in ACCEL as: #(l,domainL,#(w,domainW,B(l,w),max),max) B(l, w) =  n B n (l, w) – again a quantified expression:  n B n (l, w)  in ACCEL: B(l,w)=#(n,domainN,Bn(l,w,n),add)

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written in ACCEL as: #(l,domainL,#(w,domainW,B(l,w),max),max) B(l, w) =  n B n (l, w) – again a quantified expression:  n B n (l, w)  in ACCEL: B(l,w)=#(n,domainN,Bn(l,w,n),add) where Bn(l, w, n) = c*p*h /r(l,w,n) 3  B(l,w,n)=c*p*h/pow(r(l,w,n),3)

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written in ACCEL as: #(l,domainL,#(w,domainW,B(l,w),max),max) B(l, w) =  n B n (l, w) – again a quantified expression:  n B n (l, w)  in ACCEL: B(l,w)=#(n,domainN,Bn(l,w,n),add) where Bn(l, w, n) = c*p*h /r(l,w,n) 3  B(l,w,n)=c*p*h/pow(r(l,w,n),3), and domainN=[0,1,2,... nLanterns-1] = vSeq(0,nLanterns)

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written in ACCEL as: #(l,domainL,#(w,domainW,B(l,w),max),max)

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written in ACCEL as: #(l,domainL,#(w,domainW,B(l,w),max),max), and similar for minInt: #(l,domainL,#(w,domainW,B(l,w),min),min) #(l,domainL,#(w,domainW,B(l,w),min),min)

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written in ACCEL as: #(l,domainL,#(w,domainW,B(l,w),max),max) Finally, we calculate r(l,w,n) using Pythagoras: r(l,w,n)=sqrt(h*h+(w-Wh)*(w-Wh)+(l-n*dL)*(l-n*dL))

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written in ACCEL as: #(l,domainL,#(w,domainW,B(l,w),max),max) Finally, we calculate r(l,w,n) using Pythagoras: r(l,w,n)=sqrt(h*h+(w-Wh)*(w-Wh)+(l-n*dL)*(l-n*dL)) The height of the lanterns, this equals the height difference with r (having height 0).

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written in ACCEL as: #(l,domainL,#(w,domainW,B(l,w),max),max) Finally, we calculate r(l,w,n) using Pythagoras: r(l,w,n)=sqrt(h*h+(w-Wh)*(w-Wh)+(l-n*dL)*(l-n*dL)) The distance measured perpendicular to the axis of the road; lanterns are above the road axis.

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation maxInt is written in ACCEL as: #(l,domainL,#(w,domainW,B(l,w),max),max) Finally, we calculate r(l,w,n) using Pythagoras: r(l,w,n)=sqrt(h*h+(w-Wh)*(w-Wh)+(l-n*dL)*(l-n*dL)) Distance measured parallel to the axis of the road: lantern nr. n has location n*dL.

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation dL=slider(25.5,15,50) h=slider(5.5,3,30) p=slider(500.1,100,10000) intPenalty=paretoMin(paretoHor(-min(minP,minInt)+max(maxP,maxInt)-(maxP-minP))) totPow=paretoMin(paretoVer(p*nLanterns)) maxP=80 minP=10 roadLength=100 roadWidth=6 Wh=roadWidth/2 maxInt=#(l,vSeq(0,roadLength+1),#(w,vSeq(0,roadWidth+1),B(l,w),max),max) minInt=#(l,vSeq(0,roadLength+1),#(w,vSeq(0,roadWidth+1),B(l,w),min),min) B(l,w)=#(n,vSeq(0,nLanterns),Bn(l,w,n),add) Bn(l,w,n)=c*p*h/pow(r(l,w,n),3) c=1 r(l,w,n)=sqrt(h*h+(w-Wh)*(w-Wh)+(l-n*dL)*(l-n*dL)) nLanterns=1+roadLength/dL

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation dL=slider(25.5,15,50) h=slider(5.5,3,30) p=slider(500.1,100,10000) intPenalty=paretoMin(paretoHor(-min(minP,minInt)+max(maxP,maxInt)-(maxP-minP))) totPow=paretoMin(paretoVer(p*nLanterns)) maxP=80 minP=10 roadLength=100 roadWidth=6 Wh=roadWidth/2 maxInt=#(l,vSeq(0,roadLength+1),#(w,vSeq(0,roadWidth+1),B(l,w),max),max) minInt=#(l,vSeq(0,roadLength+1),#(w,vSeq(0,roadWidth+1),B(l,w),min),min) B(l,w)=#(n,vSeq(0,nLanterns),Bn(l,w,n),add) Bn(l,w,n)=c*p*h/pow(r(l,w,n),3) c=1 r(l,w,n)=sqrt(h*h+(w-Wh)*(w-Wh)+(l-n*dL)*(l-n*dL)) nLanterns=1+roadLength/dL These are the category-I quantities: distance dL, height h, power p

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation dL=slider(25.5,15,50) h=slider(5.5,3,30) p=slider(500.1,100,10000) intPenalty=paretoMin(paretoHor(-min(minP,minInt)+max(maxP,maxInt)-(maxP-minP))) totPow=paretoMin(paretoVer(p*nLanterns)) maxP=80 minP=10 roadLength=100 roadWidth=6 Wh=roadWidth/2 maxInt=#(l,vSeq(0,roadLength+1),#(w,vSeq(0,roadWidth+1),B(l,w),max),max) minInt=#(l,vSeq(0,roadLength+1),#(w,vSeq(0,roadWidth+1),B(l,w),min),min) B(l,w)=#(n,vSeq(0,nLanterns),Bn(l,w,n),add) Bn(l,w,n)=c*p*h/pow(r(l,w,n),3) c=1 r(l,w,n)=sqrt(h*h+(w-Wh)*(w-Wh)+(l-n*dL)*(l-n*dL)) nLanterns=1+roadLength/dL These are the category-II quantities: penalties for energy consumption, p*nLanterns, and a penalty in case maxInt > maxP or minInt < minP

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation dL=slider(25.5,15,50) h=slider(5.5,3,30) p=slider(500.1,100,10000) intPenalty=paretoMin(paretoHor(-min(minP,minInt)+max(maxP,maxInt)-(maxP-minP))) totPow=paretoMin(paretoVer(p*nLanterns)) maxP=80 minP=10 roadLength=100 roadWidth=6 Wh=roadWidth/2 maxInt=#(l,vSeq(0,roadLength+1),#(w,vSeq(0,roadWidth+1),B(l,w),max),max) minInt=#(l,vSeq(0,roadLength+1),#(w,vSeq(0,roadWidth+1),B(l,w),min),min) B(l,w)=#(n,vSeq(0,nLanterns),Bn(l,w,n),add) Bn(l,w,n)=c*p*h/pow(r(l,w,n),3) c=1 r(l,w,n)=sqrt(h*h+(w-Wh)*(w-Wh)+(l-n*dL)*(l-n*dL)) nLanterns=1+roadLength/dL These are the category-III quantities: dimensions of the road, maxP, minP and the factor c

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation dL=slider(25.5,15,50) h=slider(5.5,3,30) p=slider(500.1,100,10000) intPenalty=paretoMin(paretoHor(-min(minP,minInt)+max(maxP,maxInt)-(maxP-minP))) totPow=paretoMin(paretoVer(p*nLanterns)) maxP=80 minP=10 roadLength=100 roadWidth=6 Wh=roadWidth/2 maxInt=#(l,vSeq(0,roadLength+1),#(w,vSeq(0,roadWidth+1),B(l,w),max),max) minInt=#(l,vSeq(0,roadLength+1),#(w,vSeq(0,roadWidth+1),B(l,w),min),min) B(l,w)=#(n,vSeq(0,nLanterns),Bn(l,w,n),add) Bn(l,w,n)=c*p*h/pow(r(l,w,n),3) c=1 r(l,w,n)=sqrt(h*h+(w-Wh)*(w-Wh)+(l-n*dL)*(l-n*dL)) nLanterns=1+roadLength/dL These are the category-IV quantities: the max- and min intensities and the functions needed to calculate these; the number of lanterns given the length of the road, and the half width of the road.

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation dL=slider(25.5,15,50) h=slider(5.5,3,30) p=slider(500.1,100,10000) intPenalty=paretoMin(paretoHor(-min(minP,minInt)+max(maxP,maxInt)-(maxP-minP))) totPow=paretoMin(paretoVer(p*nLanterns)) maxP=80 minP=10 roadLength=100 roadWidth=6 Wh=roadWidth/2 maxInt=#(l,vSeq(0,roadLength+1),#(w,vSeq(0,roadWidth+1),B(l,w),max),max) minInt=#(l,vSeq(0,roadLength+1),#(w,vSeq(0,roadWidth+1),B(l,w),min),min) B(l,w)=#(n,vSeq(0,nLanterns),Bn(l,w,n),add) Bn(l,w,n)=c*p*h/pow(r(l,w,n),3) c=1 r(l,w,n)=sqrt(h*h+(w-Wh)*(w-Wh)+(l-n*dL)*(l-n*dL)) nLanterns=1+roadLength/dL

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation The actual script has few additional features to plot B(r). maxP: no blinding minP: enough contrast intensity on road axis intensity on road border

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation The actual script has few additional features to plot B(r).

Applying SPEA to the lantern problem Step 1: translate formulas to an ACCEL implementation The actual script has few additional features to plot B(r). It does produce a Pareto plot. But it is very slow: no actual optimization possible. intPenalty totPow

Applying SPEA to the lantern problem Step 2: make the script more efficient  optimization Reasons for slow performance: iterate over l iterate over w iterate over n assume maxInt occurs underneath a lantern assume minInt occurs on the border, in the middle between two lanterns take not too many lanterns into account

Applying SPEA to the lantern problem Step 2: make the script more efficient  optimization dL=slider(25.5,15,50) h=slider(5.5,3,30) p=slider(500.1,100,10000) intPenalty=paretoMin(paretoHor(-min(minP,minInt)+max(maxP,maxInt)-(maxP-minP))) totPow=paretoMin(paretoVer(p*nLanterns)) maxP=80 minP=10 roadLength=100 roadWidth=6 Wh=roadWidth/2 maxInt=#(l,vSeq(0,roadLength+1),#(w,vSeq(0,roadWidth+1),B(l,w),max),max) minInt=#(l,vSeq(0,roadLength+1),#(w,vSeq(0,roadWidth+1),B(l,w),min),min) B(l,w)=#(n,vSeq(0,nLanterns),Bn(l,w,n),add) Bn(l,w,n)=c*p*h/pow(r(l,w,n),3) c=1 r(l,w,n)=sqrt(h*h+(w-Wh)*(w-Wh)+(l-n*dL)*(l-n*dL)) nLanterns=1+roadLength/dL

Applying SPEA to the lantern problem Step 2: make the script more efficient  optimization dL=slider(25.5,15,50) h=slider(5.5,3,30) p=slider(500.1,100,10000) intPenalty=paretoMin(paretoHor(-min(minP,minInt)+max(maxP,maxInt)-(maxP-minP))) totPow=paretoMin(paretoVer(p*nLanterns)) maxP=80 minP=10 roadLength=100 roadWidth=6 Wh=roadWidth/2 maxInt=#(l,vSeq(0,roadLength+1),#(w,vSeq(0,roadWidth+1),B(l,w),max),max) minInt=#(l,vSeq(0,roadLength+1),#(w,vSeq(0,roadWidth+1),B(l,w),min),min) B(l,w)=#(n,vSeq(0,nLanterns),Bn(l,w,n),add) Bn(l,w,n)=c*p*h/pow(r(l,w,n),3) c=1 r(l,w,n)=sqrt(h*h+(w-Wh)*(w-Wh)+(l-n*dL)*(l-n*dL)) nLanterns=1+roadLength/dL

Applying SPEA to the lantern problem Step 2: make the script more efficient  optimization dL=slider(25.5,15,50) h=slider(5.5,3,30) p=slider(500.1,100,10000) intPenalty=paretoMin(paretoHor(-min(minP,minInt)+max(maxP,maxInt)-(maxP-minP))) totPow=paretoMin(paretoVer(p*nLanterns)) maxP=80 minP=10 roadLength=100 roadWidth=6 Wh=roadWidth/2 maxInt=B(dL*round(nLanterns/2),Wh) minInt=B(dL*(round(nLanterns/2)+round(nLanterns/2)+1)/2,0) B(l,w)=#(n,vSeq(round(nLanterns/2)-N,round(nLanterns/2)+N+1),Bn(l,w,n),add) Bn(l,w,n)=c*p*h/pow(r(l,w,n),3) c=1 r(l,w,n)=sqrt(h*h+(w-Wh)*(w-Wh)+(l-n*dL)*(l-n*dL)) nLanterns=1+roadLength/dL assumption: highest intensity right underneath middle lantern assumption: lowest intensity in the middle between two mid lanterns on the border of the road assumption: sufficiently accurate estimate of B taking 2N lanterns into account. Tricky: how large is N? (could depend on h and dL!) Approach: for reasonable dL and h, experiment with N to see if convergence occurs

Applying SPEA to the lantern problem Step 2: make the script more efficient  optimization Model is fast enough to enable Pareto genetic optimization. But the difference between acceptable (intPenalty==0) and non-acceptable (intPenalty>0) is difficult to see: intPenalty should be defined better. intPenalty totPow

Applying SPEA to the lantern problem Step 2: make the script more efficient  optimization Model is fast enough to enable Pareto genetic optimization. But the difference between acceptable (intPenalty==0) and non-acceptable (intPenalty>0) is difficult to see: intPenalty should be defined better. Now:-min(minP,minInt)+max(maxP,maxInt)-(maxP-minP)Better: log( min(minP,minInt)+max(maxP,maxInt)-(maxP-minP)) log( min(minP,minInt)+max(maxP,maxInt)-(maxP-minP)) compare penalty q 1 =x with penalty q 2 =log( x): for x=0, q 2 = -5 for x>0, q2= much bigger

Applying SPEA to the lantern problem Step 2: make the script more efficient  optimization Now:-min(minP,minInt)+max(maxP,maxInt)-(maxP-minP)Better: log( min(minP,minInt)+max(maxP,maxInt)-(maxP-minP)) log( min(minP,minInt)+max(maxP,maxInt)-(maxP-minP)) dL=slider(25.5,15,50) h=slider(5.5,3,30) p=slider(500.1,100,10000) intPenalty=paretoMin(paretoHor(-min(minP,minInt)+max(maxP,maxInt)-(maxP-minP))) totPow=paretoMin(paretoVer(p*nLanterns)) maxP=80 minP=10 roadLength=100 roadWidth=6 Wh=roadWidth/2 maxInt=B(dL*round(nLanterns/2),Wh) minInt=B(dL*(round(nLanterns/2)+round(nLanterns/2)+1)/2,0) B(l,w)=#(n,vSeq(round(nLanterns/2)-N,round(nLanterns/2)+N+1),Bn(l,w,n),add) Bn(l,w,n)=c*p*h/pow(r(l,w,n),3) c=1 r(l,w,n)=sqrt(h*h+(w-Wh)*(w-Wh)+(l-n*dL)*(l-n*dL)) nLanterns=1+roadLength/dL

Applying SPEA to the lantern problem Step 3: better penalty function Now:-min(minP,minInt)+max(maxP,maxInt)-(maxP-minP)Better: log( min(minP,minInt)+max(maxP,maxInt)-(maxP-minP)) log( min(minP,minInt)+max(maxP,maxInt)-(maxP-minP)) dL=slider(25.5,15,50) h=slider(5.5,3,30) p=slider(500.1,100,10000) intPenalty=paretoMin(paretoHor(-min(minP,minInt)+max(maxP,maxInt)-(maxP-minP))) totPow=paretoMin(paretoVer(p*nLanterns)) maxP=80 minP=10 roadLength=100 roadWidth=6 Wh=roadWidth/2 maxInt=B(dL*round(nLanterns/2),Wh) minInt=B(dL*(round(nLanterns/2)+round(nLanterns/2)+1)/2,0) B(l,w)=#(n,vSeq(round(nLanterns/2)-N,round(nLanterns/2)+N+1),Bn(l,w,n),add) Bn(l,w,n)=c*p*h/pow(r(l,w,n),3) c=1 r(l,w,n)=sqrt(h*h+(w-Wh)*(w-Wh)+(l-n*dL)*(l-n*dL)) nLanterns=1+roadLength/dL

Applying SPEA to the lantern problem Step 3: better penalty function Now:-min(minP,minInt)+max(maxP,maxInt)-(maxP-minP)Better: log( min(minP,minInt)+max(maxP,maxInt)-(maxP-minP)) log( min(minP,minInt)+max(maxP,maxInt)-(maxP-minP)) dL=slider(25.5,15,50) h=slider(5.5,3,30) p=slider(500.1,100,10000) intPenalty=paretoMin(paretoHor(log( min(minP,minInt)+max(maxP,maxInt)-(maxP-minP )))) totPow=paretoMin(paretoVer(p*nLanterns)) maxP=80 minP=10 roadLength=100 roadWidth=6 Wh=roadWidth/2 maxInt=B(dL*round(nLanterns/2),Wh) minInt=B(dL*(round(nLanterns/2)+round(nLanterns/2)+1)/2,0) B(l,w)=#(n,vSeq(round(nLanterns/2)-N,round(nLanterns/2)+N+1),Bn(l,w,n),add) Bn(l,w,n)=c*p*h/pow(r(l,w,n),3) c=1 r(l,w,n)=sqrt(h*h+(w-Wh)*(w-Wh)+(l-n*dL)*(l-n*dL)) nLanterns=1+roadLength/dL

Applying SPEA to the lantern problem Step 3: better penalty function New penalty function separates solutions with maxInt  maxP and minInt  minP from those that don’t satisfy this condition. (remember the difference between requirements and wishes: energy low  wish; visibility constraints  requirement) intPenalty totPow intPenalty == -5intPenalty >> -5

Applying SPEA to the lantern problem Step 3: better penalty function Problem now is that the found optima seem to lie close to the extremes of the category-I intervals. Save this problem for interpretation phase.

Summary Application of SPEA 1.Translate conceptual model into formal (mathematical) model 2.Translate mathematical model to script: may require quantised expressions, user defined functions, additional scaffolding quantities (e.g., plotting) 3.Performance issues: re-think assumptions 4.Presentation issues: re-think penalties 5.Interpretation issues: are cat.-I ranges adequate?