You are on page 1of 13

Difference-Equations-2-Cobweb.

nb

Difference Equations
- Part 2 -

Cobweb diagrams
("Spinnweben"-Diagramme)
Prof. Dr. J. Ziegenbalg
Institut fr Mathematik und Informatik
Pdagogische Hochschule Karlsruhe
electronic mail:
homepage:

ziegenbalg@ph-karlsruhe.de
http://www.ph-karlsruhe.de/wp/ziegenbalg/

Generating the basic data list


The following program generates a list subsequently to be processed for graphical representation.
AnnuityList@y0_, A_, B_, k_D :=
Module@8i = 0, y = y0, AL = 8<<,
AL = Append@AL, 8i, y<D;
While@i < k,
i = i + 1; y = A y + B; AL = Append@AL, 8i, y<DD;
Return@ALD D
AnnuityList@100000, 1.05, 10000, 15D

880, 100000<, 81, 95000.<, 82, 89750.<, 83, 84237.5<, 84, 78449.4<, 85, 72371.8<,
86, 65990.4<, 87, 59290.<, 88, 52254.5<, 89, 44867.2<, 810, 37110.5<,
811, 28966.1<, 812, 20414.4<, 813, 11435.1<, 814, 2006.84<, 815, 7892.82<<

The standard plot ("timeline plot")


Implementation of the timeline plot

Difference-Equations-2-Cobweb.nb

Experiments and Results


TimelinePlot@100000, 1.05, 10000, 15D

100000

80000

60000

40000

20000

Graphics

10

12

14

Difference-Equations-2-Cobweb.nb

TimelinePlot@100000, 1.05, 10000, 15D

200000

100000

10

12

14

-100000

-200000

Graphics

The "cobweb" plot


The program AnnuityList generates a list of pairs, the annuity list. The first component of each pair can be
interpetreted as "time". The complete liste gives the development of the magnitude y in time (see previous graphic).

Implementation of the cobweb plot

Difference-Equations-2-Cobweb.nb

Experiments and Results


CobWebPlot@100000, 1.05, 10000, 15D

100000

80000

60000

40000

20000

20000

20000
Graphics

40000

60000

80000

100000

Difference-Equations-2-Cobweb.nb

CobWebPlot@100000, 1.05, 10000, 15D

200000

100000

200000

100000

100000

100000

200000

Graphics
Demos =
HTimelinePlot@100000, 1.05, 10000, 15D;
CobWebPlot@100000, 1.05, 10000, 15D;
TimelinePlot@100000, 1.05, 10000, 15D;
CobWebPlot@100000, 1.05, 10000, 15D;
TimelinePlot@100000, 0.95, 10000, 15D;
CobWebPlot@100000, 0.95, 10000, 15D;
TimelinePlot@100000, 0.95, 10000, 15D;
CobWebPlot@100000, 0.95, 10000, 15D L

200000

Difference-Equations-2-Cobweb.nb

100000

80000

60000

40000

20000

10

12

14

100000

80000

60000

40000

20000

20000

20000

40000

60000

80000

100000

Difference-Equations-2-Cobweb.nb

200000

100000

10

12

14

-100000

-200000

200000

100000

200000

100000

100000

200000

100000

200000

Difference-Equations-2-Cobweb.nb

100000
75000
50000
25000

10

12

14

-25000
-50000

100000

75000

50000

25000

50000 25000
25000

50000

25000

50000

75000 100000

Difference-Equations-2-Cobweb.nb

100000

50000

10

12

14

-50000

-100000

100000

50000

100000

50000

50000

50000

100000

Graphics

100000

Difference-Equations-2-Cobweb.nb

10

The cobweb plot - some special cases


B
Case: y0 =

1-A
AB+BH1-AL
B
B
y1 = A y0 + B = A
+ B =
=
= y0
1-A
1-A
1-A

hence:

y0 = y1 = y2 = y3 = y4 =. ..

hence:

In the following diagram this fact is visualized with various slopes.


TimelinePlot@200000, 1.05, 10000, 15D;
CobWebPlot@200000, 1.05, 10000, 15D;
TimelinePlot@200000, 0.95, 10000, 15D;
CobWebPlot@200000, 0.95, 10000, 15D;

400000

300000

200000

100000

10

12

14

Difference-Equations-2-Cobweb.nb

11

200000

150000

100000

50000

50000

100000

150000

200000

400000

300000

200000

100000

10

12

14

Difference-Equations-2-Cobweb.nb

12

200000

150000

100000

50000

50000

100000

150000

Case: A = -1
y1 = - y0 + B

hence:

y2 = - y1 + B = Hy0 - BL + B = y0
y3 = - y2 + B = - y0 + B = y1
y4 = - y3 + B = - y1 + B = y2 = y0
Visualisation:
TimelinePlot@200000, 1, 10000, 15D;
CobWebPlot@200000, 1, 10000, 15D;

200000

Difference-Equations-2-Cobweb.nb

13

200000

100000

10

12

14

-100000

200000

100000

100000

100000

100000

Auxiliary stuff
? Global`*
Remove@"Global`"D

200000

You might also like