Matlab Control System Toolbox Documentation instant download
Matlab Control System Toolbox Documentation instant download
download
https://ebookbell.com/product/matlab-control-system-toolbox-
documentation-6741130
https://ebookbell.com/product/matlab-control-system-toolbox-reference-
the-mathworks-inc-7211778
https://ebookbell.com/product/matlab-control-system-toolbox-users-
guide-the-mathworks-inc-7211782
System Design Through Matlab Control Toolbox And Simulink 1st Edition
Krishna K Singh Be
https://ebookbell.com/product/system-design-through-matlab-control-
toolbox-and-simulink-1st-edition-krishna-k-singh-be-4187616
https://ebookbell.com/product/matlab-for-control-system-engineers-
second-edition-dukkipati-9953648
Linear Control System Analysis And Design With Matlab 6th Constantine
H Houpis
https://ebookbell.com/product/linear-control-system-analysis-and-
design-with-matlab-6th-constantine-h-houpis-5146320
https://ebookbell.com/product/pid-control-system-design-and-automatic-
tuning-using-matlabsimulink-wiley-ieee-liuping-wang-11043920
Control System Analysis And Identification With Matlab Block Pulse And
Related Orthogonal Functions Deba
https://ebookbell.com/product/control-system-analysis-and-
identification-with-matlab-block-pulse-and-related-orthogonal-
functions-deba-9964924
https://ebookbell.com/product/model-predictive-control-system-design-
and-implementation-using-matlab-liuping-wang-30157882
Dynamic System Modeling And Analysis With Matlab And Python For
Control Engineers Jongrae Kim
https://ebookbell.com/product/dynamic-system-modeling-and-analysis-
with-matlab-and-python-for-control-engineers-jongrae-kim-46431456
Control System Toolbox™
Getting Started Guide
R2016a
How to Contact MathWorks
Phone: 508-647-7000
Product Overview
1
Control System Toolbox Product Description . . . . . . . . . . . . 1-2
Key Features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-2
Building Models
2
Linear (LTI) Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
What Is a Plant? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-2
Linear Model Representations . . . . . . . . . . . . . . . . . . . . . . . . 2-2
SISO Example: The DC Motor . . . . . . . . . . . . . . . . . . . . . . . 2-3
Building SISO Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-5
Constructing Discrete Time Systems . . . . . . . . . . . . . . . . . . . 2-8
Adding Delays to Linear Models . . . . . . . . . . . . . . . . . . . . . . 2-9
LTI Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-10
v
Converting Between Continuous- and Discrete- Time
Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-22
Available Commands for Continuous/Discrete Conversion . . 2-22
Available Methods for Continuous/Discrete Conversion . . . . 2-22
Digitizing the Discrete DC Motor Model . . . . . . . . . . . . . . . 2-22
Analyzing Models
3
Linear Analysis Using the Linear System Analyzer . . . . . . . 3-2
Designing Compensators
4
Choosing a PID Controller Design Tool . . . . . . . . . . . . . . . . . 4-2
vi Contents
Analyze Design in PID Tuner . . . . . . . . . . . . . . . . . . . . . . . . 4-10
Plot System Responses . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-10
View Numeric Values of System Characteristics . . . . . . . . . 4-15
Refine the Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-16
vii
Handling Initial Conditions . . . . . . . . . . . . . . . . . . . . . . . . . 4-81
viii Contents
1
Product Overview
1 Product Overview
Control System Toolbox provides algorithms and apps for systematically analyzing,
designing, and tuning linear control systems. You can specify your system as a transfer
function, state-space, zero-pole-gain, or frequency-response model. Apps and functions,
such as step response plot and Bode plot, let you analyze and visualize system behavior
in the time and frequency domains.
You can tune compensator parameters using interactive techniques such as Bode loop
shaping and the root locus method. The toolbox automatically tunes both SISO and
MIMO compensators, including PID controllers. Compensators can include multiple
tunable blocks spanning several feedback loops. You can tune gain-scheduled controllers
and specify multiple tuning objectives, such as reference tracking, disturbance rejection,
and stability margins. You can validate your design by verifying rise time, overshoot,
settling time, gain and phase margins, and other requirements.
Key Features
• Transfer-function, state-space, zero-pole-gain, and frequency-response models of
linear systems
• Step response, Nyquist plot, and other time-domain and frequency-domain tools for
analyzing stability and performance
• Automatic tuning of PID, gain-scheduled, and arbitrary SISO and MIMO control
systems
• Root locus, Bode diagrams, LQR, LQG, and other classical and state-space design
techniques
• Model representation conversion, continuous-time model discretization, and low-order
approximation of high-order systems
1-2
2
Building Models
In this section...
“What Is a Plant?” on page 2-2
“Linear Model Representations” on page 2-2
“SISO Example: The DC Motor” on page 2-3
“Building SISO Models” on page 2-5
“Constructing Discrete Time Systems” on page 2-8
“Adding Delays to Linear Models” on page 2-9
“LTI Objects” on page 2-10
What Is a Plant?
Typically, control engineers begin by developing a mathematical description of the
dynamic system that they want to control. The system to be controlled is called a plant.
As an example of a plant, this section uses the DC motor. This section develops the
differential equations that describe the electromechanical properties of a DC motor with
an inertial load. It then shows you how to use the Control System Toolbox functions to
build linear models based on these equations.
dx
= Ax + Bu
dt
y = Cx + Du
2-2
Linear (LTI) Models
s+2
H ( s) =
2
s + s + 10
• Zero-pole-gain (ZPK) models, for example,
( z + 1 + j)( z + 1 - j)
H ( z) = 3
( z + 0.2)( z + 0 .1)
• Frequency response data (FRD) models, which consist of sampled measurements of
a system's frequency response. For example, you can store experimentally collected
frequency response data in an FRD model.
Note The design of FRD models is a specialized subject that this topic does not
address. See “Frequency Response Data (FRD) Models” for a discussion of this topic.
2-3
2 Building Models
In this model, the dynamics of the motor itself are idealized; for instance, the magnetic
field is assumed to be constant. The resistance of the circuit is denoted by R and the
self-inductance of the armature by L. If you are unfamiliar with the basics of DC motor
modeling, consult any basic text on physical modeling. With this simple model and basic
laws of physics, it is possible to develop differential equations that describe the behavior
of this electromechanical system. In this example, the relationships between electric
potential and mechanical force are Faraday's law of induction and Ampère's law for the
force on a conductor moving through a magnetic field.
Mathematical Derivation
The torque t seen at the shaft of the motor is proportional to the current i induced by the
applied voltage,
t(t) = K m i(t)
where Km, the armature constant, is related to physical properties of the motor, such as
magnetic field strength, the number of turns of wire around the conductor coil, and so
on. The back (induced) electromotive force, uemf , is a voltage proportional to the angular
rate w seen at the shaft,
uemf ( t) = K bw(t)
where Kb, the emf constant, also depends on certain physical properties of the motor.
The mechanical part of the motor equations is derived using Newton's law, which states
that the inertial load J times the derivative of angular rate equals the sum of all the
torques about the motor shaft. The result is this equation,
dw
J = Â ti = - K f w( t) + Km i (t)
dt
di
uapp (t) - uemf ( t) = L + Ri( t)
dt
2-4
Linear (LTI) Models
or, solving for the applied voltage and substituting for the back emf,
di
uapp (t) = L + Ri(t) + K bw( t)
dt
This sequence of equations leads to a set of two differential equations that describe the
behavior of the motor, the first for the induced current,
di R K 1
= - i( t) - b w( t) + uapp (t)
dt L L L
dw 1 1
= - K f w(t) + Km i (t)
dt J J
Given the two differential equations derived in the last section, you can now develop a
state-space representation of the DC motor as a dynamic system. The current i and the
angular rate ω are the two states of the system. The applied voltage, uapp , is the input to
the system, and the angular velocity ω is the output.
È R Kb ˘
- - È1˘
d Èi ˘ Í L L ˙ Èi˘ Í ˙
Í ˙ =Í ˙◊ + L ◊u
K f ˙ ÍÎ w˙˚ Í ˙ app
(t)
dt Îw˚ Í Km
Í - ˙ Í 0
Î ˚ ˙
Î J J ˚
Èi˘
y( t) = [0 1 ] ◊ Í ˙ + [ 0 ] ◊ uapp (t)
Î w˚
2-5
2 Building Models
Enter the following nominal values for the various parameters of a DC motor.
R= 2.0 % Ohms
L= 0.5 % Henrys
Km = .015 % torque constant
Kb = .015 % emf constant
Kf = 0.2 % Nms
J= 0.02 % kg.m^2
Given these values, you can construct the numerical state-space representation using the
ss function.
A = [-R/L -Kb/L; Km/J -Kf/J]
B = [1/L; 0];
C = [0 1];
D = [0];
sys_dc = ss(A,B,C,D)
b =
u1
x1 2
x2 0
c =
x1 x2
y1 0 1
d =
u1
y1 0
2-6
Linear (LTI) Models
Now that you have a state-space representation of the DC motor, you can convert to other
model representations, including transfer function (TF) and zero/pole/gain (ZPK) models.
Transfer Function Representation
You can use tf to convert from the state-space representation to the transfer function.
For example, use this code to convert to the transfer function representation of the DC
motor.
sys_tf = tf(sys_dc)
Transfer function:
1.5
------------------
s^2 + 14 s + 40.02
Zero/Pole/Gain Representation
Zero/pole/gain:
1.5
-------------------
(s+4.004) (s+9.996)
Note The state-space representation is best suited for numerical computations. For
highest accuracy, convert to state space prior to combining models and avoid the
transfer function and zero/pole/gain representations, except for model specification and
inspection.
In the DC motor example, the state-space approach produces a set of matrices that
represents the model. If you choose a different approach, you can construct the
corresponding models using tf, zpk, ss, or frd.
2-7
2 Building Models
For example, you can create the transfer function by specifying the numerator and
denominator with this code.
Transfer function:
1.5
------------------
s^2 + 14 s + 40.02
Alternatively, if you want to create the transfer function of the DC motor directly, use
these commands.
s = tf('s');
sys_tf = 1.5/(s^2+14*s+40.02)
Transfer function:
1.5
--------------------
s^2 + 14 s + 40.02
Zero/pole/gain:
1.5
-------------------
(s+9.996) (s+4.004)
2-8
Linear (LTI) Models
only difference is that you must specify a sample time period for any model you build. For
example,
Transfer function:
1
-----
z + 1
You can add time delays to discrete-time models by specifying an input delay, output
delay, or I/O delay when building the model. The time delay must be a nonnegative
integer that represents a multiple of the sample time. For example,
Transfer function:
1
z^(-5) * -----
z + 1
This command constructs the DC motor transfer function, but adds a 0.05 second delay.
Transfer function:
1.5
2-9
2 Building Models
exp(-0.05*s) * ------------------
s^2 + 14 s + 40.02
For more information about adding time delays to models, see “Time Delays in Linear
Systems”.
LTI Objects
For convenience, the Control System Toolbox software uses custom data structures called
LTI objects to store model-related data. For example, the variable sys_dc created for
the DC motor example is called an SS object. There are also TF, ZPK, and FRD objects
for transfer function, zero/pole/gain, and frequency data response models respectively.
The four LTI objects encapsulate the model data and enable you to manipulate linear
systems as single entities rather than as collections of vectors or matrices.
To see what LTI objects contain, use the get command. This code describes the contents
of sys_dc from the DC motor example.
get(sys_dc)
a: [2x2 double]
b: [2x1 double]
c: [0 1]
d: 0
e: []
StateName: {2x1 cell}
InternalDelay: [0x1 double]
Ts: 0
InputDelay: 0
OutputDelay: 0
InputName: {''}
OutputName: {''}
InputGroup: [1x1 struct]
OutputGroup: [1x1 struct]
Name: ''
Notes: {}
UserData: []
You can manipulate the data contained in LTI objects using the set command; see the
Control System Toolbox online reference pages for descriptions of set and get.
Another convenient way to set or retrieve LTI model properties is to access them directly
using dot notation. For example, if you want to access the value of the A matrix, instead
of using get, you can type
2-10
Linear (LTI) Models
sys_dc.a
ans =
-4.0000 -0.0300
0.7500 -10.0000
Similarly, if you want to change the values of the A matrix, you can do so directly, as this
code shows.
A_new = [-4.5 -0.05; 0.8 -12.0];
sys_dc.a = A_new;
See Also
ss | tf | zpk
Related Examples
• “Transfer Functions”
• “State-Space Models”
• “Discrete-Time Numeric Models”
More About
• “Numeric Models”
2-11
2 Building Models
MIMO Models
In this section...
“State-Space Model of Jet Transport Aircraft” on page 2-12
“Constructing MIMO Transfer Functions” on page 2-14
“Accessing I/O Pairs in MIMO Systems” on page 2-16
The jet model during cruise flight at MACH = 0.8 and H = 40,000 ft. is
A = [-0.0558 -0.9968 0.0802 0.0415
0.5980 -0.1150 -0.0318 0
-3.0500 0.3880 -0.4650 0
0 0.0805 1.0000 0];
B = [ 0.0073 0
-0.4750 0.0077
0.1530 0.1430
0 0];
C = [0 1 0 0
0 0 0 1];
D = [0 0
0 0];
Use the following commands to specify this state-space model as an LTI object and attach
names to the states, inputs, and outputs.
states = {'beta' 'yaw' 'roll' 'phi'};
inputs = {'rudder' 'aileron'};
outputs = {'yaw rate' 'bank angle'};
sys_mimo = ss(A,B,C,D,'statename',states,...
'inputname',inputs,...
2-12
MIMO Models
'outputname',outputs);
a =
beta yaw roll phi
beta -0.0558 -0.9968 0.0802 0.0415
yaw 0.598 -0.115 -0.0318 0
roll -3.05 0.388 -0.465 0
phi 0 0.0805 1 0
b =
rudder aileron
beta 0.0073 0
yaw -0.475 0.0077
roll 0.153 0.143
phi 0 0
c =
beta yaw roll phi
yaw rate 0 1 0 0
bank angle 0 0 0 1
d =
rudder aileron
yaw rate 0 0
bank angle 0 0
Continuous-time model.
The model has two inputs and two outputs. The units are radians for beta (sideslip
angle) and phi (bank angle) and radians/sec for yaw (yaw rate) and roll (roll rate). The
rudder and aileron deflections are in degrees.
2-13
2 Building Models
È s-1 ˘
Í s+1 ˙
H ( s) = Í ˙
Í s+ 2 ˙
ÍÎ s2 + 4 s + 5 ˙˚
You can specify H(s) by concatenation of its SISO entries. For instance,
h11 = tf([1 -1],[1 1]);
h21 = tf([1 2],[1 4 5]);
or, equivalently,
s = tf('s')
h11 = (s-1)/(s+1);
2-14
MIMO Models
h21 = (s+2)/(s^2+4*s+5);
H = [h11; h21]
This syntax mimics standard matrix concatenation and tends to be easier and more
readable for MIMO systems with many inputs and/or outputs.
Alternatively, to define MIMO transfer functions using tf, you need two cell arrays (say,
N and D) to represent the sets of numerator and denominator polynomials, respectively.
See Cell Arrays in the MATLAB documentation for more details on cell arrays.
For example, for the rational transfer matrix H(s), the two cell arrays N and D should
contain the row-vector representations of the polynomial entries of
È s-1 ˘ È s+1 ˘
N ( s) = Í ˙ D( s) = Í ˙
Îs + 2˚ Î s2 + 4 s + 5 ˚
s + 2
#2: -------------
s^2 + 4 s + 5
Notice that both N and D have the same dimensions as H. For a general MIMO
transfer matrix H(s), the cell array entries N{i,j} and D{i,j} should be row-vector
representations of the numerator and denominator of Hij(s), the ijth entry of the transfer
matrix H(s).
2-15
2 Building Models
extracts the subsystem, mapping the first input to the third output. Row indices select
the outputs and column indices select the inputs. Similarly,
sys_mimo(3,1) = tf(1,[1 0])
redefines the transfer function between the first input and third output as an integrator.
2-16
Arrays of Linear Models
The number of inputs and outputs must be the same for all linear models encapsulated
by the LTI array, but the model order (number of states) can vary from model to model
within a single LTI array.
The LTI array sys_lti contains the state-space models for each value of K. Type
sys_lti to see the contents of the LTI array.
Model sys_lti(:,:,1,1)
======================
a =
x1 x2
x1 -4 -0.2
x2 5 -10
.
.
.
Model sys_lti(:,:,2,1)
======================
a =
x1 x2
x1 -4 -0.3
x2 7.5 -10
.
.
.
Model sys_lti(:,:,3,1)
======================
2-17
2 Building Models
a =
x1 x2
x1 -4 -0.4
x2 10 -10
.
.
.
3x1 array of continuous-time state-space models.
You can manipulate the LTI array like any other object. For example,
step(sys_lti)
produces a plot containing step responses for all three state-space models.
LTI arrays are useful for performing batch analysis on an entire set of models. For more
information, see “Model Arrays”.
2-18
Model Characteristics
Model Characteristics
You can use the Control System Toolbox commands to query model characteristics
such as the I/O dimensions, poles, zeros, and DC gain. These commands apply to both
continuous- and discrete-time models. Their LTI-based syntax is summarized in the table
below.
2-19
2 Building Models
In this section...
“Arithmetic Operations for Interconnecting Models” on page 2-20
“Feedback Interconnections” on page 2-21
Transfer function:
s^2 + 2 s + 2
-------------
s^2 + 2 s
Transfer function:
2 s + 2
---------
s^2 + 2 s
If the operands are models of different types, the resulting model type is determined by
precedence rules; see “Rules That Determine Model Type” for more information.
For more information about model arithmetic functions, see “Catalog of Model
Interconnections”.
You can also use the series and parallel functions as substitutes for multiplication
and addition, respectively.
2-20
Interconnecting Linear Models
Feedback Interconnections
You can use the feedback and lft functions to derive closed-loop models. For example,
computes the closed-loop transfer function from r to y for the feedback loop shown below.
The result is
Transfer function:
s + 2
-------------
s^2 + 3 s + 1
Feedback Interconnection
You can use the lft function to create more complicated feedback structures. This
function constructs the linear fractional transformation of two systems. See the reference
page for more information.
2-21
2 Building Models
In this section...
“Available Commands for Continuous/Discrete Conversion” on page 2-22
“Available Methods for Continuous/Discrete Conversion” on page 2-22
“Digitizing the Discrete DC Motor Model” on page 2-22
Ts=0.01;
sysd=c2d(sys_dc,Ts)
2-22
Converting Between Continuous- and Discrete- Time Systems
a =
x1 x2
x1 0.96079 -0.00027976
x2 0.006994 0.90484
b =
u1
x1 0.019605
x2 7.1595e-005
c =
x1 x2
y1 0 1
d =
u1
y1 0
To see the discrete-time zero-pole gain for the digital DC motor, use zpk to convert the
model.
fd=zpk(sysd)
Zero/pole/gain:
7.1595e-005 (z+0.9544)
------------------------
(z-0.9608) (z-0.9049)
You can compare the step responses of sys_dc and sysd by typing
step(sys_dc,sysd)
This figure shows the result.
2-23
2 Building Models
Note the step response match. Continuous and FOH-discretized step responses match for
models without internal delays.
2-24
Reducing Model Order
In this section...
“Model Order Reduction Commands” on page 2-25
“Techniques for Reducing Model Order” on page 2-25
“Example: Gasifier Model” on page 2-26
• Eliminate states that are structurally disconnected from the inputs or outputs using
sminreal.
2-25
2 Building Models
load ltiexamples
at the MATLAB prompt; the gasifier example is stored in the variable named gasf. If
you type
size(gasf)
You can reduce the order of a single I/O pair to understand how the model reduction tools
work before attempting to reduce the full MIMO model as described in “MIMO Model
Order Reduction” on page 2-30.
This example focuses on a single input/output pair of the gasifier, input 5 to output 3.
sys35 = gasf(3,5);
Before attempting model order reduction, inspect the pole and zero locations by typing
pzmap(sys35)
Zoom in near the origin on the resulting plot using the zoom feature or by typing
2-26
Reducing Model Order
Because the model displays near pole-zero cancellations, it is a good candidate for model
reduction.
To find a low-order reduction of this SISO model, perform the following steps:
1 Select an appropriate order for your reduced system by examining the relative
amount of energy per state using a Hankel singular value (HSV) plot. Type the
command
hsvd(sys35)
to create the HSV plot.
Changing to log scale using the right-click menu results in the following plot.
2-27
2 Building Models
Small Hankel singular values indicate that the associated states contribute little to
the I/O behavior. This plot shows that discarding the last 10 states (associated with
the 10 smallest Hankel singular values) has little impact on the approximation error.
2 To remove the last 10 states and create a 15th order approximation, type
rsys35 = balred(sys35,15);
You can type size(rsys35) to see that your reduced system contains only 15
states.
3 Compare the Bode response of the full-order and reduced-order models using the
bode command:
bode(sys35,'b',rsys35,'r--')
This figure shows the result.
2-28
Reducing Model Order
As the overlap of the curves in the figure shows, the reduced model provides a good
approximation of the original system.
You can try reducing the model order further by repeating this process and removing
more states. Reduce the gasf model to 5th, 10th, and 15th orders all at once by typing
the following command
bode(sys35,'b',rsys35,'r--')
2-29
2 Building Models
You can approximate MIMO models using the same steps as SISO models as follows:
1 Select an appropriate order for your reduced system by examining the relative
amount of energy per state using a Hankel singular value (HSV) plot.
Type
hsvd(gasf)
to create the HSV plot.
2-30
Reducing Model Order
Discarding the last 8 states (associated with the 8 smallest Hankel singular values)
should have little impact on the error in the resulting 17th order system.
2 To remove the last 8 states and create a 17th order MIMO system, type
rsys=balred(gasf,17);
You can type size(gasf) to see that your reduced system contains only 17 states.
3 To facilitate visual inspection of the approximation error, use a singular value plot
rather than a MIMO Bode plot. Type
sigma(gasf,'b',gasf-rsys,'r')
to create a singular value plot comparing the original system to the reduction error.
2-31
2 Building Models
The reduction error is small compared to the original system so the reduced order
model provides a good approximation of the original model.
Acknowledgment
MathWorks thanks ALSTOM® Power UK for permitting use of their gasifier model for
this example. This model was issued as part of the ALSTOM Benchmark Challenge on
Gasifier Control. For more details see Dixon, R., (1999), "Advanced Gasifier Control,"
Computing & Control Engineering Journal, IEE, Vol. 10, No. 3, pp. 92–96.
2-32
3
Analyzing Models
Before you can perform the analysis, you must have already created linear models in the
MATLAB workspace. For information on how to create a model, see “Basic Models”.
1 Open the Linear System Analyzer showing one or more models using the following
syntax:
linearSystemAnalyzer(sys1,sys2,...,sysN)
By default, this syntax opens a step response plot of your models, as shown in the
following figure.
3-2
Linear Analysis Using the Linear System Analyzer
Note: Alternatively, open Linear System Analyzer from the Apps tab in the
MATLAB desktop. When you do so, select File > Import to load linear models from
the MATLAB workspace or a MAT file.
2 Add more plots to the Linear System Analyzer.
3-3
3 Analyzing Models
3-4
Linear Analysis Using the Linear System Analyzer
3 To view a different type of response on a plot, right-click and select a plot type.
4 Analyze system performance. For example, you can analyze the peak response in the
Bode plot and settling time in the step response plot.
3-5
3 Analyzing Models
See Also
linearSystemAnalyzer | lsim
Related Examples
• “Joint Time- and Frequency-Domain Analysis”
More About
• “Linear System Analyzer Overview”
3-6
Simulate Models with Arbitrary Inputs and Initial Conditions
• In the Linear System Analyzer, right-click the plot area and select Plot Types >
Linear Simulation.
• Use the lsim function at the MATLAB prompt:
3-7
3 Analyzing Models
lsim(modelname)
• In the MATLAB Figure window, right-click a response plot and select Input data.
After opening the Linear Simulation Tool (as described in “Opening the Linear
Simulation Tool” on page 3-7), follow these steps to simulate your model:
2 In the Timing area, specify the simulation time vector by doing one of the following:
3-8
Exploring the Variety of Random
Documents with Different Content
CHAPTER XVIII.
BROTHER'S DEATH.—LETTERS.—GIFTS.—
LETTERS.—DIARY.—APPLICANTS FOR AID.—
REFLECTIONS.—LETTER FROM REV. DR. STONE.—
DIARY.
If, at the close of the last year, Mr. Lawrence could say that "his
happiness had been superior to that of any year of his life," it could not
be said that its successor was one of unmingled brightness. The
unbroken band of brothers who had marched thus far hand in hand,
united by a common bond of sympathy and affection, sustaining each
other in all trials, and rejoicing together in their common prosperity, was
about to be sundered. Since their earliest days, they had had but one
interest, and, residing near each other after leaving their early home,
had been in the habit of most constant and intimate intercourse. Many
of their friends will well remember seeing four, and sometimes five, of
them, on Sunday evening, after service, walking together abreast, arm
in arm; and have been tempted to exclaim, "Behold how good and
pleasant a thing it is for brethren to dwell together in unity." They had
more than obeyed their father's injunction "not to fall out by the way, for
a three-fold cord is not quickly broken." With them, it had been a five-
fold cord; and, amidst all the perplexities of business, the management
of important interests, and the various vicissitudes of domestic life, no
strand had been broken until severed by the ruthless hand of death. The
eldest brother, Luther, had been educated at Harvard College; had
studied law with the Hon. Timothy Bigelow, then of Groton, afterwards
of Medford, whose sister he subsequently married; and had commenced
the practice of his profession in his native town. There he met with good
success, and, for many years, represented the town in the House of
Representatives, of which he was chosen Speaker for the session of
1821 and 1822. He was induced by his brothers, who had become
largely interested in the new town of Lowell, to remove thither; and he
accordingly took up his residence there in 1831, having accepted the
presidency of the bank which had been lately established. In 1838, he
had been elected Mayor of the city, and had given himself up to the
pressing duties incident to the office in a new and growing community.
While holding this office, he, on the 17th of April, 1839, accompanied an
old friend and connection, who was on a visit at Lowell, to inspect the
works of the Middlesex Manufacturing Company, recently erected by his
brothers. In passing rapidly through one of the rooms, he made a
misstep, and was precipitated many feet into a wheel-pit, causing
almost instant death. This sad event was deeply felt by Mr. Lawrence, as
well as by all who knew and appreciated the character of the deceased.
In a letter to his sisters, dated April 22, he says:
"I should have addressed a word of comfort to you before this. That
he should be taken, and I left, is beyond my ken, and is a mystery
which will be cleared up hereafter. I do, however, know now that all
is right, and better ordered than we could have done it. We must
submit, and should be resigned. Brother L.'s death may, perhaps,
be more efficient in instructing us in the path of duty than would
have been his life; and the whole community around is admonished
by this event in a way that I have rarely seen so marked. The
homage to his character is a legacy to his children of more value
than all the gold of the mint. Shall we, then, repine at his
separation from us? Surely not. He has fulfilled his mission, and is
taken home, with all his powers fresh and perfect, and with the
character of having used these powers for the best and highest
good of all around him. We shall all soon be called away, and should
make his departure the signal to be also ready. This is the
anniversary of my birth, and has been marked by many
circumstances of peculiar interest."
"I intended speaking a word in your ear before your leaving us for
your own fireside and home, but have concluded to take this mode
of doing it; and it is to say, that you possess a jewel in your wife,
above price, which should be worn in such an atmosphere as will
increase its purity and value the longer you possess it; and that is
around the family altar. That you intend to establish it, I have no
doubt; but, as to the precise time, you may not be fixed. What time
so good as the present time, when the first evening of possession
of this paradise on earth (a house and home of your own with such
a wife), to make that offering to the Father of mercies which
ascends to his throne as sweet incense from his children? It is the
nutriment and efficient producing power of the best principles and
the best fruits of our nature. Be wise in time, and strive to secure
these, that you may go on from one degree to another, until you
shall have reached our Father's house, and shall hear the cheering
'Well done!' promised to such as have used their talents without
abusing them. My blessing attend you!"
"R. leaves us this morning, on his way to the old homestead, which,
to my mind's eye, has all the charms of the most lovely associations
of early days, with all the real beauty of those splendid descriptions
given by the prophets of the holy city. I would earnestly impress all
my children with a deep sense of the beauty and benefit of
cherishing and cultivating a respect and affection for this dear spot,
and for those more dear objects that have served to make it what it
really is to all us children."
"The beautiful scenery from Gibbet Hill, in Groton, and from the
road from our old mansion south for a mile, towards the Wachusett
and the Monadnock Mountains, comes next, in point of beauty, to
my taste, to these views around the Boston Common. Be careful to
do all things as you will wish you had done, that you may look back
upon this visit with pleasure, and forward to another visit with
increased relish. Remember that in the best performance of all your
duties lies the highest enjoyment of all your pleasures. Those
pleasures that flow from plans and doings that your conscience
condemns are to be shunned as the net of the wicked one. When
once entangled, the desire and effort to be released grow weaker,
till, at length, conscience is put asleep, and the sleep of death
comes over the soul. Be careful, therefore, to avoid evil, and not
only so, but to avoid all appearance of evil. In this way, you will
grow up with principles and fixed habits that will secure you against
the ills of life, and supply a foretaste of the enjoyments of a better
life to come."
"I was very tired on arriving here last evening, but a quiet sleep has
brought me into my best state.
"This morning has allowed me to ride for two hours, and I have
enjoyed everything and everybody here to the utmost. Groton is
beautiful beyond any other place I have ever seen; but perhaps I
am in the situation of old Mr. ——, whose opinion of his wife's
beauty, when questioned of its accuracy, was justified by the
declaration that the person must have his eyes to look through.
"The whole country is full of charms; nothing seems wanting to
impress upon the heart the goodness of that Parent who seeks by
all means to bring us nearer to himself.
"This visit has been full of interest, and it is a source of unfeigned
thanksgiving that it has been permitted to me."
"January 1.
"Dear S.: W. will prize the enclosed more highly from your hand; for
he will have proof that a good wife brings many blessings, that he
never would know the value of but for you. May you experience
many returns of the 'new year,' and each more happy than the
past!"
"We are all curious to know what impressions your visit to France
and Italy produces, and still more what impressions a careful
overlooking of our fatherland makes upon you. There is much food
for reflection, and abundant material for the exercise of your
powers of observation, in every league of the 'fast-anchored isle,'
especially in the scenes so beautifully portrayed in many of the
books we have access to. In fact, I have an extensive collection of
materials to renew your travels and observations, and shall value
them more highly when you point out this or that seat or castle or
abbey, which has arrested your notice. But the best scenes will be
those in which the living souls of the present day are engaged. The
habits and tastes of the people of England have doubtless much
changed since the Spectator days; but, in many important
particulars, I should hope they had not. Some thirty years ago, I
had a good specimen of the feelings and principles of a great
variety of people, embracing almost all classes, from the year 1774
to 1776, in a multitude of letters that had accumulated in the post-
office in this town, under Tuthill Hubbart. After his death, his house
was pulled down; and, among the strange things found in it, were
bushels of letters, of which I was permitted to take what I pleased.
These letters showed a deeper religious feeling in the writers of
those days, from England, Ireland, and Scotland, than I have seen
in any miscellaneous collections of a later date. If that deep-toned
piety which pervaded them has not been extinguished by the
Jacobinism and freethinking of later days, happy for the people and
the government! But I fear it has, in some great measure, been
blotted out or obscured, as there seems to be a spirit of reckless
adventure in politics and religion not contemplated seventy years
ago. How far our experience in self-government in this country is
going to advance the cause of good government, and the ultimate
happiness of man, is yet a problem. Our principles are of the most
elevating character; our practices under them, of the most
debasing; and, if we continue in this way another generation, there
will not be virtue enough in active use to save the forms of our
government. We may hope that a better heart may be given us."
In a letter to his son-in-law, the Rev. Charles Mason, who was at that
time in company with his own son on a visit to England, he writes on
June 28th, 1840:
"To-day is one of those holy spring days which make us feel that,
with right principles and conduct, we may enjoy a foretaste of that
beautiful home we all long for. I have been over the Roxbury and
Dorchester hills, which are a transcript of the beautiful scenery
around Jerusalem. Mount Zion seemed before me, and by
stretching my arms, I could almost fly upon its sides."
And again:
To a friend who had invited him to pay her a visit at her residence in the
country, he writes:
"N—— says I am like a child in the matter of the visit, and would be
as much disappointed if it should not be accomplished; and I must
admit that I am guilty of this weakness. There are so many loved
ones on the old spot, so many lessons to be reviewed, and so many
friends 'passed on,' whose spirits surround and fill the place with
the peculiar halo and charm of the good angels (those ministering
spirits in whose company we may ever find comfort, if we will think
so). I say, with all these things, can I be blamed for being a child in
this matter? You will all say No, and will love me the better for it."
About this time, also, Mr. Lawrence seems to have had pleasant
intercourse with the Chevalier Hulsemann, the Austrian Minister, so well
known by his correspondence with Mr. Webster when the latter was
Secretary of State. The minister was on a visit to Boston, and, from the
correspondence which ensued, seems to have conceived a high regard
for Mr. Lawrence, expressed in very kind and courteous terms; and this
regard seems to have been fully reciprocated.
"Rev. and dear Sir: I thank you for the little volume so kindly
presented, and deem it the duty of all the friends of the Saviour to
do what they can to stop the flood of infidelity and atheism that
threatens such waste and devastation among us. However we may
seem to be, I trust many may be found, in the ranks of my
Unitarian friends, who admit the 'claims of Jesus' in their most
elevated character, and who repudiate the doctrine of those who
sink him to the level of a mere human teacher, as subversive of his
authority and as nullifying his teachings. We take the record, and
what is clearly declared; we do not go behind, even though we do
not clearly comprehend it. It gives me pleasure to learn you are so
well recovered from the injury you received from the overturn of
your carriage near my house.
"With great respect, believe me truly yours,
A. L."
"January, 1842.—This year opens with renewed calls upon me to
bless God for his mercies throughout its course. My family circle has
not been broken by the death of any one of our whole number, and
my own health has been better for the last half-year than for five
years before. I have not had occasion to call a physician through
the year. My brothers A. and W. have been dangerously sick, but
are happily recovered; and both feel, I believe, that their hold on
life is not as firm as they have felt it to be in former years. My dear
children are growing up around me to bless and comfort me; and all
I need is a right understanding of my duties, and a sincere purpose
to fulfil them. I hope to have the will to continue them in as faithful
a manner as heretofore, to say the least."
Among the traits in Mr. Lawrence's character was that enlarged spirit of
Christian feeling which enabled him to appreciate goodness in others,
without reference to sect or denomination. This spirit of universal
brotherhood was not in him a matter of mere theory, but was carried
out in the practice of daily life, and was the means of cementing many
and lasting friendships, especially among the clergy of various
denominations around him. It may not be uninteresting in future years,
for those now in childhood, for whom this volume has been prepared, to
be reminded of the strong feeling of sympathy and affection which their
grandfather entertained for the Rev. John S. Stone, D.D., once the
Rector of St. Paul's Church, in Boston, and now the Rector of St. Paul's,
in Brookline, Mass. The following is an extract from a letter written by
that gentleman from Brooklyn, N. Y., daring the year 1842, with a
memorandum endorsed by Mr. Lawrence, dated October, 1847, in which
he says:
"Shall I ever forget the happy moments, hours, days, I may say
weeks, which I have spent in riding with you, and chatting, as we
rode, of all things as we passed them, till I seemed to myself to be
living in the by-gone days of Boston and its neighborhood; and all
its old families, houses, names, and anecdotes, became as familiar
to my mind as the stories of my boyhood? Can I forget it all? I trow
not. These things are all blended in with the beautiful scenery
through which we used to ride, and associated with those graver
lessons and reflections which you used to give me; insomuch that
the picture which my memory retains of nature, society, history, and
feeling, truth, friendship, and religion, and in which Boston and the
living friends there are comprehended, has become imperishable. It
never can fade out of my mind. It is a picture in which man has
done much, friendship more, religion most, and God all; for religion
is his, and friendship is from him, and man is his creature, and the
green earth and glorious heavens are his home. There are many,
very many, objects in this picture, which I contemplate with special
delight; and few which give me pain, or which I would not have had
there, had the whole ordering of its composition been left to me.
Indeed, had this whole ordering been left to me, it may well be
doubted whether, as a whole, it would have contained half of the
beautiful and blessed things which it now contains. Taking it as it is,
therefore, I am well content to receive it, hang it up in the choicest
apartment of my memory, and keep it clean and in good order for
use." * * *
"I went on Friday to Mr. Ware's house, and had a free, full, and
deeply-interesting conversation upon the appointment of his
successor; and was delighted to find him with the same views I
have upon the necessity of removing the theological department
from Cambridge."
Dec. 2, Mr. Lawrence alludes to the probability of his own death taking
place in the manner in which it actually occurred ten years afterwards,
as follows:
"Yesterday I was very well, and have been so for some time past.
Experienced a severe ill turn this morning at five o'clock, more so
than for years. This check brings me back to the reflection that,
when I feel the best, I am most likely to experience one of my ill
turns; some one of which will probably end my journey in this life.
God grant me due preparation for the next!"
CHAPTER XIX.
REFLECTIONS.—LETTERS.—ACCOUNT OF
EFFORTS TO COMPLETE BUNKER HILL
MONUMENT.
In the memorandum-book of property for 1843 is found the usual
estimate and list of expenditures; after which Mr. Lawrence writes as
follows:
"My outlay for other objects than my own family, for the last
fourteen years, has been —— dollars, which sum I esteem better
invested than if in bond and mortgage in the city; and I have
reason to believe many have been comforted and assisted by it, and
its influence will be good on those who follow me. God grant me
grace to be faithful to my trust!"
On the letter written in reply to the above, Mr. Lawrence has endorsed:
"This letter from old General ——, now eighty-eight years old, and
blind, is an acknowledgment of some little kindnesses I was enabled
to render through the hand of Judge Story. It has afforded me more
pleasure than it could have done either the Judge or the General. I
am sure the good old man's feelings were gratified; and I am
thankful that I could comfort him."
On the 17th of June, 1843, took place the celebration in honor of the
completion of the Bunker Hill Monument; an event which was regarded
with no ordinary emotions by Mr. Lawrence, after so many years of
effort and expectation. His only regret was that the whole battle-field
could not have been preserved, and have remained, to use his own
words, "a field-preacher for posterity." Eleven years before this, he had
written to his son in Europe:
"If we be true to ourselves, our city is destined to be the Athens of
America, and the hallowed spots in our neighborhood to be the
objects of interest throughout all future time. In this view, I would
never permit a foot of the battle-field of Bunker Hill to be alienated;
but keep it for your great-great-grandchildren, as a legacy of
patriotism worth more than their portion of it, if covered with gold
by measure. Until you are older, I do not expect you to feel as I do
on this subject."
This would seem to be the proper place to mention a few facts in regard
to Mr. Lawrence's agency in securing the completion of the monument.
It has already been mentioned that he was one of the earliest friends of
the project to erect a monument, and, in 1825, had been placed upon
the Standing Committee of Directors, with full powers to manage the
affairs of the Association. In September, 1831, in a letter to his friend,
Dr. J. C. Warren, who himself had been one of the warmest and most
efficient advocates of the measure, he proposed to subscribe five
thousand dollars, on condition that fifty thousand dollars should be
raised within one year. The following passage occurs in that letter:
"I am of opinion that the land owned by the Bunker Hill Monument
Association, in Charlestown, will be of great value to posterity, if left
as public ground. The spot is the most interesting in the country;
and it seems to me it is calculated to impress the feelings of those
who come after us with gratitude to the people of this generation, if
we preserve it to them. The whole field contains about fifteen
acres; and, in the hope of preserving it entire, either as the
property of the State, of this city, or of any other competent body,
and with the further view of insuring the completion of the
monument, which now stands as a reproach to us, I have set apart
a larger share of my property than would be necessary, had not the
subject been presented to the public in such a manner as to
discourage future attempts at raising the necessary funds by
voluntary contribution."
The amount thus devised for the monument, in case that amount should
not be raised in other ways, was fifty thousand dollars. In June, 1832,
before the annual meeting of the Bunker Hill Monument Association, the
same offer of five thousand dollars, as first named, was renewed, with
an urgent appeal for the preservation of the land, and completion of the
monument. A movement followed this appeal, but was not successful. In
April, 1833, Mr. Lawrence proposed to the Massachusetts Charitable
Mechanic Association to attempt the raising of fifty thousand dollars, to
be secured within three months, for completing the monument and
preserving the field; accompanying the proposition was an offer of five
thousand dollars, or ten per cent. on any less sum that might be raised,
as a donation to the Association. A public meeting was held in Faneuil
Hall in response to this proposition, at which Hon. Edward Everett made
a most powerful appeal, which produced so great an effect upon his
auditors that the object was considered as accomplished. The effort was
again unsuccessful. Early in 1839, Mr. Lawrence addressed a letter to
George Darracott, Esq., President of the Mechanic Association, in which,
after expressing regret that his feeble and precarious health would not
permit him to make personal application to the citizens of Boston, he
adds:
"Wednesday evening.
"My dear Sir: I have just received your very kind and grateful letter,
with its cheering enclosure of a hundred dollars towards an object
which engrosses me much just now. Thank you, dear sir, most truly,
for your kindness, and the first fruits of Boston, for I came only to-
day. I trust the ingathering will not dispossess the first ripe sheaf.
Coming from one not of my own church, it is the more kind and
grateful. O, sir! if God shall so bless my present effort as to send
me home with the sum I seek, I shall know a freedom of mind from
care and anxiety such as I have not experienced for many years,
during which our present crisis has been anticipated. I shall have
great pleasure in riding with you, according to your note to Mr. R.
To-morrow will probably be a day of more leisure to me than any
other while I shall be in Boston.
"Yours, very truly and respectfully,
"Charles P. McIlvaine."
Twelve days after, he writes to the same gentleman for another supply;
the sum already received not having been sufficient apparently to carry
him through the year:
The following letter from Judge Story was received at about the time the
preceding letter was written; but no memorandum is found by which to
ascertain the occasion which called it forth. It may be that he had been
made the channel, as was the case a few months before, of some
donation to a third person; a mode which Mr. Lawrence often adopted
when he felt a delicacy in proffering direct aid to some one whose
sensitiveness might be wounded in receiving assistance from a
comparative stranger:
Mr. Lawrence closes the year 1843 by a review of his temporal affairs,
and by fresh resolutions of fidelity to his trusts. He then gives an
estimate of his income and expenditures, showing a somewhat large
excess of the latter, though, as he says, from the state of the times, not
to the detriment of his property.
The acquaintance was renewed, and an intimacy ensued, which was not
only the cause of much happiness to Mr. Lawrence through the
remainder of his life, but was also the means of directing his attention to
the wants of Williams College, of which he eventually became the
greatest benefactor. An active and constant correspondence followed
this acquaintance, and was so much prized by Mr. Lawrence that he had
most of the letters copied, thereby filling several volumes, from which
extracts will from time to time be made. In one of his first letters to that
gentleman, dated May 11, he says:
"Dear President: You know the phrase 'Such a man's head is full of
notions' has a meaning that we all understand to be not to his
credit for discretion, whatever else may be said of him. As I propose
throwing in a caveat against this general meaning, I proceed to
state my case. And, firstly, President H. is made debtor to the
Western Railroad Corporation for the transportation of a barrel to
Pittsfield. The bill is receipted, so that you can have the barrel to-
morrow by sending for it; which barrel contains neither biscuit nor
flour, but the clay image of your friend. In the head are divers
notions that my hand fell upon as I was preparing it for the jaunt;
and, when the head was filled with things new and old, I was
careful to secure the region under the shoulders, especially on the
left side, and near the heart, by placing there that part of a lady's
dress which designates a government that we men are unwilling
openly to acknowledge, but is, withal, very conservative. Within its
folds I wrapped up very securely 'Pilgrim's Progress,' and stuffed
the empty space between my shoulders, and near my heart, brim
full, I hope my young friend will find a motive and a moral in the
image and in the book, to cheer him on in his pilgrimage of life."
On the same day with the above entry in his diary occurs another, in
which he alludes to assistance afforded to some young persons in
Brattle-street Church,—"sons of Brattle-street, and, as such, assisted by
me." Mr. Lawrence's early religious associations were connected with
this church, where, it is believed, he attended from the first Sunday
after his coming to Boston. With such associations, and connected as
they were with the most endeared recollections of those who had
worshipped there with him in early days, all that pertained to this
venerable church possessed a strong and abiding interest. In this
connection is quoted the beautiful testimony of his pastor, the Rev. Dr.
Lothrop, furnished in the funeral sermon delivered by him, where he
speaks of Mr. Lawrence's love for the church, as well as of his religious
character:
"I have your letter and package; the cold of this morning will make
the articles doubly acceptable to the shivering and sick poor among
us. J. C.'s case is one for sympathy and relief. Engage to supply him
a hundred dollars, which I will hand to you when you visit me; and
tell the poor fellow to keep in good heart, for our merciful Father
afflicts in love, and thus I trust that this will prove a stepping-stone
to the mansions of bliss. I shall never cease to remember with
interest the veterans of the A. F. Co. How are my friends B. and
others of early days? Also, how is old father F.? Does he need my
warm outside coat, when I get supplied with a better?
"After your call upon me a few weeks since, I went back in memory
to scenes of olden times, which had an interest that you can
sympathize in, and which I intended to express to you before this;
but I have had one of those admonitory ill turns since, that kept me
under the eye of the doctor for a number of days.
"In reviewing my beginnings in manufacturing, under your
recommendation and care, almost a quarter of a century ago, I can
see the men, the machines, the wheel-pit, and the speed-gauge,
and especially I can see our old friend W. lying on the bottom of the
pit, lamp in hand, with his best coat on, eying the wheels and cogs
as an astronomer makes observations in an observatory. All these
scenes are as fresh in my memory as though seen but yesterday.
"Do you remember C. B., the brother of J. and G. B.? All three of
whom were business men here at the time you were, and all were
unfortunate. C. tried his; hand in ——, and did not succeed there;
returned to this country, and settled on a tract of land in ——,
where he has been hard at work for ten years, and has maintained
his family. His wife died a few months since. One after another of
his family sickened, and he became somewhat straitened, and knew
not what to do. He wrote to an old business friend, who was his
debtor, and who had failed, had paid a part only, and was
discharged thirty years ago, and who has since been prosperous.
He stated his case, and asked me to say a good word for him. That
person sent one half, and I sent the other half, the day before
Thanksgiving. It will reach him on Monday next, and will make his
eyes glisten with joy.
"Remember me to Capt. —— and J. C, and B., and any other of the
veterans."
Sept. 23, Mr. Lawrence receives from an old debtor, once a clerk in his
establishment, a check for five hundred dollars, which a sense of justice
had induced him to send, though the debt of some thousands had been
long since legally discharged. On receiving it, he writes, in a
memorandum at the bottom of the letter received, to his brother and
partner:
ebookbell.com