a core course on modeling
Download
Skip this Video
Download Presentation
A core Course on Modeling

Loading in 2 Seconds...

play fullscreen
1 / 11

A core Course on Modeling - PowerPoint PPT Presentation


  • 113 Views
  • Uploaded on

A core Course on Modeling. Introduction to Modeling 0LAB0 0LBB0 0LCB0 0LDB0 c.w.a.m.v.overveld@tue.nl v.a.j.borghuis@tue.nl S.16. Totally ordered time: recursive functions. 2. Nothing depends on its own future . Quantities ’ current values can only depend

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about ' A core Course on Modeling' - calais


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
a core course on modeling

A core Course on Modeling

Introductionto Modeling

0LAB0 0LBB0 0LCB0 0LDB0

c.w.a.m.v.overveld@tue.nl

v.a.j.borghuis@tue.nl

S.16

slide2

Totallyordered time:

recursivefunctions

2

  • Nothingdepends on
  • itsownfuture.
  • Quantities’ currentvalues
  • canonlydepend
  • on theirpreviousvalues
slide3

Totallyordered time:

recursivefunctions

http://www.sxc.hu/photo/484676

3

Qcurr=F(Qprev,Pprev)

Dependencyworksfrom ‘previous’ to ‘current’,

QprevandPprev have no dependence on Qcurr.

So we won’t have Qcurr=F(Qcurr, …)

Evaluate F foreach of the Q irrespective of the order.

slide4

QUIZ

It is not sufficientto have

Qcurr=F(Qprev, Pcurr).

Why not?

Totallyordered time:

recursivefunctions

http://www.sxc.hu/photo/484676

4

Qcurr=F(Qprev,Pprev)

Dependencyworksfrom ‘previous’ to ‘current’,

QprevandPprev have no dependence on Qcurr.

So we won’t have Qcurr=F(Qcurr, …)

Evaluate F foreach of the Q irrespective of the order.

slide5

Totallyordered time:

recursivefunctions

http://www.sxc.hu/photo/484676

5

Qcurr=F(Qprev,Pprev)

Dependencyworksfrom ‘previous’ to ‘current’,

QprevandPprev have no dependence on Qcurr.

Noticethat the following is problematic:

Xcurr=F(Xprev,Ycurr)

Ycurr=G(Yprev,Xcurr)  Xcurr = F(G(Xcurr, ...))

Hencebothargumentsshouldbe ‘prev’.

slide6

Totallyordered time:

recursivefunctions

6

Qcurr=F(Qprev,Pprev)

F is called a recursivefunction:

itcalculates Q,

taking (an) earlierversion(s) of Q

as argument.

http://commons.wikimedia.org/wiki/File:Recursive_Objects.jpg

slide7

Totallyordered time:

recursivefunctions

http://www.sxc.hu/photo/480131

7

  • Example forarbitraryintervals:
  • A 120 km bicycle trip;
  • 10 control posts, to bevisited in right order
  • every post features a box full of bananas, B kCaleach;
  • a list of ‘efforts’ (kCal) betweensubsequentposts, {Ei},
  • At whichpostsshouldyoupickbanana(s)?
slide8

Totallyordered time:

recursivefunctions

8

  • Qi=amount of kCal in stomach at post i, i > 0
  • Q0=amount of kCal in stomach at start
  • Qi+1=Qi-Eiifyoudon’teat
  • Qi+1=Qi-Ei+niBifyoueat nibananas at post i
  • What is ni?

max(0,…): you can’t eat a negative amount of bananas

… : rounding up: you don’t want to eat a fraction of a banana

slide9

Totallyordered time:

recursivefunctions

9

  • Qi+1=Qi-Ei+niB
  • nishouldbesuchthat Qi+1>0, as small as possible
  • Qi-Ei+niB0,
  • soniB  Ei-Qi; ni=max(0,(Ei-Qi)/B)

max(0,…): you can’t eat a negative amount of bananas

… : rounding up: you don’t want to eat a fraction of a banana

slide10

QUIZ

x means: the rounded-up value of x,

e.g., 4.2 = 5.

Why do we needtoround up?

Totallyordered time:

recursivefunctions

10

  • Qi+1=Qi-Ei+niB
  • nishouldbesuchthat Qi+1>0, as small as possible
  • Qi-Ei+niB0,
  • soniB  Ei-Qi; ni=max(0,(Ei-Qi)/B)

max(0,…): you can’t eat a negative amount of bananas

… : rounding up: you don’t want to eat a fraction of a banana

slide11

Totallyordered time:

recursivefunctions

11

  • Qi+1=Qi-Ei+niB
  • nishouldbesuchthat Qi+1>0, as small as possible
  • Qi-Ei+niB0,
  • soniB  Ei-Qi; ni=max(0,(Ei-Qi)/B), so
  • Qi+1=Qi-Ei+B*max(0,(Ei-Qi)/B)
  • or: Qi+1=F(Qi,Pi)

max(0,…): you can’t eat a negative amount of bananas

… : rounding up: you don’t want to eat a fraction of a banana

 recursivefunction

ad