100% found this document useful (2 votes)
50 views48 pages

Optimizations and Programming: Linear, Non-Linear, Dynamic, Stochastic and Applications With Matlab Abdelkhalak El Hamiinstant Download

The document is a comprehensive resource on various optimization and programming techniques, including linear, nonlinear, dynamic, and stochastic methods, with applications using MATLAB. It includes detailed chapters on linear programming, integer programming, and dynamic programming, along with practical examples and algorithms. The book is authored by Abdelkhalak El Hami and Bouchaib Radi, and was first published in 2021.

Uploaded by

myekikongos97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
50 views48 pages

Optimizations and Programming: Linear, Non-Linear, Dynamic, Stochastic and Applications With Matlab Abdelkhalak El Hamiinstant Download

The document is a comprehensive resource on various optimization and programming techniques, including linear, nonlinear, dynamic, and stochastic methods, with applications using MATLAB. It includes detailed chapters on linear programming, integer programming, and dynamic programming, along with practical examples and algorithms. The book is authored by Abdelkhalak El Hami and Bouchaib Radi, and was first published in 2021.

Uploaded by

myekikongos97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

Optimizations and Programming: Linear, Non-

linear, Dynamic, Stochastic and Applications


with Matlab Abdelkhalak El Hami pdf download

https://ebookmass.com/product/optimizations-and-programming-
linear-non-linear-dynamic-stochastic-and-applications-with-
matlab-abdelkhalak-el-hami/

Explore and download more ebooks at ebookmass.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmass.com
to discover even more!

Reliability of High-Power Mechatronic Systems 2: Aerospace


and Automotive Applications Issues,Testing and Analysis
Abdelkhalak El Hami (Editor)
https://ebookmass.com/product/reliability-of-high-power-mechatronic-
systems-2-aerospace-and-automotive-applications-issuestesting-and-
analysis-abdelkhalak-el-hami-editor/

Linear Algebra and Its Applications, Global Edition Lay

https://ebookmass.com/product/linear-algebra-and-its-applications-
global-edition-lay/

Reliability Of High Power Mechatronics Systems 1


Abdelkhalak El Hami (Editor)

https://ebookmass.com/product/reliability-of-high-power-mechatronics-
systems-1-abdelkhalak-el-hami-editor/

Linear Algebra with Applications, Global Edition 9th


Edition, (Ebook PDF)

https://ebookmass.com/product/linear-algebra-with-applications-global-
edition-9th-edition-ebook-pdf/
Linear Algebra and Its Applications 5th Edition, (Ebook
PDF)

https://ebookmass.com/product/linear-algebra-and-its-applications-5th-
edition-ebook-pdf/

Linear Algebra and Its Applications 4th Edition, (Ebook


PDF)

https://ebookmass.com/product/linear-algebra-and-its-applications-4th-
edition-ebook-pdf/

Embedded Mechatronic Systems, Volume 2: Analysis of


Failures, Modeling, Simulation and Optimization 2nd
Edition Abdelkhalak El Hami
https://ebookmass.com/product/embedded-mechatronic-systems-
volume-2-analysis-of-failures-modeling-simulation-and-
optimization-2nd-edition-abdelkhalak-el-hami/

Embedded Mechatronic Systems, Volume 1: Analysis of


Failures, Predictive Reliability 2nd Edition Abdelkhalak
El Hami
https://ebookmass.com/product/embedded-mechatronic-systems-
volume-1-analysis-of-failures-predictive-reliability-2nd-edition-
abdelkhalak-el-hami/

Dynamic System Modelling and Analysis with MATLAB and


Python 1st Edition Jongrae Kim

https://ebookmass.com/product/dynamic-system-modelling-and-analysis-
with-matlab-and-python-1st-edition-jongrae-kim/
Optimizations and Programming
Digital Sciences Set
coordinated by
Abdelkhalak El Hami

Volume 1

Optimizations and
Programming

Linear, Nonlinear, Dynamic, Stochastic


and Applications with Matlab

Abdelkhalak El Hami
Bouchaib Radi
First published 2021 in Great Britain and the United States by ISTE Ltd and John Wiley & Sons, Inc.

Apart from any fair dealing for the purposes of research or private study, or criticism or review, as
permitted under the Copyright, Designs and Patents Act 1988, this publication may only be reproduced,
stored or transmitted, in any form or by any means, with the prior permission in writing of the publishers,
or in the case of reprographic reproduction in accordance with the terms and licenses issued by the
CLA. Enquiries concerning reproduction outside these terms should be sent to the publishers at the
undermentioned address:

ISTE Ltd John Wiley & Sons, Inc.


27-37 St George’s Road 111 River Street
London SW19 4EU Hoboken, NJ 07030
UK USA

www.iste.co.uk www.wiley.com

© ISTE Ltd 2021


The rights of Abdelkhalak El Hami and Bouchaib Radi to be identified as the authors of this work have
been asserted by them in accordance with the Copyright, Designs and Patents Act 1988.

Library of Congress Control Number: 2020948478

British Library Cataloguing-in-Publication Data


A CIP record for this book is available from the British Library
ISBN 978-1-84821-953-3
Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi

Part 1. Programmation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

Chapter 1. Linear Programming . . . . . . . . . . . . . . . . . . . . . . . . 3


1.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.2. Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3. Geometry of the linear program . . . . . . . . . . . . . . . . . . . . . . 5
1.3.1. Polyhedra . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.3.2. Extreme points and vertices . . . . . . . . . . . . . . . . . . . . . . 6
1.4. Graphical solving of a linear program . . . . . . . . . . . . . . . . . . . 6
1.5. Simplex algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
1.5.1. Basic solutions and basic feasible solutions . . . . . . . . . . . . . . 9
1.5.2. Simplex tableau . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.5.3. Change of feasible basis . . . . . . . . . . . . . . . . . . . . . . . . 11
1.5.4. Existence and uniqueness of an optimal solution . . . . . . . . . . . 14
1.6. Initialization of the simplex algorithm . . . . . . . . . . . . . . . . . . . 15
1.6.1. Big M method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
1.6.2. Auxiliary program or Phase I . . . . . . . . . . . . . . . . . . . . . . 17
1.6.3. Degeneracy and cycling . . . . . . . . . . . . . . . . . . . . . . . . . 20
1.6.4. Geometric structure of realizable solutions . . . . . . . . . . . . . . 21
1.7. Interior-point algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
1.8. Duality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
1.8.1. Duality theorem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
1.9. Relaxation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.9.1. Lagrangian relaxation . . . . . . . . . . . . . . . . . . . . . . . . . . 27
1.10. Postoptimal analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
1.10.1. Effect of modifying b . . . . . . . . . . . . . . . . . . . . . . . . . 31
1.10.2. Effect of modifying c . . . . . . . . . . . . . . . . . . . . . . . . . 32
vi Optimizations and Programming

1.11. Application to an inventory problem . . . . . . . . . . . . . . . . . . . 34


1.11.1. Optimal solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
1.11.2. Sensitivity to variation in stock . . . . . . . . . . . . . . . . . . . . 35
1.11.3. Dual problem of the competitor . . . . . . . . . . . . . . . . . . . 36
1.12. Using Matlab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

Chapter 2. Integer Programming . . . . . . . . . . . . . . . . . . . . . . . 41


2.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.2. Solving methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
2.2.1. Branch-and-bound method . . . . . . . . . . . . . . . . . . . . . . . 42
2.2.2. The branch-and-cut method . . . . . . . . . . . . . . . . . . . . . . 44
2.3. Binary programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.3.1. Knapsack problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.3.2. Investment problem . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
2.4. Decomposition principle . . . . . . . . . . . . . . . . . . . . . . . . . . 57
2.4.1. Benders decomposition . . . . . . . . . . . . . . . . . . . . . . . . . 58
2.5. Using Matlab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62

Chapter 3. Dynamic Programming . . . . . . . . . . . . . . . . . . . . . . 65


3.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
3.2. Solving strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
3.3. Discrete DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
3.3.1. Bellman’s equation and the principle of optimality . . . . . . . . . 68
3.3.2. Approach of the method . . . . . . . . . . . . . . . . . . . . . . . . 70
3.3.3. A few examples of DP . . . . . . . . . . . . . . . . . . . . . . . . . 70
3.3.4. Solving an LP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
3.3.5. Shortest path problem . . . . . . . . . . . . . . . . . . . . . . . . . . 74
3.3.6. Knapsack problem . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
3.3.7. Stock management problem . . . . . . . . . . . . . . . . . . . . . . 81
3.4. Continuous DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
3.4.1. Hamilton–Jacobi equation . . . . . . . . . . . . . . . . . . . . . . . 84
3.4.2. Application to a consumption-savings model . . . . . . . . . . . . . 84
3.5. Stochastic DP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
3.5.1. Decision-chance process . . . . . . . . . . . . . . . . . . . . . . . . 85
3.5.2. Solving method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
3.5.3. Application to a contract problem . . . . . . . . . . . . . . . . . . . 86
3.5.4. Optimal binary search tree . . . . . . . . . . . . . . . . . . . . . . . 87
3.6. Using Matlab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91

Chapter 4. Stochastic Programming . . . . . . . . . . . . . . . . . . . . . 93


4.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
4.2. Presentation of the problem . . . . . . . . . . . . . . . . . . . . . . . . . 94
Contents vii

4.3. Optimal feedback in an open loop . . . . . . . . . . . . . . . . . . . . . 94


4.4. Stochastic linear programming . . . . . . . . . . . . . . . . . . . . . . . 95
4.4.1. Models with probability thresholds on the constraints . . . . . . . . 96
4.5. Stochastic linear programs with recourse . . . . . . . . . . . . . . . . . 96
4.5.1. L-shaped method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 97
4.5.2. Multicut L-shaped method . . . . . . . . . . . . . . . . . . . . . . . 99
4.5.3. Interior linearization method . . . . . . . . . . . . . . . . . . . . . . 100
4.6. Nonlinear stochastic programming . . . . . . . . . . . . . . . . . . . . . 100
4.6.1. Approaches to two-step problems with recourse . . . . . . . . . . . 100
4.6.2. Regularized decomposition method . . . . . . . . . . . . . . . . . . 101
4.6.3. Methods based on the Lagrangian . . . . . . . . . . . . . . . . . . . 101
4.6.4. Frank–Wolfe method for problems with simple recourse . . . . . . 103
4.6.5. Approximation by sampling average: Monte Carlo method . . . . . 105
4.6.6. Stochastic gradient method . . . . . . . . . . . . . . . . . . . . . . . 106
4.7. Stochastic dynamic programming . . . . . . . . . . . . . . . . . . . . . 107
4.7.1. Markov decision process . . . . . . . . . . . . . . . . . . . . . . . . 108
4.7.2. Scenario tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
4.8. Application to the reliability of mechanical systems . . . . . . . . . . . 111
4.8.1. Position and modeling of the reliability problem . . . . . . . . . . . 113
4.9. Using Matlab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121

Part 2. Optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127

Chapter 5. Combinatorial Optimization . . . . . . . . . . . . . . . . . . . 129


5.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
5.2. Symmetric TSP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
5.2.1. Historical overview . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
5.2.2. Solving methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
5.3. Asymmetric traveling salesman problem . . . . . . . . . . . . . . . . . 140
5.3.1. Variants of the ATSP . . . . . . . . . . . . . . . . . . . . . . . . . . 140
5.3.2. Mathematical formulations . . . . . . . . . . . . . . . . . . . . . . . 142
5.3.3. Methods for solving the ATSP . . . . . . . . . . . . . . . . . . . . . 144
5.4. Vehicle routing problem . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
5.4.1. Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
5.4.2. Fields of application . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
5.4.3. Parameters of the VRP . . . . . . . . . . . . . . . . . . . . . . . . . 150
5.4.4. Variants of the VRP . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
5.4.5. Mathematical formulation of the VRP . . . . . . . . . . . . . . . . . 153
5.4.6. Algorithmic complexity . . . . . . . . . . . . . . . . . . . . . . . . . 155
5.5. Selective routing problem . . . . . . . . . . . . . . . . . . . . . . . . . . 156
5.5.1. Problems similar to the VRP . . . . . . . . . . . . . . . . . . . . . . 157
5.5.2. Mathematical formulation . . . . . . . . . . . . . . . . . . . . . . . 157
5.6. Using Matlab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
viii Optimizations and Programming

Chapter 6. Unconstrained Nonlinear Programming . . . . . . . . . . . 161


6.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
6.2. Mathematical formulation . . . . . . . . . . . . . . . . . . . . . . . . . 161
6.2.1. Existence and uniqueness results . . . . . . . . . . . . . . . . . . . . 162
6.3. Optimality conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
6.4. Quadratic problems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
6.4.1. Gradient method with optimal step size . . . . . . . . . . . . . . . . 163
6.4.2. Conjugate gradient method . . . . . . . . . . . . . . . . . . . . . . . 164
6.5. Newton’s algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
6.6. Methods of descent and linear search . . . . . . . . . . . . . . . . . . . 165
6.6.1. Presentation of methods of descent . . . . . . . . . . . . . . . . . . 165
6.6.2. Method of greatest slope . . . . . . . . . . . . . . . . . . . . . . . . 167
6.6.3. Acceptable step size . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
6.6.4. Linear search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
6.6.5. Newton’s method with linear search . . . . . . . . . . . . . . . . . . 170
6.7. Quasi-Newton methods . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
6.7.1. DFP and BFGS methods . . . . . . . . . . . . . . . . . . . . . . . . 172
6.8. Relaxation method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
6.9. Gradient method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
6.10. Least squares problem . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
6.10.1. Gauss–Newton method . . . . . . . . . . . . . . . . . . . . . . . . 176
6.10.2. Levenberg–Marquardt algorithm . . . . . . . . . . . . . . . . . . . 178
6.10.3. Kalman filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
6.11. Direct search methods . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
6.11.1. Nelder–Mead algorithm . . . . . . . . . . . . . . . . . . . . . . . . 181
6.11.2. Torczon method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
6.12. Application to an identification problem . . . . . . . . . . . . . . . . . 183
6.13. Using Matlab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
6.13.1. The fminsearch function . . . . . . . . . . . . . . . . . . . . . . . 187
6.13.2. The fminunc function . . . . . . . . . . . . . . . . . . . . . . . . . 188
6.13.3. Relaxation method . . . . . . . . . . . . . . . . . . . . . . . . . . . 190

Chapter 7. Constrained Nonlinear Optimization . . . . . . . . . . . . . 193


7.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
7.2. Mathematical formulation . . . . . . . . . . . . . . . . . . . . . . . . . 193
7.3. Lagrange multipliers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
7.4. Optimization with inequality constraints . . . . . . . . . . . . . . . . . 195
7.4.1. First-order conditions of optimality . . . . . . . . . . . . . . . . . . 195
7.4.2. Presentation of saddle points . . . . . . . . . . . . . . . . . . . . . . 197
7.4.3. Saddle point and optimization . . . . . . . . . . . . . . . . . . . . . 198
7.4.4. Convex case . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
7.5. Constrained minimization algorithms . . . . . . . . . . . . . . . . . . . 201
7.5.1. Relaxation method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Contents ix

7.5.2. Projection method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202


7.5.3. Exterior penalty method . . . . . . . . . . . . . . . . . . . . . . . . 204
7.5.4. Uzawa’s algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
7.6. Newton algorithms: SQP method . . . . . . . . . . . . . . . . . . . . . 206
7.6.1. Equality constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
7.6.2. Inequality constraints . . . . . . . . . . . . . . . . . . . . . . . . . . 209
7.7. Application to structure optimization . . . . . . . . . . . . . . . . . . . 210
7.8. Using Matlab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
7.8.1. The fmincon function . . . . . . . . . . . . . . . . . . . . . . . . . . 219
7.8.2. The fminbnd function . . . . . . . . . . . . . . . . . . . . . . . . . . 220
7.8.3. Penalty method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221

Appendices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229

Appendix 1. Reminders from Linear Algebra . . . . . . . . . . . . . . . 231

Appendix 2. Reminders about functions from Rn into R . . . . . . . . 241

Appendix 3. Optimization Toolbox . . . . . . . . . . . . . . . . . . . . . . 245

Appendix 4. Software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249

References . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
Preface

Optimization is the domain of mathematics that studies how to minimize (or


maximize) a certain objective, for example, an economic parameter or some type of
energy. This is both an ancient topic, with the earliest optimization problems going
back to Euclid, and a relatively new topic, with the recent development of numerical
methods such as linear programming, which only truly began to flourish in the
second half of the 20th century. As an illustration, imagine the problem of searching
for a path that joins two points on a map in the shortest time. Some parameters of the
problem might be uncertain; for example, we might encounter a traffic jam on the
road. Optimization seeks to find the best compromise between the various possible
risks.

In the presence of uncertainty, the optimizer (or decider) will often take advantage
of information about the system that becomes available dynamically, i.e. gradually
over time. For example, we will gradually discover which roads are most susceptible
to traffic jams over time, as we try them out. The difficulty of an optimization problem
is closely linked to the amount of information needed to make an optimal decision.
A problem is said to be large if this quantity of information is too big for classical
solving techniques to be applied by brute force.

This book is divided into two parts: programming (Part 1) and optimization
(Part 2). In the programming part, we present a collection of tools for operations
research, including linear programming, integer programming, binary programming,
dynamic programming and stochastic programming. Operations research first arose
in the United Kingdom during the Second World War, when scientific methods were
used to study various aspects of military operations. Since then, it has become a key
element of decision-making processes in various commercial, industrial and
governmental contexts, offering a systematic way to apprehend the ever increasing
complexity of the management problems faced by both the private and public sectors.
xii Optimizations and Programming

Following its success in military matters during the Second World War,
operations research was applied to operational problems in the industry and private
sector for many years. In the last decade or so, its applications have been extended to
other domains, such as economics, finance, marketing and corporate planning. More
recently, operations research has been used to manage healthcare and education
systems, solve environmental problems and in other areas of public interest. Its
principal users are manufacturing, distribution and retail companies in the mining,
energy, transportation and construction sectors, as well as service companies such as
banks, and various government bodies. Noteworthy examples of recent applications
of operations research include logistical studies, railway safety, packaging design,
strategic workforce planning, aerial transportation, forestry operations, nuclear fuel
optimization, production planning, and so on.

The optimization part of this book is divided into three chapters: combinatorial
optimization, nonlinear optimization without constraints and nonlinear optimization
with constraints. It is entirely dedicated to numerical optimization algorithms, their
theoretical foundations and convergence properties, their implementation and
application, and other practical aspects. The objective is to familiarize readers with
these numerical algorithms in order to understand how they behave in practice, how
to properly take advantage of Matlab as a tool, how to design and adequately
implement such algorithms and how to correctly diagnose any difficulties that might
arise.

Each chapter starts with a few reminders of key results, but readers should not
hesitate to consult the references listed at the end of the book. This book is organized
according to a strictly linear approach. As a general rule, the concepts are illustrated
with examples. Each chapter ends with an example in Matlab.

Acknowledgments

We would like to thank everyone who contributed, directly or indirectly, to the


writing of this book and especially, the engineering and PhD students of INSA Rouen
whom we have had the pleasure of supervising over the past few years.

Bouchaib R ADI
Abdelkhalak E L H AMI
November 2020
PART 1

Programmation
1

Linear Programming

1.1. Introduction

Linear programming can be defined as a mathematical technique for solving


management problems. For example, suppose that a manager faced with various
options wishes to determine the optimal way to use the resources of a company to
achieve a specific objective, such as maximizing the utility or minimizing the cost.
The company’s problems can usually be modeled as a linear program (LP) consisting
of a certain number of resources [HIL 90]. For instance, the labor, raw materials
and capital are all resources available in limited quantities that must be distributed
optimally over various manufacturing processes. The approach to solving this type of
problem is divided into two key steps:
– model the problem with linear equations or inequalities that allow us to properly
identify and structure the constraints satisfied by the variables of the model. The
contribution of each variable to the company’s overarching objective must also be
defined as a function that will be optimized;
– find the mathematical optimum using specific linear programming techniques.
We will study three methods for solving the various types of linear programming
problems. The first is based on graphical solving and is therefore limited to two or
three variables. The second method is more algebraic; it motivates the third method
presented in this chapter, which is known as the simplex method (or algorithm).

1.2. Definitions

D EFINITION 1.1.– An LP is in canonical form if it is expressed as follows:



⎪ maxn < c, x >
⎨ x∈R
⎪ s.t. Ax ≤ b [1.1]
⎩ x≥0

Optimizations and Programming: Linear, Nonlinear, Dynamic, Stochastic and Applications


with Matlab, First Edition. Abdelkhalak El Hami and Bouchaib Radi.
© ISTE Ltd 2021. Published by ISTE Ltd and John Wiley & Sons, Inc.
4 Optimizations and Programming

A ∈ Mp,n (R), b ∈ Rp , and x ∈ Rn . We write x = (x1 , . . . , xn )T ≥ 0 if


x1 , . . . , xn ≥ 0.

An LP is in standard form if it is expressed as follows:



⎨ max cT x
s.t. Ax = b

x≥0

Every linear problem can be expressed in canonical form: min cT x = − max cT x.

T HEOREM 1.1.– Every LP in standard form can be expressed in canonical form and
vice versa.

Terminology

– The function cT x is the objective function, cost function or loss function.


– The components of the vector x are called decision variables.
– If the vector x satisfies all constraints, then x is an admissible solution.
– The set of all admissible solutions is the admissible set or admissible region.
– An admissible solution x∗ that maximizes the loss function (i.e. cT x∗ ≥ cT x for
every admissible x) is called an optimal admissible solution or optimal solution.

E XAMPLE 1.1.– A factory manufactures two products P1 and P2 while consuming


certain resources: equipment, labor and raw materials. The needs are listed in the
following table. Each resource is available in limited quantities.

P1 P2 Availability
Equipment 3 9 81
Labor 4 5 55
Raw materials 2 1 20

The two products P1 and P2 yield effective profits of 6 dhs and 4 dhs per unit.
The goal is to determine which (possibly non-integer) quantities of the products P1
and P2 the factory should produce to maximize the total profit from selling these two
products, subject to the availability of the resources.

Let x1 and x2 be the quantities of the products P1 and P2 , respectively.

The LP may be expressed as follows: maximize z(x1 , x2 ) = 6x1 + 4x2 subject to:
Linear Programming 5

– availability of resources:

3x1 + 9x2 ≤ 81
4x1 + 5x2 ≤ 55
2x1 + x2 ≤ 20

– positivity of variables: x1 , x2 ≥ 0

1.3. Geometry of the linear program

1.3.1. Polyhedra

D EFINITION 1.2.– A polyhedron is a set that can be described as

P = {x ∈ Rn | Ax ≤ b},

where A is an m × n matrix and b is a vector in Rm . Note that the admissible set of


an LP is a polyhedron.

D EFINITION 1.3.– A polyhedron P is said to be bounded if there exists a constant c


such that x ≤ c for every x ∈ P.

Figure 1.1. Bounded polyhedron (left) and unbounded polyhedron


(right). For a color version of this figure, see
www.iste.co.uk/radi/optimizations.zip

D EFINITION 1.4.– Let a be a non-zero vector of Rn , and let b be a scalar.


– The set {x ∈ Rn |aT x = b} is said to be a hyperplane.
– The set {x ∈ Rn |aT x ≥ b} is said to be a half-space.

Note that a hyperplane is the boundary of the corresponding half-space and the
vector a is perpendicular to the hyperplane that it defines [TEG 12].
6 Optimizations and Programming

1.3.2. Extreme points and vertices

Let P be a polyhedron and x∗ ∈ P. The point x∗ is an extreme point if and only if


x∗ is a vertex and x∗ is a basic admissible solution.

D EFINITION 1.5.– Let P be a polyhedron. A vector x ∈ P is an extreme point of P if


it cannot be expressed as a convex combination of two other points of P.

D EFINITION 1.6.– Let P be a polyhedron. A vector x ∈ P is a vertex of P if there


exists c such that
cT x < c T y
for every y in P not equal to x.

T HEOREM 1.2.– In linear programming, if the admissible domain is neither empty nor
the whole of Rn , it is a convex polytope with finitely many vertices that can either be
bounded or unbounded. If an extreme point exists, it is attained at one of the vertices
of the polytope. A point in the interior of the domain is never an extreme point if
f = 0. If the polytope is bounded, f attains both a minimum and a maximum on it.

This theorem gives us a graphical solving method.

1.4. Graphical solving of a linear program

The graphical method works by plotting lines and searching for a solution as
follows:
– identify the admissible domain;
– identify the contours;
– contours perpendicular to the vector c, and therefore mutually parallel;
– each value of z is associated with a contour;
– the value of z increases in the direction of c.

E XAMPLE 1.2.– Consider, again, the example from earlier. Its mathematical model is
defined by the following linear program:


⎪ max 6x1 + 4x2

⎪ (x1 ,x2 )∈R2



⎨ s.t. 3x1 + 9x2 ≤ 81
⎪ 4x1 + 5x2 ≤ 55



⎪ 2x1 + x2 ≤ 20


⎩ x1 , x 2 ≥ 0
Visit https://ebookmass.com today to explore
a vast collection of ebooks across various
genres, available in popular formats like
PDF, EPUB, and MOBI, fully compatible with
all devices. Enjoy a seamless reading
experience and effortlessly download high-
quality materials in just a few simple steps.
Plus, don’t miss out on exciting offers that
let you access a wealth of knowledge at the
best prices!
Exploring the Variety of Random
Documents with Different Content
across the sharp edge of his flint, he raised his musquet to his
shoulder, and was about to fire in the direction of the place where
Ronald and Evan stood concealed. Another second would perhaps
have sealed the fate of one of them, when the stiletto of the
dragoon glittered near him in the pale moonlight,—a heavy blow was
given, and a deep groan succeeded: the robber fell dying upon the
sward, while his musquet only flashed in the pan, and fell rattling
from his grasp without doing damage. Ronald rushed towards the
spot, and found the bloodthirsty sargento wiping his deadly weapon
with scrupulous accuracy, while he kept his foot upon the yet warm,
though breathless corpse of the man he had destroyed. The light of
the moon fell with a cold and ghastly lustre on the pale and rigid,
yet very fine features of the dead man, becoming contracted and
fierce with the recent death-struggle. His white and up-turned eyes
shone with a terrible glare, as the moon-beams fell on them, and
altogether there was something sad and appalling in the sudden
manner in which this desperado had been hurled into eternity, with
all his unrepented and manifold sins upon his head.
"Awfu' work this, sir!" said Evan with a shudder, while he
surveyed the stark and bold features of the slain, around whom a
black pool formed by his blood lay increasing. "A dour-looking chield
he is, wi' a gloom on his brow that would suit Rob Roy himsel."
"I would to Heaven, Gomez," observed the equally excited
Stuart, "you had found some other mode of silencing him than this;
there is somewhat in it at which I revolt."
The Spaniard laughed grimly.
"Senor," said he, "the man was only a robber; and when old
Murillo gets hold of such, he hangs them by scores at a time, and I
have seen a stout beech bending under a load of such devil's fruit.
Pho! senor, it matters not. We are now close upon the ruins of the
chapel, and the villains who harbour there have some formidable
allies,—mastiff dogs. I hear them growling, and I assure you, senor,
that a demon may be as easily dealt with as a Spanish hound. You
will require all your resolution and energy to—"
"I do not mean to relinquish the search, after having proceeded
so far," replied Ronald, interrupting the Spaniard, at whose tone he
felt a little piqued. "I assure you, Sargento Gomez, 'tis not the sight
of a little blood that will make the heart of a Scottish Highlander
fail."
"I meant not to offend, senor; but let us proceed. The ruins of
Santa Lucia are some twenty yards from this."
"Forward, then,—lead on!"
Ronald in passing possessed himself of the dead man's loaded
musquet and well-filled pouch of ball cartridges, an acquisition on
which he had soon reason to congratulate himself.

CHAPTER XV.
THE BANDITTI.

"'Tis na' for nought, bauld Duncan cried,


Sic shoutings on the wind:
Then up he started frae his seat,
A thrang of spears behind.
Haste, haste, my valiant hearts, he said,
Anes mair to follow me:
"We'll meet these shouters by the burn,—
I guess wha they may be."
Duncan: a Fragment.

Treading softly and warily, they came to an opening in the wood,


and found themselves close upon the ruins of the ancient structure.
It occupied the summit of a grassy mound, which sloped down on all
sides, and where the mouldered remains of some ancient crosses
and tomb-stones lay half sunk and buried among the long rank
grass. The chapel had almost disappeared; little remained save the
crypt; and at intervals, amid a heap of shattered stones, arose tall
ornamented buttresses (surviving the intermediate walls), their
summits glimmering in the moonlight, which streamed through loop-
holes and yawning rents in the massive masonry, showing the weeds
and grass which waved in every nook and corner, flourishing around
the prostrate effigies of departed warriors, whose monumental busts
lay stretched like rigid corses under their ruined canopies.
"The auld kirk o' Inchisla just ower again!" exclaimed Evan, as
he surveyed the heaps of prostrate pillars and crumbled arches with
feelings of awe and veneration.
"Santos! will you be silent?" asked Pedro, in a fierce whisper in
Spanish.
"I dinna ken what ye say, mon; ye are waur than an
Aberdonian."
"Keep silence, Evan!" said Ronald; "we are close upon their lair
now."
A ray of light, streaming through a cross-formed loop-hole, drew
them towards it; and on looking in, they beheld the assembled
conclave of the worthies they were in search of, but found them
more numerous than Lazaro Gomez had given them to believe. In
the crypt, or lower vaults of the chapel, stood upwards of twenty—
perhaps thirty, black-browed and swarthy desperadoes, clustered
around the marble pedestal of a tomb, upon which were displayed a
great quantity of coin, jewelry, and various articles of value, all
glittering in the streaming blaze of a huge oil lamp placed amid
them. Most of the fellows were attired in embroidered jackets,
adorned with rich military lace torn from the uniforms of the dead,
laced hose, and high-crowned sombreros adorned with feathers, or
long cloth head-dresses resembling a night-cap. Some, however,
were in absolute rags; none appeared to have been shaven for a
month at least, and had their ferocious faces covered with masses of
black glossy hair,—probably as a disguise, to be removed as occasion
required. All carried pistols and poniards in their sashes or waist-
belts, and most of them were armed with military carbines,
musquets, and accoutrements, French and English, thousands of
which were in these days to be found on every battle-field, and to
be had for the trouble of taking them away. Trunks, portmanteaus,
mails, and innumerable articles of plunder lay piled in various
corners.
Fastened by strong cords to the pillars which supported the
groined roof of the crypt, appeared five or six fierce Spanish mastiff
dogs, animals of a reddish colour generally, larger and stronger than
British greyhounds. They seemed aware of the approach of
strangers: every moment they made the hollow vaults ring with their
hoarse yells, while they rolled about their fierce red eyes, and shook
the snow-white foam from their jet-black muzzles as they strained
and strove, almost strangling themselves in the attempt, to snap the
cords which bound them to the stone columns.
"Senor, we must retire, if it please you," whispered Pedro; "it
would be worse than Moorish rashness if three of us were to
encounter thirty such devils. And then the dogs—"
"I fear we must abandon the attempt," replied the officer in a
voice of stern regret. "Discretion is the better part of valour, and
Narvaez and I may meet again; but now—"
"It is just a temptin' o' Providence, sir," said Evan, "to bide here,
wi' sic a nest o' born deils below us. What an awfu' looking gallows
rogue the chield is that counts oot the siller!"
The light fell fully upon the robber's face as Evan spoke.
"It is,—it is the very villain who fired at me near Merida,"
muttered Ronald almost aloud, in a tone of uncontrollable passion,
and feeling scarcely able to restrain himself from shooting Cifuentes
dead upon the spot; but he repressed the fierce sentiments of
intense hatred, indignation, and horror which he entertained for him,
and paused even when his hand was on the lock of the musquet
which he carried.
"Whelp!" exclaimed one furiously to Narvaez, "think you I will
thus tamely submit to be defrauded of my share in this matter?
Remember, you are not at your old work of dealing out sour wine at
Albuquerque! The rings I took from the image of our Lady at
Majorga were alone worth two hundred duros."
"Pesetas, you mean, Julian Diaz,—pesetas; they were copper
trash."
"I say duros; they were pure and beaten gold, embossed richly.
Methinks I should best know: I have prayed at that shrine some
hundred times ere—" He paused and grew pale.
"Bethink you, Julian, of my last night's work, and—"
"Bah! The stabbing of an old abogado."
"Old? Perdition seize him! he fought fiercely for his ill-gotten
gold. I broke the blade of a choice knife on the bones that cover his
hard heart. But silence, Diaz, my pet! Though we may eat flesh in
Lent, and rifle our Lady of Majorga, we would scorn to cheat each
other. Honour among—among—"
"Thieves! End the adage at once, driveller," cried he whom they
named Julian Diaz, a wild-looking fellow, with a broken nose and a
frightful squint. "Honour," he added impatiently, "sounds strangely
indeed in such a rogue's mouth as thine, Narvaez,—the broken
keeper of a wine casa."
"Why not?" cried a third. "Every man, from the king and the
soldier down to the lowest abogado, swears now by his word of
honour; and why may not we?"
"Agreed, agreed. Go on, diavolo! go on with the distribution,"
cried the others impatiently.
"Fiend take these dogs! what do they growl at? Some one
surely approaches."
"Impossible," answered Diaz. "Lazarillo is watching the only
approach, and all is right; so count on, Narvaez."
"Where was I? Ay—three hundred and ninety-eight, three
hundred and ninety-nine, four hundred reals," continued Narvaez,
counting the money, "are one hundred pesetas; now, we are thirty in
number, including Lazarillo—"
"But the necklace and rings which I took from the old lawyer's
daughter?" interrupted the avaricious Julian.
"San Jago of Compostella wither your accursed tongue!"
exclaimed Cifuentes, grasping fiercely the hilt of his poniard; "how
often am I to lose count by your interruptions? Allow me to deal to
each man his share, and then preach, as of old, until you are weary.
When you left your cloister at San Juan, you should have left there
your monkish greed with your beads and cowl. One hundred
pesetas, then, is—is—twenty duros," &c. &c.; and so on he
continued to reckon and count, while his brother desperadoes
watched round in silence, with louring looks of eagerness, ferocity,
and avarice, their hard-featured countenances appearing like those
of demons, as the yellow lustre of the lamp fell on their harsh
outlines.
"Let us retire now, while we may do so in safety," whispered
Ronald. "But how now, Pedro! what is the matter with you?" he
asked, on observing that the face of the Spaniard was pale, fierce,
and betrayed symptoms of deep excitement.
"Ah! senor officiale," he replied in a scarcely audible voice,
"Julian Diaz, the wretch who was this moment disputing with the
master rogue, has done me more wrong than even his life can atone
for."
"How—how so? Speak low and quickly."
"Two years ago I was about to be wedded to a girl of Merida,
Isobel Zuares,—a fair creature, senor, and of good birth, for her
grandfather had been an alcalde. The very evening before our
marriage, this fiend Julian Diaz, who was then a monk in the
Convento de San Juan, sacrilegiously conceived a passion for her at
the confessional, and bore her that night by force to the forest of
Albuquerque. Dios! O Dios! senor, I never again beheld her,—never
again in life at least: poor Isobel!" He paused a moment, and the
quivering muscles of his face, which appeared pale as that of a
spectre in the moonlight, showed the inward agony of his soul.
"Well, Pedro, and this Diaz—"
"Since that day has been a robber and outlaw: as such he has
eluded my search. But now—" He cocked and raised his carbine.
"For Heaven's sake—for our own sakes, beware what you do,
Gomez! We must retreat rather than attack. Our lives would pay for
our rashness in encountering so many."
"God be wi' us! Would ye be temptin' Providence by firing on sic
a nest o' caterans?" said Evan angrily, as he dragged Pedro from the
wall towards the gloomy dingle. "Come awa, ye desperate loon. If ye
haud your life at a bawbee only, I haud mine dearer than a' the
goud in the hill o' Keir; and there lies the ransom o' seven crowned
kings."
"Diavolo! I will not be restrained," cried the dragoon fiercely,
disengaging himself from the grasp of the Highlander. "I will revenge
Isobel Zuares, or die!" He rushed to the loop-hole, and fired at the
group of bandits. Julian Diaz, shot through the heart, fell dead
among his terrified comrades.
"Follow me, senors! I know every pass and thicket of the wood,
and will easily elude their pursuit," exclaimed Pedro, dashing into the
bushes, and threading his way at random through the maze of dark
thickets and entangled underwood. The two mountaineers, acting on
the first impulse of the moment, also sought safety by retiring, and
followed Pedro with ease and rapidity through every obstacle, having
been accustomed from their boyhood to thread the dense pine
forests of the Scottish highlands.
Onward they hurried at random, pressing aside the heavy
bushes and branches, getting themselves bruised and torn by sharp
brambles and hard stumps; but wounds and contusions were unfelt
or unheeded in the excitement of the moment, as they pressed
forward regardless of immediate consequences. Ronald was boiling
with inward rage and vexation to find himself retiring thus from
wretches whom he so heartily hated and despised, and more than
once he almost resolved to stand and fight against them to the
death; but his discretion overruled his desperate resolution, pointing
out that flight and deferring his revenge till another time would be
the most prudent course to pursue; but that a future time would
ever be, seemed at present very doubtful. Fiercely in pursuit,
following their path with scrupulous precision, came the outlaws,
eager for plunder and revenge. These savage desperadoes had,
however, been distanced by some hundred yards; but their shouts,
outcries, and the tread of their feet were distinctly heard as they
pursued with the speed and accuracy of men accustomed to the
ground, and to the irregular warfare of guerillas.
Now and then the gloom of the dark wood was illumined by a
lurid flash, as a random shot was fired in the direction of the
fugitives, who more than once had narrow escapes from being killed
or wounded; the latter was to be dreaded, as it would have ensured,
perhaps, a death of torture from the poniards of the bandits. A part
of the forest was now gained where the trees grew thinner and the
ground was more open; but their path was embarrassed by piled
masses of rocks, roots and stumps of decayed trees, entwined
bushes, fallen cork-trees, deep gorges and holes, and here and there
the stony bed of some bubbling brook. Nevertheless they still kept
their pursuers at the same distance, and trod on quickly and in
silence.
The moon, which had been obscured for some time, now broke
forth and lighted the wild scenery with the pale splendour of its
silvery light.
"These wretches are undoubtedly gaining upon us," said
Ronald, pausing a moment to listen and draw breath. "Your ill-timed
rashness, Pedro, will certainly cost us our lives."
"For my own I care not; but I regret that yours, noble senor, or
that of my gallant comrade, should be placed in such deadly peril by
me."
"It was a temptin' o' Providence to attack sic a gang," observed
Evan, who had begun to comprehend Spanish a little. "O'd, sir! gin
we had but ten o' our ain braw fellows here, we would soon gar
them ca' a halt."
"Yes; oh! had we but so many of the Gordon Highlanders here, I
would soon give these vagabonds fight,—thirty of them though there
be."
"Twenty-eight, senor; my hand has struck two from the muster-
roll," said Pedro, ducking his head to avoid a shot which whistled
past.
"There they are now. How it stings me to the heart's core to fly
thus before such a despicable crew!"
As the moon shone forth again, their pursuers were distinctly
seen behind, bounding over rocks and leaping through bushes,
clearing every impediment with the activity of roes, while the wild
yells, maledictions, and blasphemy with which they startled the far
echoes of the lonely forest, imparted to the scene a singular and
exciting, but certainly terrible effect. Some becoming weary, or
missing the track, their numbers were now diminished to about a
score, and shot upon shot they sent after the three fugitives, the
glitter of whose polished appointments they could plainly discern in
the moonlight.
"Fire on them! take a cool and deliberate aim, that every shot
may take down its man!" cried Ronald, in a voice which had become
hoarse with passion and fatigue; while, by way of example, he
levelled the musquet of the dead robber over a fragment of rock,
and let fly its contents at the nearest pursuer, who fell with a shriek
that started the wild birds in the farthest recesses of the wood, and
gave a temporary check to the ardour of the banditti, who still
followed them closely but more warily,—firing at them from behind
rocks and bushes, maintaining a running skirmish which,
notwithstanding the danger, had something very exciting in it, and
pleased Ronald's bold and fiery disposition better than the
unresisting manner of their previous flight.
"Our Lady of Majorga, assist us!" cried Pedro in a voice of
dismay. "We are lost now, senor: the fiends have brought up the
dogs to their assistance."
"Pause not a second, but fire and reload; we have steel and
lead for the dogs, as well as for their less noble masters. Excellent!
that shot told well, Evan."
"Ay, sir, the fallow is kicking up his shoon like a red-rae. I see
his legs in the moonlicht dangling ower the cairn o' stanes," replied
the other, coolly trailing his piece, and ramming another charge hard
home. "But o'd, sir, look at thae awfu' black tykes, louping ower
scaur and bush, bank and brae like fairies, or sic-like awsome things.
Sleuth-dugs, I declare! the born deevils!"
"Demonios! senors. I tell you we are lost," said Pedro, in a tone
of anger and impatience. "You know not the unmatched ferocity of
our Spanish mastiffs. They are yet far off; but should they reach us,
all the rotten bones in the relicario of San Juan would not save us, if
we had them here."
"Take courage, sargento! I place more reliance upon a strong
hand and a bold heart, than all the relicarios in Spain: but, certes,
these are most devilish antagonists."
Leaping over every intervening obstacle with incredible speed,
onward came the six mastiff dogs, yelling and growling as if
Pandemonium had broken loose. Clearing rock and bush at a bound,
on they came, their glossy skins and starting eyes shining and
gleaming in the light, which showed distinctly one that had
outstripped its comrades. Its growls were deep and hoarse; the
snow-white foam was dropping on the grass and leaves from its red
open mouth, as it came careering forward with the fearlessness,
ferocity, and determination of some diabolical spirit.
"For this one I will reserve my fire," said Stuart, knowing himself
to be a deadly shot; "meanwhile blaze away, and aim steadily, brave
hearts!"
"A minute more and it will be upon us; one must certainly
become its victim," replied Pedro: "that victim must be me, if my
poniard fails to dispatch it. My rashness brought this about, and I am
ready to pay the penalty."
"Pshaw! never despond. Mark that fellow with the red cap."
"He is down, senor," replied the other coolly, as he shot the man
dead. "I can die content. I have gained vengeance on Julian Diaz,
and I should have been no true Spaniard had I not revenged
myself."
"I will hold you but medio Español, if you talk thus. Courage,
good Pedro! I will rid us of this pursuer,—my aim is deadly."
"Could we but escape this one, our safety would be secured. On
the other side of this stream is a cavern, the mouth of which is
concealed and overgrown with wild vines; but I know it well, as I do
every foot of ground hereabout. Let us but gain it, and we can
remain there in safety until some assistance arrives. We are now
close on the road that leads from La Nava to Albuquerque."
They found themselves on the brink of a rushing torrent, which,
hurrying down from the summits of the Sierra de Montanches, swept
over its rugged channel towards the Guadiana, seeking the most
unfrequented and solitary gorges and defiles to wander through.
"Let us jump into the burn, sir," cried Evan eagerly. "Let us jump
in, and gang up the water a wee bit, and the sleuth hounds will sune
tyne the scent. My faither, the piper, aye telled that was the only way
to get rid o' evil speerits and sic-like, to put a rinnin water between
them and yoursel."
"Right, Evan! we are almost safe. Plunge in: follow me!" cried
Ronald, springing into the stream, which rose to his waist: the others
followed. Keeping close under some weeping willows, that thickly
overhung the water, they eluded the search of the ferocious dog,
which at that instant gave a yell of disappointment as it shook the
foam from its chaps, and stood panting and growling on the bank
above them. It next ran fiercely to and fro, snorting and snuffing the
air, and tearing up huge pieces of turf with its sharp fangs, as if to
discover the lost prey.
"We must cross and gain the cavern now, senor, while the
rogues are so far in our rear," said Pedro Gomez, after they had
advanced up the bed of the current a little way, treading with
difficulty on the slippery pebbles. "I know the path, senor officiale;
follow me promptly, if you please,—now is the critical time to elude
them altogether." Pedro sprang with agility up the steep bank;
Ronald followed, but poor Evan, encumbered by his wet tartan kilt,
which in the hurry he had neglected to lift in the Highland manner,
stumbled in the centre of the rushing torrent, and at the moment he
fell backwards the fierce quadruped sprung upon him from the bank
above with a wild yell, and seizing him by the thick folds of his
filledh-beg, drew him under water. He was so much disconcerted at
finding himself grasped by the terrible foe, that he was only able to
utter a faint cry when the stream closed over him; but yet he
struggled fiercely with his growling antagonist.
"God, he is lost!" exclaimed Ronald, when on looking back he
beheld the danger of his faithful follower. Half swimming, he hurried
to the spot, with his broad-sword shortened in his hand, and
grasping the dog by the throat, plunged the sharp weapon twice
through its body. Its teeth relaxed the hold of Evan's tartan, and the
quivering carcase floated bleeding down the stream; while the
rescued Highlander, propping himself with his musquet, (which
luckily he had never relinquished,) sprang up the bank, where he
shook himself like a water-dog, the wet streaming from his bonnet
and every part of his dress.
"Viva! noble cavalier; gallantly done! Follow me, this is the
cavern," exclaimed Pedro; and rushing up a steep ascent, they
followed his example in plunging at once through a thicket of dark
green bushes, and found themselves in a gloomy hole, the extent or
height of which it was impossible to discover, being involved in utter
darkness. The densely thick foliage around the entrance formed a
complete exclusion to the light of the moon, which now revealed a
dozen or more of their pursuers on the opposite bank of the stream,
about which they hunted in every direction for some trace of those
they had pursued, and urged on their dogs, which, now completely
at fault, ran up and down scenting among the willow trees and
shelving rocks, mingling their hoarse baying with the loud and bitter
curses of the banditti.

CHAPTER XVI.
A SIEGE.

"Fore-doomed is every felon Scot,


Who stains our native land.
****
In ambush, near this darksome stream,
Five hundred rifles lay;
The water-kelpie stroaked his beard,
And nichered for his prey."
Daniel Vedder.

"They must be somewhere hereabout," cried Cifuentes with a


horrible oath, speaking at intervals, while he panted with exhaustion
and fatigue. "But where in the name of Beelzebub can they have
concealed themselves?"
"They crossed the stream, I can swear," replied one fellow while
he loaded his musquet. "I saw them descend the bank with my own
eyes."
"You could scarcely see them well with another man's, Puerco
Vadija; but there is no trace of them on the opposite bank. One of
the dogs is missing, too."
"There it lies, floating among the rocks and foam yonder,"
replied a third ruffian.
"Dead?"
"Ay, dead as Judas."
"Demonios! How can these cursed fiends have escaped us?"
"Fiends they appear to be, certainly. They were but three in
number, and a hundred shots have missed them, while they have
slain some of our best men."
"By all the might of hell!" exclaimed Narvaez, in a voice of bitter
rage, "they shall not escape us, if we once more gain sight of them.
To the gay bravo with the large black feathers I bear a hatred, that
every drop of blood in his coward heart only can quench. To think
that they should escape us scathless, after having slain so many!"
"Poor Julian Diaz!" said Vadija. "A more jolly monk was not in
Estremadura, where there are well nigh six thousand of the cord and
cowl."
"Dios! it maddens me!"
"And then the brave Lazarillo de Xeres de los Cavalleros—"
"How, Vadija! what of him?"
"I found him lying dead in the pathway, stabbed twice in the
heart."
"Hombres! Close round me, comrades; we must fall on some
plan to seek vengeance. It is evident they have not crossed the
stream,—we must have seen them had they done so; therefore they
must be close at hand, and—" The rest was lost in the clamour of
the others, who clustered round Cifuentes, each delivering his
opinion, and holding forth obstinately against those of his brother
rogues, many more of whom were coming straggling up from the
rear, panting and almost breathless with exertion. Meanwhile the
three fugitives had thrown themselves, wet as they were, upon the
damp floor of the cavern, happy to find rest and time to breathe
with some regularity and composure.
From behind their screen of thick foliage Ronald heard all that
passed, and watched with increasing interest the picturesque
appearance of the bandits, whom he could plainly discern in the
radiant moonlight, that shed its clear cold lustre through the dark
blue vault, where myriads of stars were twinkling. Meanwhile
Iverach, who had quite recovered from the dismay caused by his
recent immersion, was busily employed drying his wetted musquet,
and preparing for action by fixing a new flint and reloading, rejoicing
to find that his thick leather pouch had kept his ball cartridges
perfectly dry.
"Thanks to Santa Maria, we are safe, senors," said Pedro; "they
can never discover this cavern, which is so admirably adapted for
concealment. It was in ancient days the retreat of a holy hermit,
who was drowned one dark night in the river below,—but that came
of eating flesh upon a Friday, they say."
"I wish we had gone to Majorga with your brother Lazaro; this
cursed adventure would then have been avoided. This hole is very
damp, and cold as the grave."
"But then it is so secure, senor; and we can defend it to the
last, and sell our lives dearly, should they attack us." Before Ronald
could reply,
"Bah! Lope Ordonez," cried Narvaez, "how should they know of
this concealed cavern which you say is up yonder? Are they not
British? and two of them belong to those savages that go with their
limbs bare."
"The same guide that led them to the ruins of Santa Lucia,
might show them the cavern."
"Right, Ordonez. I thought not that there was so much wit in
that empty calabash of thine."
"They have a Spaniard with them," said he whom they named
Vadija; "I saw the moon reflected on his steel helmet."
"A dragoon! Had he a plume of red horsehair?"
"He had; but I think he has left the half or whole of it among
the bushes in his flight."
"Caramba! then 'tis either Don Alvaro, or one of his rascally
troop! I shall have revenge for the night they made me spend in the
Convento de San Juan at Merida. We will search this cavern, and
take a true Spanish vengeance on whoever we find there. Look well
to your knives and flints, comrades."
"I perceive," said Ordonez, "some alteration has taken place
among the vines which conceal the entrance. They are all broken
and trodden down; I can swear they were not so this morning."
"Then there it is they are concealed. Tie up the dogs; bind them
to the trees; cross the stream. Let whoever thirsts for vengeance,
follow me! let whoever is concealed there tremble, for their hour is
come!" said Narvaez, concluding with one of those frightful Spanish
maledictions with which their conversation was so freely
interspersed. The reader may suppose with what feelings of
excitement and desperation the three weary fugitives beheld their
remorseless pursuers boldly cross the stream to storm their hiding-
place. But perhaps Cifuentes and his followers would have advanced
less courageously, had they been perfectly assured that those of
whom they were in search were really so close at hand.
"Thank Heaven, and our own caution, the ammunition is dry,"
said Ronald; "and the sixty rounds we have among us will last until
to-morrow, if we are sparing and aim well. Let us fire on them as
they cross the stream; 'tis neck or nothing with us now. See that you
make sure of your men: I will aim at Cifuentes,—the scoundrel with
the long feather and high-crowned hat."
The three musquets at once flashed from the dark cavern, the
distant recesses of which echoed to the loud report, while the
sudden light filled its windings and craggy nooks, illuminating them
for an instant as a flash of lightning would have done. Three of the
banditti fell splashing in the middle of the stream, which bore them
off from the reach of their comrades, whom this unlooked-for volley
had stricken with dismay. Ronald missed Narvaez, owing to a sudden
motion of the latter; but severely wounded Puerco Vadija, who was
behind him. Evan and Pedro had both killed their men.
The wild shrieks and outcries of the drowning robber, re-echoing
among the windings of the stream, so greatly appalled and terrified
his brother rogues, that, instead of advancing to the assault, they re-
crossed the stream, fled up the bank, and ensconced themselves
behind the rocks and trees, seeking shelter from the deadly aim of
their concealed enemies, and abandoning Vadija to his fate; but his
last drowning cry, as it came sweeping towards them on the night-
wind, found an echo in the heart of his slayer. From behind the
covers where they had posted themselves, a sharp fire was
maintained on both sides for some hours, without any damage being
done. However, the three soldados had the best of it in this bush-
fighting sort of warfare, as they could aim steadily at a head, or a
leg, or an arm, the moment it appeared in view, without exposing
themselves in the slightest degree; while their opponents took for
their object of attack the large dark cluster of vines which concealed
the cavern's mouth, and leaden bullets innumerable came whistling
through the intertwined foliage, and were flattened against the
rocks, or sunk with a loud bang into the soft green turf near its
entrance. But Ronald and his friends escaped most miraculously,
while the shot hissed often within an inch of their ears, causing a
peculiarly unpleasant and tingling sensation within them, which must
be experienced to be comprehended properly.
"Dios mio, senors! my cartridges are nearly expended. I have
but six left," cried the dragoon, shaking the little cartridge-box which
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookmasss.com

You might also like