Professional Documents
Culture Documents
Full download Elements of Numerical Mathematical Economics with Excel: static and dynamic optimization. Romeo file pdf all chapter on 2024
Full download Elements of Numerical Mathematical Economics with Excel: static and dynamic optimization. Romeo file pdf all chapter on 2024
https://ebookmass.com/product/static-and-dynamic-analysis-of-
engineering-structures-incorporating-the-boundary-element-method-
levon-g-petrosian/
https://ebookmass.com/product/numerical-methods-and-optimization-
in-finance-2nd-ed-manfred-gilli/
https://ebookmass.com/product/mathematical-optimization-
terminology-a-comprehensive-glossary-of-terms-first-edition-
keller/
https://ebookmass.com/product/keynesian-sraffian-computable-and-
dynamic-economics-kumaraswamy-velupillai/
Up Up and Array!: Dynamic Array Formulas for Excel 365
and Beyond 1st Edition Abbott Ira Katz
https://ebookmass.com/product/up-up-and-array-dynamic-array-
formulas-for-excel-365-and-beyond-1st-edition-abbott-ira-katz-2/
https://ebookmass.com/product/optimization-modeling-with-
spreadsheets-3rd-edition/
https://ebookmass.com/product/up-up-and-array-dynamic-array-
formulas-for-excel-365-and-beyond-1st-edition-abbott-ira-katz/
https://ebookmass.com/product/simulation-and-optimization-in-
process-engineering-the-benefit-of-mathematical-methods-in-
applications-of-the-chemical-industry-1st-edition-michael-bortz/
https://ebookmass.com/product/instructors-manual-for-fundamental-
methods-of-mathematical-economics-4th-edition-alpha-c-chiang/
ELEMENTS OF NUMERICAL
MATHEMATICAL ECONOMICS
WITH EXCEL
This page intentionally left blank
ELEMENTS OF
NUMERICAL
MATHEMATICAL
ECONOMICS WITH
EXCEL
STATIC AND DYNAMIC
OPTIMIZATION
GIOVANNI ROMEO
Independent Financial Advisor
Academic Press is an imprint of Elsevier
125 London Wall, London EC2Y 5AS, United Kingdom
525 B Street, Suite 1650, San Diego, CA 92101, United States
50 Hampshire Street, 5th Floor, Cambridge, MA 02139, United States
The Boulevard, Langford Lane, Kidlington, Oxford OX5 1GB, United Kingdom
Copyright © 2020 Elsevier Inc. All rights reserved.
No part of this publication may be reproduced or transmitted in any form or by any means, electronic or
mechanical, including photocopying, recording, or any information storage and retrieval system, without
permission in writing from the publisher. Details on how to seek permission, further information about the
Publisher’s permissions policies and our arrangements with organizations such as the Copyright Clearance
Center and the Copyright Licensing Agency, can be found at our website: www.elsevier.com/permissions.
This book and the individual contributions contained in it are protected under copyright by the Publisher
(other than as may be noted herein).
Notices
Knowledge and best practice in this field are constantly changing. As new research and experience broaden
our understanding, changes in research methods, professional practices, or medical treatment may become
necessary.
Practitioners and researchers must always rely on their own experience and knowledge in evaluating and us-
ing any information, methods, compounds, or experiments described herein. In using such information or
methods they should be mindful of their own safety and the safety of others, including parties for whom
they have a professional responsibility.
To the fullest extent of the law, neither the Publisher nor the authors, contributors, or editors, assume any li-
ability for any injury and/or damage to persons or property as a matter of products liability, negligence or
otherwise, or from any use or operation of any methods, products, instructions, or ideas contained in the
material herein.
ISBN: 978-0-12-817648-1
v
vi Contents
1
Excel VBA, solver, and other
advanced worksheet tools
O U T L I N E
.
1.1 VBA introduction and main statements
On the left-hand side of Fig. 1.1-2, we have the Project Explorer (at the top) and a second
panel (at the bottom) which contains the Properties (modifiable by the user when necessary)
referred to any Excel Object we select in the VBA Project window: a worksheet, a workbook,
or a module itself.
Now, what we have to do is to open the actual working area where to write our VBA code,
and this is done by inserting a Module, as in Fig. 1.1-3.
A module can be inserted, for example, by clicking on Insert on the Menu Bar and then select-
ing Module, and finally the VB Editor will be completed with the Module inserted as in Fig. 1.1-
4. If we want, we can rename a Module using the properties window at the bottom of the screen
of Fig. 1.1-4. When renaming it, we just need to pay attention to spaces, which are not accepted,
and the underscore character should be used in place of a space. Now that we have a module, we
can begin writing a code. This is called a Macro (or procedure, or routine).
Excel VBA also allows to create a User Defined Function, which will enrich the library of
the built-in functions.
FIGURE 1.1-2 VBA Project Explorer (with Excel Objects) and the Panel Properties at the bottom.
Sub 0 Name0 ðÞ
VBA Statements
End Sub
Suppose we want to increment the value in Cell A1 of a worksheet by 1. The code would be
as in Fig. 1.1-5. Now a question arises. How can we get the code activated in the worksheet?
In other words, how can we make the macro run? This is normally done inserting a Button in
the worksheet, which is then associated to the specific code we have created. The button we
are referring to is the Form Control, as shown in Fig. 1.1-6.
Using the Alt-Key to facilitate the Button positioning on the sheet, we decide to position
the Button as in Fig. 1.1-7.
Releasing the mouse, Excel will ask us to associate a Macro to this Button, and we choose
the only Macro available so far, which is the Sub Increment_Value as in Figs. 1.1-8. Then, the
macro is available to be run through the Button “Increment Value,” as in Fig. 1.1-9. We can
create a second Macro called “Reduce_Value” as in Fig. 1.1-10, inserting a second Button as in
Fig. 1.1-11.
End Sub
If we want to add four sheets in one shot the macro would be modified as follows:
End Sub
Main VBA statements used within the book (the looping structures)
Many of the VBA sub procedures need to be entered manually in the VB Editor, and we
will show here the main statements used within the book.
These are the Looping structures, which are VBA Subs that are finalized at:
1. repeating a set of instructions, until a specific goal is reached, for example, until the
Excel sets a specific cell equal to zero, or until a specific target cell is less than a desired
ε (the Steepest Descent VBA code shown in Section 5.4 is an example) or
2. finalized at repeating a set of instructions for a certain number of times.
A looping structure belonging to the first category is the Do Until statement, sometimes
used in conjunction with the Excel Solver, to optimize a specific objective function.
Suppose we have a list of 10 numbers like in Fig. 1.1-13, where the last one in effect con-
tains a formula. In this case, it is just a formula that adds the value 1 to the previous cell.
The objective is to add automatically a new row in a new updating sheet round, including
the counting formula and removing the formula from the penultimate cell (which was the last
cell in the previous updating round).
To do that using the Do Until statement can be a perfect solution. The following would be
the statement which makes Excel select the Cell A1 as a first step and then move forward until
the cell is empty:
Rangeð}A1}Þ:Select
Do Until IsEmptyðActiveCellÞ
Loop
Excel moves forward from Cell A1 along the same column using the instruction:
ActiveCell:Offsetð1; 0Þ:Select
inserted between Do Until and Loop (this is always inserted below the instruction we want to
repeat).
The complete code of what we want to achieve is shown in Fig. 1.1-14. We can follow step
by step the macro by pressing F8 on the keyboard. This is useful, especially when something
does not work as planned and we want to study the macro in detail, investigating at which
line of the code the mistake could be located. This can be done also using the Debug option
from the Menu Bar as shown in Fig. 1.1-15.
There are some other alternatives to test for a blank cell, not only using the Do Until Is
Empty(ActiveCell); for example, we may also use the following:
Do Until ActiveCell:Value ¼ }}
Also, a very slightly different code would be the Loop Until statement, as described as
follows
Rangeð}A1}Þ:Select
Do
Met blijdschap mocht ik, op mijn verzoek, van den heer Aug.
Sassen, den welgeleerden en volijverigen Archivaris van Helmond,
eene lijst ontvangen van namen der Helmondsche burgerij uit de
veertiende en de vijftiende eeuw. Die namen, door den Heer Sassen
met veel zorgvuldigheid uit oude Helmondsche oorkonden en
geschriften, vooral ook uit de Helmondsche Schepenacten bijeen
verzameld, waren mij, in menig opzicht, voor mijne navorschingen
op ’t gebied der namenkunde van groot belang. Zij hebben mij dan
ook aanleiding gegeven tot het opstellen van de volgende
verhandeling.
In het midden der veertiende eeuw, ten jare 1348, het oudste jaar
dat in onze naamlijst voorkomt, waren er te Helmond geene
personen meer die nog op dien alleroudsten en eenvoudigsten trap
der benaming stonden, waar bij de lieden slechts eenen enkelen
naam, en geenen toenaam, in welken vorm dan ook, hadden.
Althans onze lijst vermeldt zulke benamingen niet. Achter alle
doopnamen, daarin vermeld, staat een andere naam als toenaam;
een vadersnaam veelal, of anders een plaatsnaam, of ook ’t eene of
andere algemeene woord, als bijnaam, aan het bedrijf van den man
of van diens vader, of aan de eene of andere bijzondere geestelijke
of lichamelijke eigenschap ontleend.
De oudste vorm der patronymicale benamingen, volledig, met het
woord zoon (in dit geval soen) daar achter, is in onze naamlijst
vertegenwoordigd in de namen van H e n r i c R o e f s s o e n
(1389) 1, G o d a r t L y z e n s o e n (1401), G h e v a r t
L u t e n s o e n (1401), J a n C o l e n s o e n (1419), A n c h e m
G o e s w ij n s s o e n [174](1424), B r u y s t e n Y s e b o u t s s o e n
(1426), G o d a r t V r a n k e n s o e n (1439), enz. Dat is: H e n r i c
s o e n v a n R o e f of H e n d r i k zoon van R o e f (R o d f r e d );
G o d a r t zoon van L y s e (een vrouwennaam? E l i z a b e t h ? );
G h e v a r t of G e v a a r t zoon van L u t e (H l o d o ); J a n zoon van
C o l e n (N i c o l a a s ); A n c h e m (A n s e l m ? ) zoon van
G o e s w ij n (G o s e w ij n , G o d s w i n ); B r u y s t e n zoon van
Y s e b o u t (I s b o l d , I d i s b a l d ); G o d a r t (G o t h a r d ) zoon
van V r a n k e (F r a n c o , F r a n k ) 2.
Het kwam wel voor, dat twee personen niet slechts den zelfden
doopnaam hadden, maar ook den zelfden vadersnaam voerden,
omdat toevalliger wijze ook hunne vaders beiden den zelfden naam
hadden gedragen. Dan was nog eene andere toevoeging achter hun
patronymicum noodig, om die twee personen van elkanderen te
kunnen onderscheiden. Of ook, bij bijzondere, belangrijke
aangelegenheden, zoo als die, welke het opstellen van oorkonden
(uiterste wilsbeschikkingen, koopbrieven, of andere
overeenkomsten) ten gevolge hadden, was eene zeer nauwkeurige
aanduiding der verschillende personen noodig, en voegde men
daarom nog eene nadere onderscheiding achter het patronymicum.
Daar toe was de naam van de plaats (stad of dorp, berg, bosch of
heide) waar deze of gene persoon woonde, of anderszins
herkomstig was, bijzonder dienstig. Zulke namen komen op de
naamlijst voor als: D y r c C n o o p s o e n v a n Z o e m e r e n
(1389); J a n C l a e u s s o e n v a n L a n c h e z e (1401);
L a m b r e c h t S t e v e n s s o e n v a n M i l h e z e (1401);
D i d d e r i c J a n s s o e n v a n d e n B r o e k e (1402); A y e n
H e r m a n s s o e n v a n E y n d h o u t s (1407); R o e f
A l a r t s s o e n u t e n V e h u s e , dat is R o e f of R o d f r e d , de
zoon van A l a r t of A d e l h a r t uit den veehuize, uit het veehuis
(dus de man die in een huis woont, waar in het bijzonder vee
gehouden of gestald wordt?). [175]Verder L o d e w i c h
L o d e w i c h s s o e n v a n L o e f f e n (1418). Deze zelfde man
komt in eene vroegere oorkonde van den jare 1410 eenvoudig voor,
met ingekorten doopnaam, als L o d e k e n v a n L o f e n ;
waarschijnlijk moet deze plaatsnaam L o e f f e n of L o f e n wel den
naam der stad Leuven voorstellen. Eindelijk nog V r i e n t k e n
V r i e n t s v a n D o e r n e n (Deurne) (1423); J a n
Y w a e n s s o e n v a n d e n B e r g h e (1423); R y m b o u t
H e n r i x s o e n v a n d e n B e r g e (1444), enz.
Het bleek echter op nieuw dat deze korte benamingen niet in alle
gevallen voldoende waren. Indien het toch geviel dat daar in ééne
plaats twee personen waren die beiden niet enkel den zelfden
doopnaam maar ook den zelfden vadersnaam droegen, dan was
men wel genoodzaakt, zoo men die twee lieden nauwkeurig [179]van
elkanderen onderscheiden wilde, weêr de toevlucht te nemen tot
allerlei toe- en bijnamen. De cirkelgang der benamingen, die weêr
moest uitloopen op eene opéénhooping van allerlei naamsvormen,
was hier mede weêr een nieuw tijdperk ingetreden. Die toe- en
bijnamen werden weêr op allerlei verschillende wijzen gezocht en
gevonden. Bij voorbeeld in de maagschapsbetrekkingen der
menschen: H e n n e k e n R o e s e l m a n s M e l y s b r u e d e r
(1439); J a n v a n d e n L o e ( d e s s e l f s ) A r t s o e m , de
oom van A r t v a n d e n L o e H e n r i c M e t t e n s o e n s
s o e n , op bladzijde 175 reeds vermeld. Misschien behooren hier
ook toe J a n N e v e (1348) en J a n L o d e n N e e f s s o e n
(1424), J a n zoon van L o d e ( L o d e w ij k ) N e e f (of van
N e e f - L o d e ?).