0% found this document useful (0 votes)
26 views91 pages

Matlab For Engineering Berardino Dacunto Download

The document is a promotional and informational piece about the book 'MATLAB for Engineering' by Berardino D'Acunto, which serves as an introduction to MATLAB for engineering students and professionals. It covers essential MATLAB commands, matrix manipulation, and applications in solving partial differential equations using methods like Finite Element and Finite Difference. The book includes numerous examples and exercises to aid learning and is published by World Scientific Publishing Co.

Uploaded by

chawihaleen
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
0% found this document useful (0 votes)
26 views91 pages

Matlab For Engineering Berardino Dacunto Download

The document is a promotional and informational piece about the book 'MATLAB for Engineering' by Berardino D'Acunto, which serves as an introduction to MATLAB for engineering students and professionals. It covers essential MATLAB commands, matrix manipulation, and applications in solving partial differential equations using methods like Finite Element and Finite Difference. The book includes numerous examples and exercises to aid learning and is published by World Scientific Publishing Co.

Uploaded by

chawihaleen
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/ 91

Matlab For Engineering Berardino Dacunto

download

https://ebookbell.com/product/matlab-for-engineering-berardino-
dacunto-48710470

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Matlab For Engineering Applications 5e Ise 5thise William J Palm Iii

https://ebookbell.com/product/matlab-for-engineering-
applications-5e-ise-5thise-william-j-palm-iii-46562738

Matlab For Engineering Applications 5th Edition William Palm

https://ebookbell.com/product/matlab-for-engineering-applications-5th-
edition-william-palm-46651690

Matlab For Engineering And The Life Sciences 2nd Edition Joe
Tranquillo

https://ebookbell.com/product/matlab-for-engineering-and-the-life-
sciences-2nd-edition-joe-tranquillo-49437374

Matlab For Engineering And The Life Sciences 1st Edition Joseph V
Tranquillo

https://ebookbell.com/product/matlab-for-engineering-and-the-life-
sciences-1st-edition-joseph-v-tranquillo-4588060
Matlab For Engineering Applications 4th Edition William J Palm Iii

https://ebookbell.com/product/matlab-for-engineering-applications-4th-
edition-william-j-palm-iii-10472982

Matlab For Engineering Dacunto Berardino

https://ebookbell.com/product/matlab-for-engineering-dacunto-
berardino-232616738

Solution Manual Matlab For Engineering Applications 4th Edition


William Palm Iii

https://ebookbell.com/product/solution-manual-matlab-for-engineering-
applications-4th-edition-william-palm-iii-48700276

Octave And Matlab For Engineering Applications Andreas Stahel

https://ebookbell.com/product/octave-and-matlab-for-engineering-
applications-andreas-stahel-43364816

Matlab For Electrical And Computer Engineering Students And


Professionals With Simulink Roland Priemer

https://ebookbell.com/product/matlab-for-electrical-and-computer-
engineering-students-and-professionals-with-simulink-roland-
priemer-6838280
12380_9789811240669_TP.indd 1 9/7/21 9:15 AM
B1948 Governing Asia

This page intentionally left blank

B1948_1-Aoki.indd 6 9/22/2014 4:24:57 PM


World Scientific

12380_9789811240669_TP.indd 2 9/7/21 9:15 AM


Published by
World Scientific Publishing Co. Pte. Ltd.
5 Toh Tuck Link, Singapore 596224
USA office: 27 Warren Street, Suite 401-402, Hackensack, NJ 07601
UK office: 57 Shelton Street, Covent Garden, London WC2H 9HE

Library of Congress Cataloging-in-Publication Data


Names: D’Acunto, Bernardino, author.
Title: MATLAB for engineering / Berardino D’Acunto, University of Naples Federico II, Italy.
Description: New Jersey : World Scientific Publishing Co. Pte. Ltd., [2022] |
Includes bibliographical references and index.
Identifiers: LCCN 2021033978 | ISBN 9789811240669 (hardcover) |
ISBN 9789811240676 (ebook for institutions) | ISBN 9789811240683 (ebook for individuals)
Subjects: LCSH: Engineering--Data processing. | MATLAB.
Classification: LCC TA345 .D24 2022 | DDC 620.001/51--dc23
LC record available at https://lccn.loc.gov/2021033978

British Library Cataloguing-in-Publication Data


A catalogue record for this book is available from the British Library.

Copyright © 2022 by World Scientific Publishing Co. Pte. Ltd.


All rights reserved. This book, or parts thereof, may not be reproduced in any form or by any means,
electronic or mechanical, including photocopying, recording or any information storage and retrieval
system now known or to be invented, without written permission from the publisher.

For photocopying of material in this volume, please pay a copying fee through the Copyright Clearance
Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, USA. In this case permission to photocopy
is not required from the publisher.

For any available supplementary material, please visit


https://www.worldscientific.com/worldscibooks/10.1142/12380#t=suppl

Desk Editor: Amanda Yun

Typeset by Stallion Press


Email: enquiries@stallionpress.com

Printed in Singapore

Amanda - 12380 - Matlab for Engineering.indd 1 14/9/2021 9:43:41 am


September 8, 2021 11:37 Matlab for Engineering 9in x 6in b4335-FM page v

Preface

This book provides an introduction to Matlab for engineering students and


engineers. However, the book can also be useful for students, technicians
and researchers in all scientific areas whenever they need to apply Matlab
to solve problems arising from their areas of studies, work and research.
It is assumed that they do not have any initial Matlab knowledge and the
reader is very interested to learn this powerful tool of scientific computing.
After introducing the essential Matlab commands, mainly devoted to
matrix manipulation, most of the other commands are presented in action,
within programs aimed at solving specific problems. In the first part of
the book, the function file is presented. This concept plays a basic role in
Matlab programming and, therefore, is illustrated with many examples.
Since physical processes occur very often in space and time, the
related governing equations are partial differential equations. Therefore,
most Matlab programs in this book are devoted to solve these types of
equations. Both the Finite Element Method and Finite Difference Method
are introduced and applied. Generally, a problem is discussed globally:
the mathematical model from the physical phenomena is derived and the
equations are solved with Matlab.
The book presents more than a hundred listings and number of exercises
at the end of each chapter.
I wish to thank World Scientific Publishing for inviting me to write this
book. Special thanks are due to Shaun Tan Yi Jie, who helped me while I
was writing the book.

Berardino D’Acunto Naples, March 2021

v
B1948 Governing Asia

This page intentionally left blank

B1948_1-Aoki.indd 6 9/22/2014 4:24:57 PM


September 8, 2021 11:37 Matlab for Engineering 9in x 6in b4335-FM page vii

Contents

Preface v
Chapter 1. Function Files 1
1.1 Matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Creating Matrices . . . . . . . . . . . . . . . . . . 1
1.1.2 Matrix Indexing . . . . . . . . . . . . . . . . . . . 2
1.1.3 Matrix Manipulation . . . . . . . . . . . . . . . . 4
1.1.4 Tridiagonal Matrices . . . . . . . . . . . . . . . . . 6
1.1.5 Matrix Operations . . . . . . . . . . . . . . . . . . 8
1.1.6 Right and Left Divisions . . . . . . . . . . . . . . 9
1.2 Script Files . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.2.1 For Loop . . . . . . . . . . . . . . . . . . . . . . . 10
1.2.2 Examples of Script Files . . . . . . . . . . . . . . 11
1.3 Introduction to Function Files . . . . . . . . . . . . . . . . 15
1.3.1 Structure of Function Files . . . . . . . . . . . . . 15
1.3.2 Function with a Multiple Output Variable . . . . 17
1.3.3 Flow Control Structures . . . . . . . . . . . . . . . 19
1.3.4 Local Functions, Anonymous Functions . . . . . . 25
1.3.5 Logical Operators and Logical Functions . . . . . 27
1.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

Chapter 2. The Finite Difference Method 39


2.1 Finite Difference Approximations of Derivatives . . . . . . 39
2.1.1 Forward, Backward and Central Approximations . 39

vii
September 8, 2021 11:37 Matlab for Engineering 9in x 6in b4335-FM page viii

viii Matlab for Engineering

2.1.2 Approximation of Functions Depending on Two


Variables . . . . . . . . . . . . . . . . . . . . . . . 46
2.1.3 Approximation of Higher Order Derivatives . . . . 47
2.2 Diffusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
2.2.1 Fourier’s Law and Heat Equation . . . . . . . . . 49
2.2.2 Fick’s Law and Diffusion . . . . . . . . . . . . . . 55
2.2.3 Free Boundary Value Problems . . . . . . . . . . . 56
2.3 Finite Difference Method . . . . . . . . . . . . . . . . . . . 58
2.3.1 Explicit Euler Method . . . . . . . . . . . . . . . . 58
2.3.2 Stability, Convergence, Consistence . . . . . . . . 64
2.3.3 Boundary Value Problems . . . . . . . . . . . . . 68
2.3.4 Diffusion in a Multi-layer Medium . . . . . . . . . 76
2.3.5 Implicit Euler Method . . . . . . . . . . . . . . . . 80
2.3.6 Crank–Nicolson Method . . . . . . . . . . . . . . . 84
2.3.7 Von Neumann Stability Criterium . . . . . . . . . 89
2.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93

Chapter 3. Diffusion and Convection 99


3.1 Convection-diffusion Equation . . . . . . . . . . . . . . . . 99
3.1.1 Upwind Method . . . . . . . . . . . . . . . . . . . 99
3.1.2 Other Finite Difference Methods for the
Convection-Diffusion Equation . . . . . . . . . . . 107
3.1.3 Advection Equation . . . . . . . . . . . . . . . . . 111
3.2 Method of Lines . . . . . . . . . . . . . . . . . . . . . . . 118
3.2.1 Heat Equation . . . . . . . . . . . . . . . . . . . . 118
3.2.2 Nonlinear Equations . . . . . . . . . . . . . . . . . 127
3.2.3 Variable Diffusivity Coefficient . . . . . . . . . . . 133
3.2.4 Convection-Diffusion Equation . . . . . . . . . . . 136
3.3 Saving Data and Figures . . . . . . . . . . . . . . . . . . . 140
3.3.1 Save Function . . . . . . . . . . . . . . . . . . . . 140
3.3.2 Load Function . . . . . . . . . . . . . . . . . . . . 142
3.3.3 Saving Figures . . . . . . . . . . . . . . . . . . . . 143
3.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143

Chapter 4. Introduction to the Finite Element Method 153


4.1 Numerical Integration . . . . . . . . . . . . . . . . . . . . 153
4.2 Finite Element Method . . . . . . . . . . . . . . . . . . . 164
4.2.1 Axial Motion of a Bar . . . . . . . . . . . . . . . . 164
4.2.2 Weak Solution . . . . . . . . . . . . . . . . . . . . 167
September 8, 2021 11:37 Matlab for Engineering 9in x 6in b4335-FM page ix

Contents ix

4.2.3 Shape Functions . . . . . . . . . . . . . . . . . . . 169


4.2.4 Boundary Value Problems . . . . . . . . . . . . . 171
4.2.5 Axial Displacement and Stress in a Bar . . . . . . 180
4.2.6 Concentrated Force and Dirac Function . . . . . . 184
4.3 Partial Differential Equations . . . . . . . . . . . . . . . . 189
4.3.1 Diffusion Equation . . . . . . . . . . . . . . . . . . 189
4.3.2 Wave Equation . . . . . . . . . . . . . . . . . . . . 197
4.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205

Chapter 5. Introduction to the Finite Element Method


in Two Spatial Dimensions 213
5.1 Elliptic Partial Differential Equations . . . . . . . . . . . . 213
5.1.1 Green’s Identities . . . . . . . . . . . . . . . . . . 213
5.1.2 Boundary Value Problems . . . . . . . . . . . . . 214
5.2 Finite Element Method in Two Spatial Dimensions . . . . 217
5.2.1 Shape Functions . . . . . . . . . . . . . . . . . . . 217
5.2.2 Weak Form of the Poisson Equation . . . . . . . . 225
5.2.3 Dirichlet–Neumann Problem . . . . . . . . . . . . 230
5.2.4 Applications to the Dam and Sheet Pile Wall . . . 234
5.3 Finite Difference Method . . . . . . . . . . . . . . . . . . . 240
5.3.1 Five-Point Method . . . . . . . . . . . . . . . . . . 240
5.3.2 Model of a Dam . . . . . . . . . . . . . . . . . . . 247
5.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 257

Chapter 6. The Euler–Bernoulli Beam 267


6.1 Finite Element Method . . . . . . . . . . . . . . . . . . . 267
6.1.1 Euler–Bernoulli Beam Equation . . . . . . . . . . 267
6.1.2 Shape Functions . . . . . . . . . . . . . . . . . . . 270
6.1.3 Weak Form . . . . . . . . . . . . . . . . . . . . . . 274
6.2 Statics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
6.3 Beam Subjected to Concentrated Forces . . . . . . . . . . 296
6.4 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305

Bibliography 311
Index 313
B1948 Governing Asia

This page intentionally left blank

B1948_1-Aoki.indd 6 9/22/2014 4:24:57 PM


September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 1

Chapter 1

Function Files

Matlab1 derives its power from its extensive capability of manipulating


matrices. Therefore, this topic is discussed in the first section of this chapter.
The name “Matlab” cames from Mat(rix) lab(oratory). Matlab programs
are written in files with an .m extension. There are two kinds of m-files:
script files and function files. The latter are much more interesting than
the former. Script files are illustrated in Sec. 1.2 while function files are
discussed in Sec. 1.3. See Moler (2011), which could be useful for the topics
in Sec. 1.1.

1.1 Matrices
1.1.1 Creating Matrices
The command
A = [1 2 3; 4 -5 6; 7 8 -9]
creates the matrix
⎡ ⎤
1 2 3

A= 4 −5 6 ⎦.
7 8 −9

The command A’ generates the transpose matrix of A. Therefore, the


command
B = A’

1 Matlab is a registered trademark of The MathWorks, Inc.

1
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 2

2 Matlab for Engineering

produces the matrix


⎡ ⎤
1 4 7
B = ⎣2 −5 8 ⎦.
3 6 −9
A matrix with one row is a row vector and a matrix with one column is a
column vector. For example, the command
rv = [10 11 12 13]
produces

rv = [10 11 12 13]

and the command


cv = [pi; cos(pi)]
produces
 
3.1416
cv = .
−1.000
As noted, π is introduced in Matlab with the notation pi.

1.1.2 Matrix Indexing


To access specific elements of a matrix, use indexing. To refer to a single
element, use the A(i,j) command. For example, if A is the matrix introduced
beforehand, then the command
A(2,3)
returns 6 and the command
A(2,3) = 16
replaces 6 with 16 in A
⎡ ⎤
1 2 3
A = ⎣4 −5 16 ⎦.
7 8 −9
To access a submatrix of a matrix, use the colon operator. The A(i,:)
command returns the i-th row of A. For example, the command
A(2,:)
returns

[4 − 5 16],
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 3

Function Files 3

and the command


A(2,:) = 2*A(2,:)
replaces the preceding row in A with the row 8 −10 32
⎡ ⎤
1 2 3
A = ⎣8 −10 32 ⎦.
7 8 −9

The A(i:h,:) command, where i ≤ h, produces the submatrix formed by the


rows: i, i + 1, . . . , h. For example, the command
A(2:3,:)
produces
 
8 −10 32
,
7 8 −9
and the command
A(2:3,2:3)
produces
 
−10 32
.
8 −9
The previous command can also be used to extract submatrices with non-
consecutive rows (or columns). See Exercises 1.4.1 and 1.4.2.
The row vectors can be created with specific commands too. The
x = linspace(x1, x2, n) command creates a row vector of n equally spaced
elements from x1 to x2 with step (x2 − x1)/(n − 1). For example, the
command
x = linspace(0, 10, 6)
generates the vector

x = [0 2 4 6 8 10].

The same vector is generated with the x = 0:2:10 command, where the
initial value, step and final value are specified. Step 1 can be omitted. For
example, the command
y = 0:10
produces

y = [0 1 2 3 4 5 6 7 8 9 10].
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 4

4 Matlab for Engineering

The v(end) command returns the last element of the vector v. For example,
the command
y(end)
returns 10. This command can be useful when a vector is crested dynam-
ically during the program execution and the vector length is not known a
priori.
The A(i,:) = [ ] command deletes the i-th row of the matrix A.
For example, the A(3,:) = [ ] command deletes the third row and the
A([1 3],:) = [ ] command deletes the first and third rows. More generally,
the A(i:h,:) = [ ] command, where i ≤ h, deletes the rows from i to h.
This is similar for columns. The previous command can be used in other
situations. See Exercise 1.4.3.

1.1.3 Matrix Manipulation


A matrix can be appended to another, provided the dimensions match.
After creating the matrices C and D, and the vector x
C = [1 2 3; 4 5 6]; D = [7 8; 9 10]; x = [11; 12; 13];
the commands
[C D]
[C; x’]
produce the following matrices
⎡ ⎤
  1 2 3
1 2 3 7 8
, ⎣ 4 5 6 ⎦.
4 5 6 9 10
11 12 13

The [D x] and [C x] commands generate error messages. The reader is


asked to do Exercise 1.4.4.
Matlab provides commands to quickly generate specific matrices. The
ones(m,n) and zeros(m,n) commands produce m-by-n matrices of ones
and zeros, respectively. The eye(m,n) command generates the m-by-n unit
matrix. For example, the commands
eye(2,3)
eye(2)
return
   
1 0 0 1 0
, .
0 1 0 0 1
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 5

Function Files 5

If x is a vector of n elements, the diag(x) command creates a square matrix


and places the elements of x on the main diagonal. For example, if
x = [1 2 3];
the command
diag(x)
produces
⎡ ⎤
1 0 0
⎣0 2 0⎦.
0 0 3
The diag(x,h) command creates a square matrix and places the elements
of x along the diagonal specified by h, where h = 0 indicates the main
diagonal, while h > 0 specifies a diagonal in the upper triangular part of
the matrix and h < 0 specifies a diagonal in the lower triangular part.
Therefore, the diag(x,0) command generates the same matrix as before and
the commands
diag(x,-2)
diag(x,1)
produce the following matrices
⎡ ⎤
0 0 0 0 0 ⎡ ⎤
⎢0 0 0 0 0⎥ 0 1 0 0
⎢ ⎥ ⎢ ⎥
⎢1 0 0 0 0⎥, ⎢0 0 2 0 ⎥.
⎢ ⎥ ⎣0 0 0 3 ⎦
⎣0 2 0 0 0⎦
0 0 0 0
0 0 3 0 0
If u is a vector, the A = reshape(u,n,m) command reshapes u into the n-by-
m matrix A. The number of elements in u must be n × m, otherwise the
command will generate an error message. For example, after creating the
vector u with the command
u = [1; 2; 3; 4; 5; 6];
the command
A = reshape(u,2,3)
generates the 2-by-3 matrix
 
1 3 5
A= .
2 4 6
Of course, the command works with matrices too. Indeed, the command
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 6

6 Matlab for Engineering

B = reshape(A,3,2)
produces the 3-by-2 matrix


1 4
B = ⎣2 5⎦.
3 6

The A(:) command reshapes the matrix A into a column vector. For
example, the command
v = A(:)
returns the original vector u. The reader is asked to do Exercise 1.4.5.

1.1.4 Tridiagonal Matrices


Tridiagonal matrices can be created with the diag(x,h) command. For
example, after creating the vectors
x1 = [1 1 1]; u =[2 2 2 2]; x2 = [3 3 3];
the command
A = diag(x1,-1) + diag(u) + diag(x2,1)
generates the following tridiagonal matrix
⎡ ⎤
2 3 0 0
⎢1 2 3 0⎥
A=⎢
⎣0
⎥.
1 2 3⎦
0 0 1 2

Large tridiagonal matrices require a large amount of memory. The A =


spdiags(B,d,m,n) command helps to save memory. This command generates
an m-by-n matrix and places the columns of B along the diagonals specified
by d. For example, if B was created with the B = [-ones(5,1) (1:5)’
ones(5,1)] command, then the A = spdiags(B, -1:1, 5, 5) command produces
the following tridiagonal matrix
⎡ ⎤
1 1 0 0 0
⎢−1 2 1 0 0⎥
⎢ ⎥
A=⎢
⎢ 0 −1 3 1 0⎥
⎥.
⎣0 0 −1 4 1⎦
0 0 0 −1 5
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 7

Function Files 7

The sparse matrix A is displayed by Matlab as follows


(1, 1) 1
(2, 1) −1
(1, 2) 1
(2, 2) 2
(3, 2) −1
(2, 3) 1
(3, 3) 3.
(4, 3) −1
(3, 4) 1
(4, 4) 4
(5, 4) −1
(4, 5) 1
(5, 5) 5
Only the nonzero elements are shown a column at a time. The C = full(A)
command displays A in its usual form.
Try to recreate the matrix A by replacing its size, 5, with 100. Inspect
A with the whos A command. Note that 3,980 bytes were used to store A.
Next, use the C = full(A) command to save the full form of A in C. While
typing the whos C command, note that 80,000 bytes were used to store C.
The spy(A) command generates a picture of the matrix A. Using the spdiags
command requires attention. See Exercises 1.4.6 and 1.4.7.
The A = repmat(B,m,n) command replicates the p-by-q matrix B as
specified by m and n, and generates the mp-by-nq matrix A. For example,
the command
A = repmat(eye(2),2,3)
generates
⎡ ⎤
1 0 1 0 1 0
⎢0 1 0 1 0 1⎥
A=⎢
⎣1
⎥.
0 1 0 1 0⎦
0 1 0 1 0 1
If B is a scalar, say B = 5, the commands
A = repmat(B,2,3)
u = repmat(B,1,3)
v = repmat(B,2,1)
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 8

8 Matlab for Engineering

produce

   
5 5 5 5
A= ,u = 5 5 5 , v = ,
5 5 5 5

respectively. Exercise 1.4.8 is useful.

1.1.5 Matrix Operations


Matlab performs all the algebraic operations on matrices. If A and B are
m-by-n matrices, the addition and subtraction are produced with the A +
B and A − B commands. Moreover, a matrix A can be added to a scalar a
with the Matlab command B = A + a. This operation generates the matrix
Bij = Aij +a. If A and B are m-by-n and n-by-p matrices, respectively, then
the matrix product is generated with the A * B command. For example,
after creating the matrices
A = [1 2 3; 4 5 6]; B = [7 8; 9 0; -1 -2];
the commands
A*B
B’ * A’
generate the following matrices

   
22 2 22 67
, .
67 20 2 20

Of course, it results in

(A ∗ B) = B  ∗ A ,

as it is known. If u is a row vector and v is a column vector, the


u * v command yields the scalar product. For example, after creating the
vectors
u = [1 2 −3]; v = [4; 5; 6];
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 9

Function Files 9

the command
u*v
produces −4. A matrix A can be multiplied with a scalar a with the B =
A * a command. This operation produces the matrix Bij = Aij a = aAij .
Therefore, it is A * a = a * A. Moreover, in Matlab, an original element-by-
element product between two same size matrices can be generated. The C =
A.*B command creates the matrix C given by Cij = Aij Bij . For example,
if A and B are the matrices defined beforehand, then the commands
A’.*B
A.*B’
produce the following matrices

⎡ ⎤
7 32  
⎣ 18 7 18 −3
0 ⎦, .
32 0 −12
−3 −12

The A.*B command generates an error. The element-by-element product


between a scalar a and a matrix A is meaningful. It is indicated with a.*A
and the result is the same as a*A. The element-by-element product is very
useful in some situations. See Exercise 1.4.9.

1.1.6 Right and Left Divisions


The A/B command is named right division. The command returns the
product of A times the inverse of B. It is the same as A*B^-1, but faster,
since a specific program was devoted to this command by Matlab, whereas
the A*B^-1 command uses the general program for A*B^-n. For example,
after creating the matrices
A = [1 2; 3 4]; B = [5 6; 7 8];
the command
A/B
generates the following matrix

 
3.0000 −2.0000
.
2.0000 −1.0000
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 10

10 Matlab for Engineering

Of course, the command works with scalar variables. For example, if


a = 4; b = 2;
the command
a/b
returns 2.
The A\B command is named left division. It returns the product of the
inverse of A times B. It is the same as A^-1*B, but faster. For example, if
A and B are the matrices defined beforehand, then the command
A\B
generates the following matrix
 
−3.0000 −4.0000
.
4.0000 5.0000

The command works with scalar variables too. For example, if a and b are
the variables defined beforehand, then the command
a\b
returns 0.5000. The left division is used to solve the algebraic linear systems
Ax = b. The unknown vector x is found by the simple A\b command. See
Exercise 1.4.10. Moreover, Matlab allows element-by-element left and right
divisions: A./B and A.\B. See Exercise 1.4.11.

1.2 Script Files


A script file is a file containing a set of Matlab commands. To execute
this type of file, it is equivalent to writing and executing the commands in
sequence at the Command Window. A new script file is created by the New
Script button and can be saved into any directory. To execute a script file,
press the Run button or type its name at the command line. Examples of
script files will be illustrated in Sec. 1.2.2, after introducing the for loop in
Sec. 1.2.1.

1.2.1 For Loop


This section presents a first flow control structure provided by Matla: the for
loop. Other structures, e.g., the while loop, will be introduced in Sec. 1.3.3.
The syntax of the for loop is outlined below.
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 11

Function Files 11

For loop
for variable = expression
code lines
end

For example, in the loop


for j = 1:9
j
end
the variable j goes from 1 to 9 with step 1: 1, 2, 3, . . . , 9. In addition, in the
loop
for i=2:-.2:1
i
end
the variable i goes from 2 to 1 with step −0.2: 2, 1.8, 1.6, . . . , 1.

1.2.2 Examples of Script Files

Example 1.2.1 The following script file plots the function

u(x, t) = sin x cos t, 0 ≤ x ≤ π, 0 ≤ t ≤ 10, (1.2.1)

at several times. The function u describes the small oscillations of a thin


bar with fixed ends (Fig. 1.2.1). For future applications, let us note that

t=5
1
sin x cos t
0.8
0.6
0.4
0.2
u 0
-0.2
-0.4
-0.6
-0.8
-1
0 0.5 1 1.5 x 2 2.5 3

Figure 1.2.1. u = sin x cos t.


September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 12

12 Matlab for Engineering

the function u satisfies the partial differential equation

∂ 2u ∂ 2 u
− 2 = 0, (1.2.2)
∂t2 ∂x
and verifies the initial-boundary conditions

u(x, 0) = sin x, ut (x, 0) = 0, u(0, t) = u(π, t) = 0. (1.2.3)

See Exercise 1.4.12.

% This is the script file script 1.m. %......[1]


% It plots the function u = sinxcost and prints the matrix u(i,j).
clc; %......[2]
nx = 10; %......[3]
x = linspace(0, pi, nx+1); %......[4]
time = 10; nt = 60; t = linspace(0, time, nt+1);
u = zeros(nx+1, nt+1); %......[5]
for j = 1:nt+1
u(:,j) = sin(x’)*cos(t(j)); %......[6]
plot(x,u(:,j),’r’); %......[7]
axis([0 pi -1 1]); %......[8]
xlabel(’x’); ylabel(’u’); %......[9]
legend(’sin x cos t’,1); %....[10]
title([’t = ’, num2str(t(j))]); %....[11]
pause(.1); %....[12]
end
disp(u’); %....[13]
—————— Notes ——————————–

[1] Any word following the % sign is a note, a comment, and is ignored
by Matlab.
[2] The clc command cleans the Command Window. Information on a
command is obtained by writing help name of command. The reader
is invited to take a look at See also where further commands are
suggested.
[3] Note the final semi-colon. The value of this variable is saved, but not
printed in the Command Window.
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 13

Function Files 13

[4] The x = linspace(x1, x2, n) command creates a row vector of n elements


equally spaced from x1 to x2 with step (x2 − x1)/(n − 1). Therefore,
x = linspace(0, pi, nx+1) generates a vector of nx + 1 elements with
step dx = π/nx, i.e., the vector x = [0 dx 2 ∗ dx...π].
[5] The matrix u is initialized. Initializing a matrix is not requested by
Matlab, but is strongly recommended. Indeed, matrix initialization
allows Matlab to allocate the matrix entries in contiguous areas of
memory, which results in the script running faster.
[6] u(:,j) indicates the j-th column of the matrix u. Since x is a row vector,
the transpose sign ’ converts it to a column vector.
[7] The plot command plots (in red) the function (of x) u(x, t(j)) at any
time t(j).
[8] The axis([x1 x2 y1 y2]) command sets the axis limits. If this command
is not introduced, Matlab sets the axis limits automatically. A partial
axis control is also possible. For example, the axis([-inf x2 y1 inf])
command sets the maximum limit for the x-axis and the minimum
limit for the y-axis.
[9] The xlabel and ylabel commands are optional. The previous commands
place the labels beside the corresponding axes. Since the labels are text
strings, they must be introduced between two ’ signs.
[10] The legend command creates the legend. The user can specify its
position. For example, the legend(’sin x cos t’,’Location’,’northeast’)
command creates the legend in the upper right corner and the
legend(’sin x cos t’,’Location’,’best’) command creates the legend in
the best position.
[11] The title command adds text at the top of the graph. In Fig. 1.2.1, it
is used to show the time corresponding to the current position of the
bar. The text is composed of two strings. The first, t =, is statical.
The second, related to the current time, is dynamic and changes every
time a new plot is made. The num2str(t(j)) command converts the real
number t(j) to a text string.
[12] The pause(s) command, where s is a real number, stops the execution
for s seconds.
[13] The disp command displays the matrix u . The transpose matrix is
more interesting than u, since its first row is composed by the values
corresponding to the initial condition of the bar, the second row
contains the values related to the second time, and the last row shows
the last values.
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 14

14 Matlab for Engineering

1
0.8
0.6
u
0.4
0.2
0
0.4
t 0.3 0.8 1
0.2 0.6 x
0.1 0.4
0.2
0 0

Figure 1.2.2. 3D plot of the function u = sin(πx) exp(−π 2 t).

Example 1.2.2 The following script file produces 2D and 3D plots of the
function (Fig. 1.2.2),

u = sin(πx) exp(−π 2 t), 0 ≤ x ≤ 1, t ≤ 0.4. (1.2.4)

The function u describes the temperature evolution in a solid where one


dimension is prevailing over the others. For future applications, note that
u satisfies the partial differential equation
∂ 2u ∂ 2 u
− 2 = 0, (1.2.5)
∂t ∂x
and verifies the initial-boundary conditions

u(x, 0) = sin(πx), u(0, t) = u(1, t) = 0. (1.2.6)

See Exercise 1.4.13.

% This is the script file script 2.m.


% It produces 2D and 3D plots of the function u = sin(πx) exp(−π 2 t).
clc;

% Initialization
L = 1; nx = 20; x = linspace(0, L, nx+1);
time = .4; nt = 40; t = linspace(0, time, nt+1);
u = zeros(nx+1, nt+1);
% 2D Plot
for j = 1:nt+1
u(:,j)= sin(pi*x’)*exp(-pi^2*t(j));
plot(x,u(:,j));
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 15

Function Files 15

axis([0 L 0 1]);
xlabel(’x’); ylabel(’u’);
legend(’sin(pi x) *exp(-pi^2 t)’);
title([’t = ’, num2str(t(j))]);
pause(.1);
end
% 3D Plot
pause;
% The pause command stops the execution. Press any key to continue.
figure(2);
surf(x,t,u’)
xlabel(’x’); ylabel(’t’); zlabel(’u’);
% Print
disp(u’);

1.3 Introduction to Function Files


1.3.1 Structure of Function Files
The function file is an m-file that starts with a line of function definition,
where the function name, the input variables passed to the function, and
the output variables returned by the function are specified. The first line
is followed by comment lines and code lines that form the function body.
The last code line is the statement end that ends the function. The syntax
is outlined below.

Function
function [output] = name of function (input)
% comments
code lines
end

Example 1.3.1 As the first example, consider the following simple


function.

function y = sqr(x) %......[1]


% This is the function file sqr.m %......[2]
% The sqr function returns x squared. If x is a matrix, %......[3]
% sqr(x) returns the element-by-element product of matrices. %......[4]
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 16

16 Matlab for Engineering

y = x.*x; %......[5]
end
————————– Notes ——————————–

[1] The square brackets are optional when the output consists of one
variable, as in this example, or when there is no output variable.
The square brackets are necessary for a multiple output variable. The
function can be called with a different variable name and the result can
be assigned to variables that have different names. In addition, the file
name where the function is saved must be the same as the function
name.
[2] First line of comment. The comment lines are printed when the user
types “help sqr” at the command line. See Exercise 1.4.14.
[3] Second line of comment.
[4] Third line of comment.
[5] Function body. All variables used here, as well as in the function
definition, are local and private. See Remark 1.3.1.

The simplest way to call the sqr function is without any output. For
example, the sqr(2) and sqr([1 2]) commands return

4 and 1 4,

respectively. The sqr(1,2) command generates an error since the sqr function
must be called with one input variable. If the function output has to be used,
then the complete syntax must be considered. For example, the command
z = sqr(2);
assigns the value 4 to the variable z that can be used in other statements.

Remark 1.3.1 Initialize the variable a = 1 in the Command Window.


Check that a was saved. Consider the sqr function and add two new code
lines
a = 0;
b = 10;
just before end. Matlab outlines the warning that the values of the last
variables might be unused. Do not care about that. The new variables
will be deleted very soon. Click on the — sign to the left of b = 10;. A
small gray disk appears that changes to red after saving the sqr.m file.
Execute the function by using, for example, the sqr(9) command. Note that
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 17

Function Files 17

the function execution will stop at the code line b = 10;, where there is
the disk. The Prompt changes to K>> since we are in the Debug phase.
Inspect the variable a by typing a followed by Enter. You may see a = 0.
Continue the function execution by pressing the Continue button. You will
obtain the result ans = 81. Now, inspect the variable a again and note that
a = 1. All this emphasizes the local and private character of the variables
defined in the function body. Before executing the function, the value of
a was 1. During the execution, it was a = 0. After the execution, it was
a = 1. The variables defined in the function body cannot interfere with the
variables defined in the external world and vice versa. Moreover, we also
learned how to inspect some variables during the Debug phase. Finally,
delete the new variables added in the function.

1.3.2 Function with a Multiple Output Variable

Example 1.3.2 The following listing presents an example of a function


with a multiple output variable. The heat flux function returns the heat
flux vector q in a thin solid, according to Fourier’s law

q(x, t) = −k∇u(x, t), (1.3.1)

where k is the thermal conductivity of the material, u is the temperature


and ∇u is its space gradient. See Sec. 2.2.1 for details.

function [qx, qy] = heat flux(u,dx,dy,k)


% This is the function file heat flux.m.
% The heat flux in a thin solid is computed according to Fourier’s law. The
% input variable u is the matrix with the temperature values. The input
% variables dx and dy are the spaces among the points along the x- and y-
% direction, respectively. The thermal conductivity k is a positive real
% number, for example, 62.3 (iron), 387.6 (copper), 418.7 (silver), 0.173
% (rubber), 1.177(glass), 2.215 (ice).

[ux, uy] = gradient(u,dx,dy);


% The gradient(u,dx,dy) function returns the numerical values of the two
% components of the gradient vector by using dx and dy.
qx = -k*ux; qy = -k*uy;
end
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 18

18 Matlab for Engineering

0.4

0.3

0.2

0.1
y
0

-0.1

-0.2

-0.3
0 0.2 0.4 x 0.6 0.8 1

Figure 1.3.1. Heat flux.

Example 1.3.3 A way to call the heat flux function is illustrated in the
following listing. The heat flux vector is plotted (Fig. 1.3.1) and printed.

% This is the script file heat flux ex.m.

k = 62.3; Lx = 1; nx = 20; Ly = .1; ny = 6;


x = linspace(0,Lx,nx+1); dx = Lx/nx;
y = linspace(0,Ly,ny+1); dy = Ly/ny;
u = zeros(ny+1,nx+1);
for j=1:ny+1,
u(j,:)=x.^2;
end
[qx, qy] = heat flux(u,dx,dy,k);
quiver(x(2:end-1),y(2:end-1),qx(2:end-1,2:end-1),qy(2:end-1,2:end-1));
% The quiver function plots vectors as arrows with components X and
% Y at the points with coordinates x and y. See Exercise 1.4.15.
rectangle(’position’,[0,0,Lx,Ly]);
% Rectangle with bottom left corner in (0,0), base Lx, and height Ly.
axis(’equal’); % Same scale for both axes.
xlabel(’x’); ylabel(’y’);
disp(qx);

Remark 1.3.2 The coefficient k is a strictly positive real number. If, by


mistake, a negative k is passed to the heat flux function, then the function
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 19

Function Files 19

output would be wrong. Therefore, data analysis and flow control of the
code are indispensable. This topic is discussed in the next section. In the
same section, we will provide a modified version of the heat flux function
that is capable of eliminating the problem outlined above.

1.3.3 Flow Control Structures


This section presents the flow control structures if, switch and while. The
general syntax of the if-elseif-else structure is provided below.

If-elseif-else
if logical condition
code lines
elseif logical condition
code lines
else
code lines
end

Special cases include the following: if, if-else, and if-elseif, see below. In
addition, all cases can be nested.

If-elseif-else: special cases


if logical condition if logical condition if logical condition
code lines code lines code lines
end else elseif logical condition
code lines code lines
end end

As the first application, the heat flux function is suitably modified and
the problem outlined in Remark 1.3.2 is eliminated.

function [qx, qy] = heat flux(u,dx,dy,k)


% comment lines
if k > 0 % If the coefficient k is positive, the function is executed.
[ux, uy] = gradient(u,dx,dy); qx = -k*ux; qy = -k*uy;
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 20

20 Matlab for Engineering

else % Otherwise, a message is sent to the user.


disp(’k must be a positive real number.’)
end

Example 1.3.4 When the function has no output, the function definition
can be simplified, as in the following listing.

function if 1(i)
% This is the function file if 1.m. It is an application on if-elseif-else.
% Note the simplified function definition. It could also be written:
% function [ ] = if 1(i). Call the function by passing 0 or 1 as an argument.

x1 = -pi; x2 = pi; nx = 20; x = linspace(x1,x2,nx+1)


if i == 0 % The = = sign is a relational operator. It should not be confused
% with the = sign that is an assignment operator. The code x = y
% assigns the value of y to x. Instead, the code x == y compares
% the values of the variables that retain their values.
% The Matlab relational operators are provided at the end
% of the listing.
plot(x,sin(x));
elseif i == 1
plot(x,cos(x));
else
disp(’Please call the function by passing 0 or 1 as argument.’)
% This message is sent if the function was called with an
% argument different from 0 or 1. Beside disp, errordlg(’...’)
% can be used too. In this case, the message is shown in a frame.
% In both cases, the function is executed. A stronger command
% is error(’...’) that stops the function execution.
end
end

Relational operators
== equal to
˜= not equal to
< less than
<= less than or equal to
> greater than
>= greater than or equal to
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 21

Function Files 21

Another example is provided in Exercise 1.4.16.

Example 1.3.5 The following listing considers a function with a multiple


output variable.

function [max, min] = maxmin vector(b)


% This is the function file maxmin vector.m.
% The function returns the maximum and minimum elements of a vector.
% For example, if b = [1 2 43 56 1 3], the command
% [M m] = maxmin vector(b)
% produces
% M = 56
% m=1

min = b(1); max = b(1);


for i=2:length(b)
% The length(u) command, where u is a vector, returns the number of
% elements in u.
if b(i) < min
min = b(i);
end
if b(i) > max
max = b(i);
end
end
end

Remark 1.3.3 The maxmin vector function requires a vector as an input.


Since the input is not checked, the function is executed even when a matrix
is passed. As a result, the function will return a wrong result. For example,
the commands
b = [3 2; 3 4]; [M m] = maxmin vettore(b)
produce the following wrong result
M=3
m=3
To avoid such undesirable situations, the function will be modified in
Example 1.3.10, Sec. 1.3.5, after introducing a number of logical functions.
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 22

22 Matlab for Engineering

If the code flow has a choice of many possibilities, using if may make
the program slower. Matlab provides a more efficient command for these
situations: the switch structure. Its syntax is outlined below.

Switch
switch expression
case value 1
code group 1
case value 2
code group 2
...
case value n
code group n
otherwise
last code group
end

The role of expression can be played by a number as well as a text


string, see Examples 1.3.6 and 1.3.7. Code group i is executed when value i
matches expression. The last code group is executed when no code group
was executed. This code group is optional, but strongly recommended.
Example 1.3.6 The following listing presents a function that returns the
graph of sin x in the color specified by the input variable. For example,
calling switch 1(’red’) returns the graph of sin x in red. If the passed color
is unavailable, a blue color is used and a message is sent about the change.

function switch 1(color name)


% This is the function file switch 1.m.
% It is an application on the switch structure.
x1 = -pi; x2 = pi; nx = 20; x = linspace(x1,x2,nx+1);
switch color name
case ’green’
c = ’g’;
case ’red’
c = ’r’;
case ’yellow’
c = ’y’;
case ’black’
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 23

Function Files 23

c = ’k’;
case ’blue’
c = ’b’;
otherwise
c = ’b’;
str = upper(color name);
% The upper function converts color name passed by the user
% to capital letters.
disp(strcat(str,’ color unavailable. Replaced with blue.’));
% The strcat function concatenates the dynamic string str and the
% static string ’color ... blue’. The disp function shows the
% complete message to the user.
end
plot(x,sin(x),c);
end

Example 1.3.7 Another example on switch is the following function where


the input argument is a number.
function switch 2(i)
% This is the function file switch 2.m.
% For example, use switch 2(3) to call the function.
x1 = -pi; x2 = pi; nx = 20; x = linspace(x1,x2,nx+1);
switch i
case 1
c = ’g’;
case 2
c = ’r’;
case 3
c = ’c’;
case 4
c = ’y’;
case 5
c = ’k’;
case 6
c = ’b’;
otherwise
c = ’b’; disp(’ Unavailable. Replaced with blue.’)
end
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 24

24 Matlab for Engineering

plot(x,sin(x),c);
end

Matlab provides two commands for loops: for and while. The for loop
was introduced in Sec. 1.2.1. Now, the while loop is presented. Its syntax is
outlined below.

While loop
while condition
code lines
end

First, condition is evaluated. If it is true, the code lines are executed and
condition is evaluated again. The process is repeated infinitely until condition
becomes false. If condition is initially false, code lines are never executed.
Applications on a while loop are provided in Examples 1.3.8 and 1.3.9, and
Exercises 1.4.17 and 1.4.18.

Example 1.3.8 Consider the following listing.

% This is the script file while 1.m. It is an application on while loop.

i = 0; a = 10;
while i < a
i = i + 1;
disp(i);
end
Executing the file yields
1
2
...
10.
The break command forces the program to exit from the while loop, even
if condition is true. For example, insert the following code just before end
and guess what happens. However, using a break is not recommended.
if i == 6
break;
end
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 25

Function Files 25

Example 1.3.9 Another example is illustrated in the following listing.


function y = while 2(str)
% This is the function file while 2.m.
% The function returns the number of spaces in the input string.
% For example, the command
% spaces = while 2(’I am from Naples’)
% produces
% spaces = 3.

y = 0; i = 1;
c = isspace(str); %......[1]
while i<= length(c)
if c(i)>0
y = y + 1;
end
i = i + 1;
end
end

—————– Notes —————————–


[1] The c = isspace(str) command, where str is a text string, returns a row
vector the same size as str containing ones and zeros, where 1 corresponds
to a space character and 0 to any other character. For example, if
str = ’I am from Naples’,
then
c = [0 1 0 0 1 0 0 0 0 1 0 0 0 0 0 0].

1.3.4 Local Functions, Anonymous Functions


Local functions are functions defined within a function file. They are visible
only to the main function and other local functions. Therefore, they cannot
be called by other functions. All variables defined in local functions are
private. The local functions are known as subfunctions too. A simple
example is illustrated in the following listing.
function y = local function(str)
% This is the function file local function.m.
% It is an application on local functions. The function returns the numbers of
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 26

26 Matlab for Engineering

% characters in the input string different from spaces. For example, the
% command
% ns = local function(’I am from Naples’)
% produces
% ns = 13.

c = isspace(str);
s = GetSpaces(c);
y = length(c) - s;
end
———- Local function ——————–
% The local function GetSpaces returns the number of spaces.
function s = GetSpaces(c)
s = 0;
for i=1:length(c)
if c(i) > 0
s = s + 1;
end
end
end
The anonymous functions are a powerful tool provided by Matlab to
define simple functions. The syntax is outlined below.

Anonymous function
function name = @(arg1, arg2,...) function expression

As noted, the function name is followed from the = sign, the @ sign
that characterizes the anonymous functions, and the input variables in
parentheses. Next, after some spaces, the function expression. A simple
example of an anonymous function is the following
f = @(x) x + 2;
that defines the function f (x) = x + 2, where x can be an array. After
defining f , the command
feval(f,3)
evaluates f for x = 3 and produces
5.
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 27

Function Files 27

Equivalently, the command f(3) can be used. In addition, the command


fplot(f,[0 1])
returns the graph of f (x) = x + 2 on the interval (0, 1). A further example
is suggested in Exercise 1.4.20 after introducing the logical functions in
Sec. 1.3.5. An anonymous function has an important limitation: it must be
defined in one line. However, it can be used in many situations.

1.3.5 Logical Operators and Logical Functions


Matlab provides three logical operators that are outlined below.

Logical operators
& Logical AND
| Logical OR
˜ Logical NOT

The first two operators work with at least two operands. The third operator
needs one operand. In logical expressions related to scalar variables, the
following symbols must be used: && and ||, instead of & and |.
Logical AND evaluates the truth or falseness of the operands and
returns true if all operands are true; otherwise it returns false. For example,
the expression
a > 0 && b > 0 && c > 0
returns 1 (true) if a, b and c are strictly positive scalar variables and 0
(false) if at least one is less than or equal to zero. For example, if a, b and
c were initialized as
a = 1; b = -1; c = pi;
then the expressions
a > 0 && b > 0
c > 0 && b > 0
a > 0 && b > 0 && c > 0
return
0
and the expression
a > 0 && c > 0
returns
1.
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 28

28 Matlab for Engineering

Note that in Matlab, false is expressed by “0” and true is expressed by “1”
or, more generally, any nonzero value. Therefore, the expression
a && b && c
returns
1.
The expression
a-b>0
returns
1
since it is true and the expression
a-c>0
returns
0
since it is false. See Exercises 1.4.1 to 1.4.21. If the operands are vectors
of the same length, each element of a vector is evaluated with the
corresponding elements of the other vectors and a same length vector of
zeros and ones is returned. For example, after creating the vectors
u = [0 1 3]; v = [-1 0 1]; z = [-3 -1 0];
the expression
u&v&z
returns
0 0 0.
If a is a scalar, for example,
a = 1;
then the expression
a&u
returns
0 1 1
since Matlab evaluates the scalar with each element of u. If the operands are
matrices of the same size, a same size matrix of zeros and ones is returned.
For example, after creating the matrices
A = [0 1 3; 4 5 6]; B = [-1 0 1; -3 -2 0];
the expression
A&B
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 29

Function Files 29

returns
0 0 1
1 1 0
The logical operator & is frequently used in if-else and while structures. For
example,
if a >= 0 && b < 0
code lines
end

The logical operator | evaluates the operand truth or falseness and


returns false if all operands are false; if at least one operand is true, it
returns true. For example, the expression
a > 0 || b > 0 || c > 0
returns “1” if at least one variable assumes a positive value and “0” if all
scalars are less than or equal to zero. If the operands are matrices of the
same size, then each element of a matrix is evaluated with the corresponding
elements of the other matrices and a same size matrix of zeros and ones
is produced. In addition, the expression a | A, where a is a scalar and A
is a matrix, is a compatible statement. In this case, any element of A is
evaluated with a. The OR operator | is often used in flow control code. See
Exercise 1.4.22.

Example 1.3.10 As noted in Remark 1.3.3, the maxmin vector function


should be modified. The corrected version is shown below.

function [max, min] = maxmin vector(b)


...
if size(b,1) == 1 || size(b,2) == 1
% The size(A) command, where A is a matrix, returns a vector of two
% elements that specify the number of rows and columns in A, respectively.
Place the old code here.
else
error(’The input variable must be a vector.’);
end
end

Logical NOT ~ operator works with one operand. It evaluates the


operand’s truth or falseness and returns “false” if the operand is “true”
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 30

30 Matlab for Engineering

and “true” if the operand is “false”. For example, after creating the
vector v
v = [-1 0 1];
the expression
~v
returns
0 1 0.

Matlab provides logical functions too. Some of them — all, any, find
and ismember — will be presented in this section. If u is a vector, the logical
function
all(u)
returns “1” if all the elements of u are different from zero, otherwise it
returns “0”. For example, after creating the vectors
u = [0 1 2]; v = [1 2 3];
the command
all(u)
returns
0
and the command
all(v)
returns
1.
If A is a matrix, the command
all(A)
evaluates the column vectors of A and returns a row vector of zeros and
ones with a length equal to the number of columns of A. For example, after
creating the matrix
A = [0 1 2; 1 2 3];
calling
all(A)
returns
0 1 1.
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 31

Function Files 31

The function can also be called with an optional argument: all(A,n). In this
case, the function evaluates according to the dimension specified by n. For
example, the command
all(A,1)
evaluates according to the first dimension (row) and considers the columns
as vectors. The result is the same as all(A). The command
all(A,2)
evaluates according to the second dimension (column) and considers the
rows as vectors. It returns
0
1.

The logical function


any(u)
returns “1” if at least one element of vector u is different from zero,
otherwise it returns “0”. For example, after creating the vector
u = [0 1 2];
the any(u) command returns “1”. If a matrix A is passed as an argument,
any(A) works exactly the same as all, including the possibility of the optional
argument: any(A,n).

If v is a vector and p is a real number, the logical function


find(v > p)
finds the elements of v greater than p and returns their indices. For example,
the command
find(-2:3 > 1)
returns
5 6
that are the indices of the two elements, 2 and 3, greater than 1. If A is a
matrix, the function
[ri ci] = find(A == p).
finds the elements of A equal to p and returns the two vectors ri and ci
containing the row and column indices of the element of A equal to p. For
example, after creating the matrix
A = [0 3; -4 0];
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 32

32 Matlab for Engineering

the command
[ri ci] = find(A == 0)
produces
ri =
1
2
ci =
1
2
since A(1,1) = 0 and A(2,2) = 0. The command
[ri ci] = find(A)
returns the indices of the nonzero elements of A. In addition, the command
[ri ci vs] = find(A)
also returns the vector vs containing the values of nonzero elements of A. For
example, if A is the matrix created beforehand, then the previous command
returns
ri =
2
1
ci =
1
2
vs =
-4
3.

If A and B are matrices, the logical function


ismember(A,B)
evaluates if an element of A belongs to B and returns “1” in the positive
case, otherwise “0”. Therefore, a matrix with the same size as A is generated
containing zeros and ones. For example, if A is the matrix created with the
command
A = [0 3; -4 0];
then the command
ismember(A,0)
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 33

Function Files 33

produces
1 0
0 1
and the command
ismember(A,A)
returns
1 1
1 1.

1.4 Exercises

Exercise 1.4.1 After creating the matrix


A = [1 2 3; 4 5 6; 7 8 9; 1 1 1; 2 2 2];
extract the submatrix formed by the first and third rows.

Answer. A([1 3],:).

Exercise 1.4.2 Extract the submatrix formed by the first, second, third
and fifth rows from the matrix A, created in Exercise 1.4.1.

Hint. Clearly, the A([1 2 3 5],:) command works. However, it is not the most
efficient when we consider a matrix with 4,000 rows and want to extract
the submatrix formed by the first 2,000 rows and the last one. The reader
is asked to find a more efficient command.

Exercise 1.4.3 Delete the first, second, third and fifth rows of matrix A.

Hint. Use a command more efficient than A([1 2 3 5],:)=[ ].

Exercise 1.4.4 Let


   
123 7 8
C= , D= .
456 9 10

The [C’; D] command works to produce the matrix


⎡ ⎤
1 4
⎢2 5 ⎥
⎢ ⎥
⎢3 6 ⎥.
⎢ ⎥
⎣7 8 ⎦
9 10
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 34

34 Matlab for Engineering

What is the result of the [C’; D’] command?

Exercise 1.4.5 Convert the matrix


⎡ ⎤
1 4
B = ⎣2 5⎦
3 6
to a vector, say z.

Exercise 1.4.6 Use the B = [[1; 2; 3] ones(3,1) -[1; 2; 3]] command to


create the matrix
⎡ ⎤
1 1 −1
B = ⎣2 1 −2⎦.
3 1 −3

Then, create the matrix A = spdiags(B, -1:1, 3, 3).

Exercise 1.4.7 Create the matrix A = spdiags(B, -1:1, 3, 3), where B is


the matrix defined by
⎡ ⎤
1 1 0
B = ⎣2 1 −2⎦.
0 1 −3
Compare the matrix A with the one obtained in the previous exercise.

Exercise 1.4.8 Create the matrix A = spdiags(B, [-4 -1:1 4], 9, 9)


by using the matrix B = repmat([ones(3,1) 4*[ones(2,1);0] 2*ones(3,1)
3*[0;ones(2,1)] ones(3,1)], 3, 1). Try to guess the result.

Exercise 1.4.9 Consider the simple function f (x) = x, x ∈ [1, 20].


Suppose that f (x) was discretized with the vector x = [1 2 3 · · · 20]. Write
the Matlab command that discretizes the function f 2 (x) and produces the
vector [1 4 9 · · · 400].

Answer. x.*x, or x.2 .

Exercise 1.4.10 Consider the three-hinged arch in Fig. 1.4.1 (left). Use
the left division to calculate the constraint reactions. Assume: F = 4N , q =
2N/m and L = 4m. Use the free body diagram (or the Lagrangian model),
e.g., D’Acunto and Massarotti (2016), illustrated in Fig. 1.4.1 (right).
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 35

Function Files 35

q qL X3 X3 qL
F F
B X4 X4
L
A C X1 X5
X2 X6

L/2 L/2 L/2 L/2

Figure 1.4.1. Three-hinged arch (left) and free body diagram (right).

Hint.
⎡ ⎤⎡ ⎤ ⎡ ⎤
F + X1 − X3 = 0 1 0 −1 0 0 0 X1 −4
X2 + X4 − qL = 0 ⎢0 1 0 1 0 0⎥ ⎢ ⎥ ⎢ ⎥
⎢ ⎥ ⎢ X2 ⎥ ⎢ 8 ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
qL2 /2 + LX1 − LX2 = 0 ⎢4 −4 0 0 0 0⎥ ⎢ X3 ⎥ ⎢ −32 ⎥
⇔⎢ ⎥⎢ ⎥=⎢ ⎥.
X3 − X5 = 0 ⎢0 0 1 0 −1 0⎥ ⎢ X4 ⎥ ⎢ 0 ⎥
⎢ ⎥⎢ ⎥ ⎢ ⎥
X6 − X4 − qL = 0 ⎣0 0 0 −1 0 1⎦ ⎣ X5 ⎦ ⎣ 8 ⎦
LX6 − LX5 − qL2 /2 = 0 0 0 0 0 −4 4 X6 16

Exercise 1.4.11 Execute the element-by-element right division A./B,


where
   
1 2 1 2
A= , B= .
6 8 3 4

Exercise 1.4.12 Verify that the function u, defined in (1.2.1), satisfies


Eq. (1.2.2) and initial-boundary Conditions (1.2.3).

Exercise 1.4.13 Verify that the function u, defined in (1.2.4), satisfies


Eq. (1.2.5) and initial-boundary Conditions (1.2.6).

Exercise 1.4.14 Type help sqr at the command line and press Enter.

Exercise 1.4.15 Replace end with the specific values.

Hint. Consider the matrix u.

Exercise 1.4.16 Call the following function. The function output is shown
in Fig. 1.4.2.
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 36

36 Matlab for Engineering

1
0.8
0.6
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
-4 -3 -2 -1 0 1 2 3 4

Figure 1.4.2. Function output.

function if 2(i)
% This is the function file if 2.m.
x1 = -pi; x2 = pi; nx = 20; x = linspace(x1,x2,nx+1);
c = ’b’;
if i == 0
c = ’g’;
elseif i == 1
c = ’r’;
end
plot(x,sin(x),c);
end

Exercise 1.4.17 Try to guess the value of y after executing the following
file.

% This is the script file while 3.m. It is an exercise on the while loop.
y = 2;
while y > 2
y = y - 1;
disp(y);
end

Exercise 1.4.18 Replace while with for in the function while 2, see
Example 1.3.9.
September 8, 2021 11:25 Matlab for Engineering 9in x 6in b4335-ch01 page 37

Function Files 37

Exercise 1.4.19 Consider the function u on the interval [0, L]


0 if x ∈ [0, x1 ] ∪ ]x2 , L],
u(x) = (1.4.1)
1 if x ∈]x1 , x2 [.
Write a script file where Function (1.4.1) is defined by using logical
operators. Next, plot the function.

Answer.
% This is the script file logical 1.m. It is an exercise on logical operators.
L = 2; n =101; i1 = 31; i2 = 61;
x = linspace(0,L,n); x1 = x(i1); x2 = x(i2);
u(1:n) = (x(1:n) - x1 > 0).*(x2 - x(1:n) > 0);
plot(x,u);
axis(’equal’);

Exercise 1.4.20 Write a script file where Function (1.4.1) is defined by


using an anonymous function. Next, plot the function.

Exercise 1.4.21 Write a script file where Function (1.4.1) is defined by


using a for loop. Next, plot the function.

Exercise 1.4.22 Consider the following code.

a = 1; L = 2; b = 0; T = 3; n = 10;
if a <= 0 || L <= 0 || T <= 0 || n <= 2
b = 1;
end
disp(b);
What is the value of b after executing the listing?
B1948 Governing Asia

This page intentionally left blank

B1948_1-Aoki.indd 6 9/22/2014 4:24:57 PM


September 8, 2021 14:15 Matlab for Engineering 9in x 6in b4335-ch02 page 39

Chapter 2

The Finite Difference Method

The chapter presents the Finite Difference Method (FDM). This method
dates back to Euler1 who introduced it in Institutiones calculi Differentialis
(1755). The modern researches on the FDM started after the paper by
Courant, et al. (1928), where the method was used to obtain approximated
solutions to Partial Differential Equations (PDEs). In this field, the method
was improved mainly after the Second World War when powerful computers
were available. The books by Collatz (1966); Forsythe and Wasov (1960),
and Richtmyer and Morton (1967) had a great role in stimulating research
on the FDM. Other books by Cooper (1998); Kharab and Guenther
(2002) considered Matlab applications too. Today, the FDM is considered
a consolidated tool that is able to provide reliable solutions of PDEs and is
used by scientists and technicians in many scientific areas, e.g., D’Acunto
(2004); de Vahl Davis (1986). In this chapter, FDM will be applied to
the heat equation by introducing these noteworthy methods: Explicit Euler
Method Implicit Euler Method and Crank–Nicolson Method.
A section is devoted to the equation governing heat propagation and
diffusion.

2.1 Finite Difference Approximations of Derivatives


2.1.1 Forward, Backward and Central Approximations
Let f (x) be a function defined on the interval [0, L]. A finite set of points
xi , i = 0, ..., n, xi ∈ [0, L], forms a grid or mesh. Of special importance
are the grids with a constant step indicated with h or Δx (Fig. 2.1.1). If

1 Leonard Euler, a Swiss scientist, 1707–1783. He formulated the laws of solid and fluid

dynamics. He published Institutiones Calculi Differentialis and introduced the Euler’s


angles for rotating bodies.

39
Random documents with unrelated
content Scribd suggests to you:
of land they the said Archibald, Derrick, Frederick and Lewis Ludenton
and their heirs is to have and to hold forever with all the appertinances
thereunto belonging; but it is my will that Derrick Ludenton my son’s
proportion of the farm to remain in the hands of my executors and for
them to do as they shall judge best for him with it. And I do will and
bequeath Tartulus Ludenton my son Fifteen Dollars to be paid out of
removable property, and after said fifteen dollars is paid and all my
debts that my land is not sold to pay is paid and discharged, to pay
which debts is my will that my executors should sell such and so much
of the movable property they shall judge will least discommode the heirs
which the residue is left to and share who is to have the property, and it
is my will that all movable property should remain in the hands of my
widdow for her use and the use of Derrick Ludenton my son, Abigail my
daughter, to remain as the use of the farm is above discribed to remain
in the hands of my executors for the use and benefit of Abigail Ludenton
my wife and Abigail Ludenton my daughter and Derrick Ludenton my
son and Cornelia Ludenton my grand daughter untill my wife marries or
untill her disceas, unless Abigail, Derrick or Cornelia or one of them
should marry, and the one that marries is to have use and benefit no
longer of said property until disposed of as is hereafter directed. And I
do will and bequeath unto my six daughters at the deceas or marriage
of my widow all my movable property to be equally divided amongst
them, that is to say Sibyl Ogden, Rebecca Pratt, May Ferris, Anna
Colwell, Abigail Ludenton and Sophiah Caverly my daughters.
And for the further surety of this my last will and testament I
nominate and appoint John Hopkins of the town of Fishkill, County of
Dutchess and State of New York, and Elijah Wixon of the town of
Fredericks and County of Putnam and State aforesaid my sole executors
of this my last will and testiment and I do hereby disallow, revoke and
annull all and singular every other former will testament and bequeath
and executors by me in any wise before mentioned willed and bequeath,
ratifying and allowing this and no other to be my last will and testiment.
In witness whereof I have hereunto set my hand and seal this seventh
day of April in the year of Our Lord one thousand eight hundred and
thirteen.
Henry Ludenton. L. S.
Signed sealed and pronounced in presence of us

Stephen Merritt
John Burtch.

An interesting side-light is cast upon one feature of this will, as well as


upon the later years of Colonel Ludington’s life and the years following
his death, by a letter written in April, 1881, to Mr. Patrick by Mrs. Julia L.
Comfort, of Catskill, New York, a daughter of Colonel Ludington’s son,
Tertullus Ludington. Speaking of the old homestead at Frederickstown,
and the members of the family there, Mrs. Comfort said:

I was so young when last there, and consequently do not remember


much about them. It was the winter before Grandma Luddington died.
She gave my Mother Grandfather’s gun and sword, and I think the
powder horn to my brother Henry because he was named after him.
They were all mounted with silver. The first time we were there was in
the fall when chestnuts were ripe. There was a very large tree in the
rear of the house, and Uncle Fred’s children, my sister and myself
wished to get the chestnuts but could not. Grandma wanted Uncle
Derrick to cut the tree down for us, but he said it would take two weeks
to do it, it was so large.
My Father was with us, and Grandfather said to him, (he always called
him Tarty,) “I am going to make a will, and I owe you for five barrels of
pork, but as I have not got the money just now I will remember it in my
will.” (It was in war time (War of 1812) and pork was selling for thirty
dollars a barrel.) Father told him he might give it to Archie, as he was
very poor and Father was doing a good business and did not need it, but
Archie said he never rec’d a cent of it.
The last time Aunt Ogden was here, she was telling us how she and
Aunt Sophia (probably a slip of the pen for Rebecca) were alone in the
house in war time (Revolutionary War). They had had a fence built
around the house, and they each had a gun, and once in a while they
would fire one off to make the soldiers think there were men in the
house.
CHAPTER VIII
SOME LATER GENERATIONS

It has already been observed that the earlier generations of the


Ludington family, in colonial days, were prolific; as, indeed, the
Ludingtons of the Old Country are said to have been. In revolutionary
days, Comfort, Elisha, Stephen, and other collateral relatives of his were
the comrades of Henry Ludington in the war and his neighbors in
Dutchess and the adjoining counties. Their descendants, and the
descendants of those of Colonel Ludington’s twelve children who
married and had issue, have been numerous, and many of them have
made their mark in contemporary affairs in various parts of the land. It
is not the purpose of this work, nor would its compass permit it, to give
any detailed chronicle of all the ramifications of the family. Brief notices
of a few of its members follow. Let us first deal with some of a collateral
line.
Colonel Henry Ludington married, as already noted, his cousin Abigail
Ludington. Her brother, Comfort Ludington, who has been mentioned as
a soldier in the Revolution, had a son named Zalmon, who in turn had a
son also named Zalmon. The last named was a soldier in the War of
1812; in 1818 he went to Virginia, and four years later married Lovina
Hagan, of Preston County. Three of his children are still living, namely:
Mrs. M. L. Patrick, of Louisville, Kentucky; Dr. Horace Ludington, of
Omaha, Nebraska; and General Marshall I. Ludington, U. S. A. Another,
Colonel Elisha H. Ludington, U. S. A., died in 1891. Zalmon Ludington
himself lived to be more than ninety years of age, and at the age of
eighty-eight was able to make an important public address in the city of
Philadelphia.
One of the sons of Zalmon Ludington, Elisha H. Ludington, entered
the United States Army as a captain in 1861, did important field service
with the Army of the Potomac in 1863, being engaged in the battles of
Chancellorsville and Gettysburg, and for “gallant and meritorious
service” in the latter conflict was brevetted a major on July 2, 1863. On
March 13, 1865, he was brevetted lieutenant-colonel “for meritorious
services during the war,” and also colonel on the same date “for faithful
and meritorious services in his department.” He served at Washington
and elsewhere as assistant inspector-general until his retirement for
disability on March 27, 1879, and died on January 21, 1891.

FREDERICK LUDINGTON,
Son of Col. Henry Ludington.

Marshall I. Ludington was born in Somerset County, Pennsylvania, on


July 4, 1839, and entered the army as captain of volunteers and acting
quartermaster-general on October 20, 1862. Like his brother he served
in the Chancellorsville and Gettysburg campaigns, in the Wilderness, and
at Petersburg, and then became chief quartermaster at Washington. In
January, 1867, he became major and quartermaster in the regular army,
and served in various places and was successively promoted until in
1898 he was made brigadier-general and quartermaster-general of the
United States Army, with headquarters at Washington. For several years
he had been acting quartermaster-general, but had not enjoyed full
authority to organize the department according to his own ideas.
Consequently, when he became quartermaster-general, only four days
before the declaration of war with Spain, he was confronted with a task
of peculiar difficulty, for which he had not been able to make satisfactory
preparations such as had been made in other branches of the service.
Before he retired from the office, however, he had so perfected the
organization and equipment as to make the department a model which
military experts from Europe were glad to study. He served until July 4,
1903, when he was retired under the law for age, with the rank of
major-general, U. S. A. Since his retirement he has lived at Skaneateles,
N. Y.
Mention has been made of Frederick Ludington, son of Colonel Henry
Ludington, who with his brother Lewis engaged for a time in general
merchandising at Frederickstown, or Kent, N. Y. He married Susannah
Griffith, and among their children was a son to whom they gave the
name of Harrison, in honor of the general who was just then winning
distinction in the United States Army and who afterward became
President. Harrison Ludington was born at Kent, New York, on July 31,
1812, and served for a time as a clerk in his father’s and uncle’s store.
In 1838 he removed to Milwaukee, Wisconsin, in company with his
uncle, Lewis Ludington, and there engaged in general merchandising, in
partnership with his uncle Lewis and later with his younger brother,
Nelson. They also had extensive interests in the lumber trade.
Withdrawing from their firm, he formed a partnership with Messrs. D.
Wells and A. G. Van Schaick, in the same business, with extensive
lumber mills on Green Bay. He was for many years conspicuously
identified with the development of the city of Milwaukee, and as the
proprietor of a “general store” is said to have purchased the first bag of
wheat ever brought to market at that place. He served for two terms as
an alderman of Milwaukee, and in 1872-75 was mayor of that city. His
admirable administration of municipal affairs fixed the attention of the
whole State upon him, and as a result he was elected governor for the
two years 1876 and 1877. He filled that office with distinguished
success, but at the end of his single term retired from public life and
resumed his manufacturing pursuits, in which he continued until his
death, which occurred at Milwaukee on June 17, 1891.

HON. HARRISON LUDINGTON,


Governor of Wisconsin, 1876-1878.
Grandson of Col. Henry Ludington.
George Ludington, second son of Frederick Ludington, and grandson
of Colonel Henry Ludington, was born in Putnam County and spent his
life there. He married Emeline C. Travis. For some years he occupied and
conducted the store which had formerly been managed by his father
and uncle, as already related, and afterward became cashier of the Bank
of Kent, later known as the Putnam County National Bank, a place which
he filled until his death.
A great-grandson of Colonel Henry Ludington, through his son
Frederick and the latter’s daughter Caroline, is Lewis S. Patrick, formerly
in government service at Washington but now and for many years living
at Marinette, Wisconsin. To his painstaking and untiring labors must be
credited the collection of a large share of the data upon which this
memoir of his ancestor is founded.

Old store at Kent, built by Frederick and Lewis Ludington about 1808

Sibyl Ludington, Colonel Ludington’s oldest daughter, who married


Henry Ogden, a lawyer of Catskill, N. Y., (elsewhere called Edward and
Edmund,) went to live at Unadilla, N. Y., and bore four sons and two
daughters. The distinguished career of one of these sons may well be
told in a quotation from the “New York Observer” of October 18, 1855,
as follows:

Major Edmund A. Ogden, of the United States army, who recently died
of cholera at Fort Riley, Kansas Territory, was born at Catskill, N. Y., Feb.
20th, 1810. Soon after, he removed to Unadilla, N. Y., where he
remained until he entered the United States Military Academy. On
graduating, he was attached as brevet Second Lieutenant to the First
Regiment of Infantry, then stationed at Prairie du Chien. He was
subsequently appointed a First Lieutenant in the Eighth Infantry, where
he served until appointed a Captain in the Quartermaster’s Department,
in which corps he remained until his death. He served with credit and
distinction through the Black Hawk, Florida and Mexican wars, and was
created a Major by brevet, for meritorious conduct in the last named of
these wars.
His services, ever faithfully performed, have been arduous and
responsible. He has disbursed for the government millions of the public
money; he has labored hard, and always to the purpose, and after
giving to his country five and twenty years of hard and useful service, he
has died poor.
For the last six years previous to last spring, Major Ogden was
stationed at Fort Leavenworth, where he has rendered important service
to the army in his capacity of Quartermaster. From this post he was
ordered to California, and he removed with his family to New York with
the expectation of embarking on the 20th of April last, when his orders
were suddenly suspended, and he was sent back to assist in outfitting
the expedition against the Sioux Indians. He was afterwards charged
with the arduous duty of erecting, within three months, barracks,
quarters and stables for a regiment of troops at Fort Riley—a point
about 150 miles west of Leavenworth, and which he had himself
selected as a suitable place for a government post, when stationed at
Fort Leavenworth. This place was not settled, and was an almost perfect
wilderness. He took with him about five hundred mechanics and
laborers, with tools and provisions, and commenced his labors. In a new
and unsettled country, so destitute of resources, many obstacles were
encountered, but just as they were being overcome, and the buildings
were progressing, cholera in its most fatal and frightful form made its
appearance among the men, from two to four of them dying every day.
Far removed from homes and kindred, and accustomed to depend upon
Major Ogden for the supply of their daily wants, they turned to him in
despair for relief from the pestilence. He labored among them night and
day, nursing the sick and offering consolation to the dying. At last the
heavy hand of death was laid upon him, and worn out with care,
watching and untiring labors, he fell a victim to the disease whose
ravages he had in vain attempted to stay.
In the death of this officer the army has lost one who was an
ornament to its list; his own corps has lost one of its most efficient
members—one whom they appreciated, and whom they delighted to
praise. Among his associates in the army there is but one sentiment—
that of regret for his loss and admiration for his professional and private
character, and love for his estimable qualities. His associates in the army
are not the only sufferers; but many and many in various parts of the
land have lost a warm and true friend, and the country has lost an
honest man and a Christian soldier.…
In the hour of death, far from all he most loved on earth, he was
cheered by his Christian hope. His faith was unshaken and enduring,
and proved capable of supporting him in that last sad hour. Although
weak and exhausted, he repeated the Lord’s Prayer audibly, and said to
his friend the chaplain, who was by his side, “Tell my dear wife and
children to try and meet me in heaven,” and then sank sweetly and
quietly to rest.
So died the Christian soldier, in the vigor of manhood, and at the post
of duty. Bound as he was by so many tender ties to this earth, not a
murmur escaped his lips, but he met his summons with a cheerful
resignation to that Providence whose dealings he had recognized
through life, and in whom he trusted in death.…
It is interesting to note the evidences of the estimation in which Major
Ogden was held at Fort Riley by the residents and the men in his
employ. The following is an extract from The Kansas Herald of the 10th:
“The death of Major Ogden left a deep gloom upon the spirits of all
the men, which time does not obliterate. His tender solicitude for the
spiritual and bodily welfare of those under him; his unceasing labors
with the sick, and his forgetfulness of self in attendance upon others,
until he was laid low, have endeared his memory to every one there.
And, as a token of affection, they are now engaged in erecting a fine
monument which shall mark their appreciation of the departed. The
monument, which will be of the native stone of the locality, is to be
placed on one of the high promontories at Fort Riley, and can be seen
from many a distant point by those approaching the place. It will bear
the following inscription:
“Erected to the memory of
BREVET MAJOR E. A. OGDEN,
the founder of Fort Riley;
a disinterested patriot and a generous friend;
a refined gentleman; a devoted husband
and father,
and an exemplary Christian.
Few men were more respected in their lives, or more lamented in
their deaths. As much the victim of duty as of disease, he calmly closed
a life, in the public service, distinguished for integrity and faithfulness.

BREVET MAJOR E. A. OGDEN,


Assistant Quartermaster, United States Army, departed this life, at Fort
Riley, August 3d, 1855, in the forty-fourth year of his age.

‘And I heard a voice saying unto me, write, blessed are the dead
which die in the Lord from henceforth. Yea, saith the spirit, that they
may rest from their labors; and their works do follow them.’”
Home of the late Lewis Ludington, son of Colonel Ludington, at Carmel, N. Y., built in
1855

A younger brother of Major Edmund Ogden was Richard Ludington


Ogden, who became a captain in the United States Army, and was an
extensive and adventurous traveler.
LEWIS LUDINGTON,
Son of Col. Henry Ludington.

(From portrait by Frank B. Carpenter.)

The sixth son and youngest child of Colonel Henry Ludington was
Lewis Ludington, who was born in Fredericksburgh on June 25, 1786. At
the age of twenty he engaged with his elder brother Frederick in
conducting a general store near their home. A few years later he
married Polly Townsend, the daughter and oldest child of Samuel
Townsend and his wife Keturah Crosby. The Townsends had come to
Dutchess County many years before from Long Island, and Polly
Townsend’s great-grandfather, Elihu Townsend, settled on a farm in
South East Precinct, close to the Westchester County line. He died about
1804, at the age of 102 years, and was able to walk about the yard six
weeks before his death. For several years after their marriage Lewis and
Polly Townsend Ludington lived in a cottage near the Ludington
homestead at Fredericksburgh, or Kent, as it was then renamed. Then,
in the spring of 1816, they removed to the village of Carmel, where
soon after Lewis Ludington bought property which is still owned by
members of the family. In the fall of 1855 he completed and occupied
the house which is still the family homestead. The wood of which this
house was built was cut on lands owned by Mr. Ludington in Wisconsin,
was sawed in his mills at Oconto in that State, and was shipped from
Green Bay to Buffalo in the lake schooner Lewis Ludington. This
circumstance suggests the fact that Lewis Ludington was strongly
identified with business interests in Wisconsin. He went West in the fall
of 1838, in company with his nephew, Harrison Ludington, already
mentioned, and Harvey Burchard, of Carmel, N. Y. They visited
Milwaukee, which was then a mere village, and during that winter made
several long trips on horseback through the interior of Wisconsin, for the
purpose of selecting government lands. They purchased extensive
tracts, largely with a view to the lumber trade, and in 1839 they formed
at Milwaukee the general mercantile firm of Ludington, Burchard & Co.,
of which Lewis Ludington was the eldest and Harrison Ludington the
youngest member. A year or two later Burchard retired and the firm
became Ludington & Co., Harrison’s younger brother Nelson being taken
into it. Nelson Ludington, by the way, was afterward president of the
Fifth National Bank of Chicago, and for many years was at the head of
large and successful lumbering and manufacturing interests and was
prominent in commercial life in Chicago. For nearly twenty years Lewis
Ludington was the head of the firm of Ludington & Co., which was one
of the foremost in Milwaukee, and which conducted what was for those
days a business of great magnitude. The firm also had lumber mills at
Oconto and docks at Milwaukee. About 1843, Lewis Ludington bought a
tract of land in Columbia County, Wisconsin, and in July of the following
year laid out thereon the city of Columbus. For many years he personally
directed and encouraged the development of the new community, which
grew to be a city of considerable population and wealth.
Thus for almost a quarter of a century Mr. Ludington conducted a
number of enterprises in Wisconsin, enjoying at all times the respect
and confidence of those who knew him and ranking among the best
representative citizens of the two States with which he was identified.
He was a Whig in politics, and exerted much influence in party councils,
especially opposing the extension of slavery, but would never accept
public office, though frequently urged to do so. He died on September 3,
1857, at Kenosha, Wisconsin, and his remains were interred in the family
lot in Raymond Hill Cemetery, at Carmel, N. Y.
CHARLES HENRY LUDINGTON,
Grandson of Col. Henry Ludington.

The fifth child of Lewis Ludington is Charles Henry Ludington, who


was born at Carmel, N. Y., on February 1, 1825. Among the schools
which he attended in boyhood was one conducted in the former home
of “Peter Parley” at Ridgefield, Conn. In 1842 he became a clerk in a
wholesale dry-goods store in New York, and later was for many years a
member of a leading firm in that same business—the firm of Lathrop,
Ludington & Co., at first on Cortlandt Street, and afterward on Park Row.
A considerable portion of the business of this firm was with the southern
States, but a few years before the Civil War its name was published in
the notorious “black-list” of the pro-slavery Secessionists, as an
“Abolitionist” concern, and as a result all trade with that section of the
country was ended. The “black-list” at first comprised only the names of
Bowen, Holmes & Co., Lathrop, Ludington & Co., and a few others, but
in time was increased until it embraced about forty of the leading
houses in wholesale lines in New York, Boston, and Philadelphia, and
was widely published throughout the South, to injure if possible the
business of those who, like Bowen, Holmes & Co., “sold their goods but
not their principles.” Of course the outbreak of the war ended what little
trade remained for these houses in the South, but Lathrop, Ludington &
Co. more than recouped elsewhere the losses of their southern trade,
and before the end of the war had become the third leading firm in that
line in New York. Mr. Ludington was an ardent upholder of the Union.
Unable himself to go to the war as a soldier, he employed and sent a
substitute, and his firm contributed large sums for the recruiting and
equipping of troops in New York City and in Putnam County. Retiring in
1868, he has since that time been engaged in various personal
enterprises in New York and in the West.
James Ludington, the sixth child of Lewis Ludington, was born at
Carmel, on April 18, 1827, went to Milwaukee in 1843, worked in the
establishment of Ludington & Co., aided his father in founding the town
of Columbus, and was for a time his father’s resident agent there. Later,
at Milwaukee, he was treasurer of a railroad company and vice-president
of the Bank of the West at Madison, Wisconsin. In 1859 he acquired
extensive saw-mills at the mouth of the Père Marquette River, in
Michigan, and there founded the city of Ludington. He died on April 1,
1891.
In addition to the impress thus widely made upon the military,
political, business and other history of the United States by members of
the family, the name of Ludington, in memory of the influence and
achievements of those who have borne it, is honorably inscribed upon
the maps of no fewer than four of the States. A village of Putnam
County, at the site of the old homestead of colonial and revolutionary
times, bears, as we have seen, the name of Ludingtonville—at once a
tribute to the Ludington family and an unfortunate example of the
unhappy American habit, now less prevalent than formerly, of adding
“ville” to local names. Far better was the bestowal of the simple and
sufficient name of Ludington upon the lake port in Michigan, referred to
in the preceding notice of James Ludington’s life. The same name is
borne by a village in the parish of Calcasieu, in southwestern Louisiana,
while the part the Ludington family played in the settlement and
upbuilding of the State of Wisconsin is commemorated in the name of a
village in Eau Claire County, which retains an old and familiar variant of
spelling, Luddington.
The quoted tribute to the English Ludingtons of former centuries, with
which this volume was begun, might well, mutatis mutandis, be recalled
at its close for application to the Ludingtons of America. The boast of
being of “great estate” is worthily matched with the record of having
contributed something of substantial value to the common wealth of the
Great Republic, and travels in Eastern lands are rivalled with travels and
labors in the greater regions of the West; while even wars against the
Paynim and loyalty to the King did not surpass in merit the war for
liberty and independence and loyalty to the intrinsic rights of man. In
this view of the case, it is confidently hoped that not only for the sake of
family affection, but also for its historical interest, it will be deemed
worth the while to have told thus briefly and simply the story of Henry
Ludington.
INDEX
Aikins, David, affidavit of, 137
Angell, Col. Israel, quoted, 168
Arnold, Seymour, petition of, 183

Beatty, Col. W., 166


“Birch, Harvey,” 114
Border Warfare in Revolution, 133
Branford, Conn., 24
Brinckerhoff, Col. Dirck, replies to Clinton, 99
Burgoyne’s surrender, 106
Burke’s Heraldry, quoted, 4
Byington, John, affidavit of, 34

Chatterton Hill, see White Plains


Clinton, Fort, capture of, 105
Clinton, George, commander of militia, 178;
order to Colonel Graham, 86;
troubled by disaffection of militia, 92;
difficulties in raising levies, 94;
orders to Colonel Ludington, 96;
orders countermanded, 97;
meets disaster at Fort Montgomery, 105;
urges defense of Hudson, 106;
letters to Colonel Ludington, 160, 170, 179, 185;
to Colonel Hopkins, 173;
to Colonel Van Bunschoten, 181;
to General Swartwout, 181
Clinton, Sir Henry, 105
Clinton, James, 105
Colony Record of Deeds, of Connecticut, quoted, 20
Comfort, Mrs. Julia L., letter to Mr. Patrick, 213
Cooper, James Fenimore, quoted, 114
Cowing, Daniel, petition of, 183
Crabb, John, arrest of, 143
Crosby, Enoch, original of “Harvey Birch,” 115;
narrative of his services as American spy, 118

Dana, Francis, at Colonel Ludington’s, 167


Danbury, Conn., raiding of, 88
Dates, uncertainties of, 10
De Kalb, Baron, 166
De Peyster, General, quoted, 105
Dieskau, Baron, 27, 28, 29
Dimon, Lieutenant Colonel, arrests traitors, 143
Dodd’s “East Haven Register,” quoted, 19, 22, 26
Domesday Book, Ludington mentioned in, 6
Duer, William, 55, 56, 57, 75, 134
Dutchess County, N. Y., divisions of, 36, 58;
population of, 40;
officers of and their oaths, 41;
revolutionary passions in, 49;
Committee of Safety of, 49;
text of patriotic compact in, 52;
militia organizations of, 61, 70;
services of militia of, 72;
militia urged to service in 87;
militia urged to service in, 87;
scene of border warfare and raids, 133;
a danger spot, 139;
freeholders’ address to the Legislature, 153

East Haven, Conn., 13


Ellery, William, whimsical account of a night at Colonel
Ludington’s, 166

Farmer’s List of Ancient Names, quoted, 7


Foote’s company, 2nd Connecticut Regiment, 26
Fredericksburgh, town of, 37;
much visited by troops, 165
Frederickstown, 36, 58, 59

Goodrich, Col. Elizur, 26


Gray’s genealogical work, quoted, 3

Hamilton, Alexander, on burning of Danbury, 91;


voted for by Colonel Ludington, 199;
report in behalf of Colonel Ludington, 200
Hendrick, Mohawk chieftain, 27, 28
Hoadly’s New Haven Colonial Records, quoted, 15
Holmes, Col. John, Tory agent, 147;
Colonel Ludington’s letter about, 148;
captured by Colonel Ludington, 150
Hopewell, ship, 7
Hopkins, Col. Roswell, letter to Clinton, 171;
experience with a press master, 174;
resigns commission 176
resigns commission, 176

Iron works at East Haven, Conn., 13


Irving, Washington, quoted, 169

Jay, John, 51, 55, 75, 125, 141, 208


Johnson, Major General Sir William, 27

Kane, Kain, or Keane, John, treated as a Tory, 169


“Kansas Herald,” quoted, 222
Kent, N. Y., town of, 37
Kingston, N. Y., state capital, menaced by the British, 105;
burned, 106, 161

Lake George, Battle of, 27


Lossing, Benson J., quoted, 169
Loyalists, or Tories, 47, 73
Luddington, Wisconsin, 228
Ludington, Louisiana, 228
Ludington, Michigan, 228
Ludingtonville, N. Y., origin of, 38;
name of, 228
Ludington family, 3, 4, 5
Ludington Hospital, 6
Ludington, various forms of the name, 5
Ludington, Abigail, 22, 35, 209
Ludington, Archibald, 45, 204
Ludington, Charles Henry, MS. collections quoted, 192, 204;
career of, 226
Ludington, Christian, 7
Ludington, Christopher, 8
Ludington, Comfort, Revolutionary soldier, 72, 82, 215
Ludington, Elisha, Revolutionary soldier, 71
Ludington, Col. Elisha H., 216
Ludington, Ellen, 8;
remarriage, 17
Ludington, Frederick, birth, 45;
career, 217
Ludington, George, 218
Ludington, Harrison, Governor, 218
Ludington, Henry 1st, son of William 2nd, 20, 21;
his children—
Daniel, 21;
Ezra, 21;
Collins, 21;
William, 21;
Sarah, 21;
Dinah, 21;
Lydia, 21;
Nathaniel, 22;
Moses, 22;
Aaron, 22;
Elisha, 22;
Sarah, 22;
Thomas, 22
Ludington, Col. Henry, birth of, 22;
at Branford, Conn., 24;
boyhood and schooling 25;
boyhood and schooling, 25;
enlists in French and Indian War, 25;
at Battle of Lake George, 27;
dates of reënlistments, 30;
at Quebec, 30;
winter march to Boston, 30;
commissioned lieutenant, 31;
captain in Beverly Robinson’s regiment, 31;
recorded as “Deserted,” 31;
affidavits concerning his service, 33;
marriage and settlement in New York, 35;
house and mills, 39;
important location of his home, 40;
oaths as sub-sheriff, 41;
service as sub-sheriff, 44;
his children, 45;
enters revolutionary movement, 52;
under orders of Committee of Safety, 56;
territorial command as militia colonel, 59;
work in organizing militia, 66;
various commissions in army, 67;
succeeds Colonel Morrison, 68;
formation of his regiment, 70;
organization, 73;
letter to Provincial Congress of New York 74;
enters Revolutionary War, 77;
at Battle of White Plains, 81;
intercourse with Washington, 82;
stationed at North Castle, 85;
avenges burning of Danbury, 89;
summoned to defend the Highlands of the Hudson, 91;
sent to Westchester County, 96;
recalled to Peekskill, 98;
difficulty in complying with orders, 100;
foils British at Tarrytown, 101;
plans defense of Highlands, 106;
letter to Clinton about difficulty of raising troops, 107;
returns of his regiment, 109;
action at Crom Pond, 109;
temporary disbandment of regiment, 110;
secret service, 114;
relations with “the spy, Harvey Birch,” otherwise Enoch
Crosby, 115;
instructions from Colonel Sackett, 115;
engagement of Benajah Tubbs, 116;
gives letter to Enoch Crosby, 132;
services in border warfare, 134;
road-building for forage parties, 135;
captures Nickerson’s party, 138;
in Westchester County, 142;
gives “character” to a Tory, 144;
arrests Elijah Taylor, 145;
address to Council of Safety, 147;
letter to Clinton about Col. John Holmes, 148;
captures Holmes, 150;
hated by the Tories, 156;
prize offered for his capture, 157;
feud with Dr. Prosser, 158;
letter to Clinton, 159;
humanity toward Tories, 162;
embarrassed with depreciated currency, 166;
William Ellery and Francis Dana at his house, 166;
letter to Clinton about militia, 177;
challenged to fight a duel 179;
challenged to fight a duel, 179;
retained on duty in Westchester County, 180;
letter to Clinton with petition of deserters, 183;
letters to Clinton on burdens of militia, 185, 186;
abstract of pay-roll, 187;
affidavit on accounts, 188;
purchase of bounty lands, 189;
end of military service, 190;
deputy sheriff and justice of the peace, 191;
text of commission as justice of the peace, 194;
service in New York Legislature, 198;
Federalist and friend of Hamilton, 199;
petition for relief in case of missing certificates, 199;
votes against independence of Vermont, 202;
builder of improved road, 202;
retires from colonelcy, 203;
buys and sells land at Frederickstown, 206;
interest in church and school, 208;
personal traits, 208;
death and burial, 208;
simple epitaph, 209;
Blake’s tribute, 209;
text of his will, 209
Ludington, Henry, Jr., 45, 204
Ludington, Horace, M.D., 216
Ludington, James, 227
Ludington, Lewis, 45, 217, 218;
his career, 224;
death, 226
Ludington, Gen. Marshall I., 216
Ludington, Nelson, 218, 225
g , , ,
Ludington, Rebecca, birth, 45;
marriage, 45;
service as sentry, 157
Ludington, Robert, 3;
Sir John, 5;
Thomas, 5;
Stephen, 5;
Elizabeth, 5
Ludington, Sibyl, birth, 45;
marriage, 45;
ride to summon troops to avenge burning of Danbury, 90;
aids Enoch Crosby the spy, 132;
service as sentry, 157;
her children, 219
Ludington, Stephen, Revolutionary soldier, 71
Ludington, Tertullus, 45, 213
Ludington, Thomas, of Newark, N. J., 18;
John, 19;
James, 19;
John, of Vermont, 19;
Mary, 19;
Henry, 19;
Hannah, 19;
Matthew, 20
Ludington, William 1st, at Charlestown and Malden, 8;
deed of land from Ralph Hall, 11;
creditor of Henry Sandyes, 12;
removal to East Haven, 12;
death, 13;
inventory of estate, 15;
children, 18
Ludington, William 2nd, 19;
Henry, 20;
Eleanor, 20;
William 3rd, 20;
Samuel, 20;
Timothy, 21;
Mercy, 21;
Mary, 21;
Hannah, 21;
John, 21;
Jude, 21;
Eliphalet, 21;
Amos, 21;
Elizabeth, 21;
Dorothy, 21;
Dorcas, 21
Ludington, William, son of Henry, 21, 22;
Submit, 22;
Mary, 22;
Henry, 22;
Lydia, 22;
Samuel, 22;
Rebecca, 22;
Anne, 22;
Stephen, 22
Ludington, William, Revolutionary soldier, 72
Ludington, Zalmon, 215
Ludington, Zalmon, Jr., 216
Lyman, General, 28
Militia, organization of, in New York, 60;
in Dutchess and Westchester counties, 61;
pay of, 62;
a sample muster-roll, 63;
Colonel Ludington’s regiment formed, 70;
called out by Congress, 72;
commanded by George Clinton, 78;
ordered to Highlands of Hudson, 79;
at White Plains, 81;
defending the Hudson, 84;
restless when waiting, 92;
difficulties in raising levies, 95;
reluctance to serve, 98;
radical reorganization, 111;
abolition of office of colonel, 203
Montgomery, Fort, capture of, 105
Morrison, Malcolm, resigns commission, 68;
arrested on suspicion of treason, 138

New Haven Probate Records, quoted, 19


New York, counties of, 36;
boundary dispute with Connecticut, 37;
sentiment at beginning of Revolution, 47;
patriotic organizations, 51;
action of Provincial Congress, 54;
vigilance committees against Tories, 55;
organization of militia, 60;
changes of government, 70;
militia called out, 72
Nickerson “Josh ” 138
Nickerson, Josh, 138

Oblong, The, 37
“Observer, The New York,” quoted, 219
Ogden, Major Edmund A., 219
Ogden, Edward, Edmund, or Henry, 45
Ogden, Richard Ludington, 223

Patrick, Lewis S., MS. collections and researches, quoted, 8, 13,


19, 30, 52, 168, 189, 194, 207, 213;
ancestry and genealogical work, 219
Patrick, Mrs. M. L., 216
Pawling, N. Y., town of, 36
Pope’s Pioneers of Massachusetts, quoted, 14
Prosser, Dr., Tory conspirator, 126, 132;
tries to capture Colonel Ludington, 157;
their feud, 158
Putnam County, N. Y., origin of, 36
Putnam, Gen. Israel, order to militia, 93;
abandons Peekskill, 105;
orders to Colonel Ludington, 142

Quaker Hill, 37, 50


Quakers, attitude of, in Revolution, 50

Read, Jacob, arrest of, 146


Records of the Proprietors of New Haven, quoted, 17, 18
Revolution, The, beginning of, 47;
Henry Ludington’s services in, 77
Robinson, Beverly, 31, 45, 169
Rochambeau, Count, guest at Colonel Ludington’s, 166
Rose, John, 18

Sackett, Col. Nathaniel, commissioned to suppress conspiracies,


85, 87;
secret service instructions to Colonel Ludington, 115
Savage’s Genealogical Register, quoted, 8
Scribner, Col. Nathaniel, muster-roll, 63
Secret service in the Revolution, 114;
Benajah Tubbs, 116;
Enoch Crosby’s narrative, 117
Sequestration of lands, 150;
commissioners of, 151
Shrawley, Ludingtons of, 3
“Spy, The,” 114
Stirling, Lord, 45
Sutherland, David, 173
Swartwout, Jacobus, General, 67

Tarrytown, British landing at, 101


Taylor, Elijah, arrest of, 145
Tories, definition of, 48;
their hatred of Colonel Ludington, 156;
his humanity toward them, 162;
severe decree against them, 164
Tryon, William, last British governor of New York, 31;
raids Danbury, 88;
lands at Tarrytown 103
lands at Tarrytown, 103
Tubbs, Benajah, employed as a spy, 116

Van Bunschoten, Col. E., letter to Clinton, 180


Vaughan, General, burns Kingston, 106

Washington, George, has Colonel Ludington for aide at White


Plains, 82;
marches across New Jersey, 83;
urges defense of Highlands, 92;
gives warning of Howe’s designs, 94;
guest at Colonel Ludington’s, 165;
headquarters at Colonel Ludington’s, 169
Westchester County, N. Y., militia in, 76;
Colonel Ludington’s services in, 96, 142
Wheaton, Jehoidah, affidavit of, 33
White Plains, Battle of, 76, 80;
Colonel Ludington at, 81
Whiting, Col. Nathan, 26, 28
Williams, Daniel, letter to Clinton, 182
Williams, Col. Ephraim, 28
Worcester, Ludington memorial at, 3
Wyman’s Records of Charlestown and Malden, 14
*** END OF THE PROJECT GUTENBERG EBOOK COLONEL HENRY
LUDINGTON: A MEMOIR ***

Updated editions will replace the previous one—the old editions will
be renamed.

Creating the works from print editions not protected by U.S.


copyright law means that no one owns a United States copyright in
these works, so the Foundation (and you!) can copy and distribute it
in the United States without permission and without paying
copyright royalties. Special rules, set forth in the General Terms of
Use part of this license, apply to copying and distributing Project
Gutenberg™ electronic works to protect the PROJECT GUTENBERG™
concept and trademark. Project Gutenberg is a registered trademark,
and may not be used if you charge for an eBook, except by following
the terms of the trademark license, including paying royalties for use
of the Project Gutenberg trademark. If you do not charge anything
for copies of this eBook, complying with the trademark license is
very easy. You may use this eBook for nearly any purpose such as
creation of derivative works, reports, performances and research.
Project Gutenberg eBooks may be modified and printed and given
away—you may do practically ANYTHING in the United States with
eBooks not protected by U.S. copyright law. Redistribution is subject
to the trademark license, especially commercial redistribution.

START: FULL LICENSE


THE FULL PROJECT GUTENBERG LICENSE
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!

ebookbell.com

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy