100% found this document useful (1 vote)
19 views

Dynamic System Modelling and Analysis with MATLAB and Python 1st Edition Jongrae Kim - The ebook with rich content is ready for you to download

The document is a promotional overview of the book 'Dynamic System Modelling and Analysis with MATLAB and Python' by Jongrae Kim, aimed at control engineers. It includes links to download the book and other related eBooks, along with a brief description of the book's content and intended audience. The book covers various topics in dynamic system modeling and analysis using MATLAB and Python, assuming a foundational knowledge in mathematics and programming.

Uploaded by

seluqensani
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
19 views

Dynamic System Modelling and Analysis with MATLAB and Python 1st Edition Jongrae Kim - The ebook with rich content is ready for you to download

The document is a promotional overview of the book 'Dynamic System Modelling and Analysis with MATLAB and Python' by Jongrae Kim, aimed at control engineers. It includes links to download the book and other related eBooks, along with a brief description of the book's content and intended audience. The book covers various topics in dynamic system modeling and analysis using MATLAB and Python, assuming a foundational knowledge in mathematics and programming.

Uploaded by

seluqensani
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/ 78

Read Anytime Anywhere Easy Ebook Downloads at ebookmeta.

com

Dynamic System Modelling and Analysis with MATLAB


and Python 1st Edition Jongrae Kim

https://ebookmeta.com/product/dynamic-system-modelling-and-
analysis-with-matlab-and-python-1st-edition-jongrae-kim/

OR CLICK HERE

DOWLOAD EBOOK

Visit and Get More Ebook Downloads Instantly at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Environmental Data Analysis with MatLab or Python:


Principles, Applications, and Prospects 3rd Edition
William Menke
https://ebookmeta.com/product/environmental-data-analysis-with-matlab-
or-python-principles-applications-and-prospects-3rd-edition-william-
menke/
ebookmeta.com

Python for MATLAB Development: Extend MATLAB with 300,000+


Modules from the Python Package Index Danial

https://ebookmeta.com/product/python-for-matlab-development-extend-
matlab-with-300000-modules-from-the-python-package-index-danial/

ebookmeta.com

Fiber Lasers: Fundamentals with MATLAB Modelling 1st


Edition Johan Meyer (Editor)

https://ebookmeta.com/product/fiber-lasers-fundamentals-with-matlab-
modelling-1st-edition-johan-meyer-editor/

ebookmeta.com

Soil Health Soil Biology Soilborne Diseases and


Sustainable Agriculture A Guide 1st Edition Graham
Stirling
https://ebookmeta.com/product/soil-health-soil-biology-soilborne-
diseases-and-sustainable-agriculture-a-guide-1st-edition-graham-
stirling/
ebookmeta.com
Infinity RPG Adventures in the Human Sphere 1st Edition
Justin Alexander

https://ebookmeta.com/product/infinity-rpg-adventures-in-the-human-
sphere-1st-edition-justin-alexander/

ebookmeta.com

Mothering, Public Leadership, and Women's Life Writing :


Explorations in Spirituality Studies and Practical
Theology 1st Edition Claire Wolfteich
https://ebookmeta.com/product/mothering-public-leadership-and-womens-
life-writing-explorations-in-spirituality-studies-and-practical-
theology-1st-edition-claire-wolfteich/
ebookmeta.com

Hell and Heaven Wayfinding 2 1st Edition Hugh Howey

https://ebookmeta.com/product/hell-and-heaven-wayfinding-2-1st-
edition-hugh-howey/

ebookmeta.com

Bitty Fish Barbara Derubertis Eva Vagreti Cockrille

https://ebookmeta.com/product/bitty-fish-barbara-derubertis-eva-
vagreti-cockrille/

ebookmeta.com

The Peoples of Greater Unyamwezi Tanzania Nyamwezi Sukuma


Sumbwa Kimbu Konongo East Central Africa Part XVII
Ethnographic Survey of Africa 1st Edition R G Abrahams
https://ebookmeta.com/product/the-peoples-of-greater-unyamwezi-
tanzania-nyamwezi-sukuma-sumbwa-kimbu-konongo-east-central-africa-
part-xvii-ethnographic-survey-of-africa-1st-edition-r-g-abrahams/
ebookmeta.com
Tras el llamado 1st Edition Javier De La Vega Alfaro

https://ebookmeta.com/product/tras-el-llamado-1st-edition-javier-de-
la-vega-alfaro/

ebookmeta.com
Dynamic System Modelling and Analysis with MATLAB and Python
IEEE Press
445 Hoes Lane
Piscataway, NJ 08854

IEEE Press Editorial Board


Sarah Spurgeon, Editor in Chief

Jón Atli Benediktsson Andreas Molisch Diomidis Spinellis


Anjan Bose Saeid Nahavandi Ahmet Murat Tekalp
Adam Drobot Jeffrey Reed
Peter (Yong) Lian Thomas Robertazzi
Dynamic System Modelling and Analysis
with MATLAB and Python

For Control Engineers

Jongrae Kim
University of Leeds
Leeds, UK

IEEE Press Series on Control Systems Theory and Applications


Maria Domenica Di Benedetto, Series Editor
Copyright © 2023 by The Institute of Electrical and Electronics Engineers, Inc. All rights
reserved.

Published by John Wiley & Sons, Inc., Hoboken, New Jersey.


Published simultaneously in Canada.

No part of this publication may be reproduced, stored in a retrieval system, or transmitted in any
form or by any means, electronic, mechanical, photocopying, recording, scanning, or otherwise,
except as permitted under Section 107 or 108 of the 1976 United States Copyright Act, without
either the prior written permission of the Publisher, or authorization through payment of the
appropriate per-copy fee to the Copyright Clearance Center, Inc., 222 Rosewood Drive, Danvers,
MA 01923, (978) 750-8400, fax (978) 750-4470, or on the web at www.copyright.com. Requests to
the Publisher for permission should be addressed to the Permissions Department, John Wiley &
Sons, Inc., 111 River Street, Hoboken, NJ 07030, (201) 748-6011, fax (201) 748-6008, or online at
http://www.wiley.com/go/permission.

Limit of Liability/Disclaimer of Warranty: While the publisher and author have used their best
efforts in preparing this book, they make no representations or warranties with respect to the
accuracy or completeness of the contents of this book and specifically disclaim any implied
warranties of merchantability or fitness for a particular purpose. No warranty may be created or
extended by sales representatives or written sales materials. The advice and strategies contained
herein may not be suitable for your situation. You should consult with a professional where
appropriate. Further, readers should be aware that websites listed in this work may have
changed or disappeared between when this work was written and when it is read. Neither the
publisher nor author shall be liable for any loss of profit or any other commercial damages,
including but not limited to special, incidental, consequential, or other damages.
For general information on our other products and services or for technical support, please
contact our Customer Care Department within the United States at (800) 762-2974, outside the
United States at (317) 572-3993 or fax (317) 572-4002.
Wiley also publishes its books in a variety of electronic formats. Some content that appears in
print may not be available in electronic formats. For more information about Wiley products,
visit our web site at www.wiley.com.

Library of Congress Cataloging-in-Publication Data Applied for:

Hardback: 9781119801627

Cover Design: Wiley


Cover Images: © Bocskai Istvan/Shutterstock

Set in 9.5/12.5pt STIXTwoText by Straive, Chennai, India


To Miyoung
vii

Contents

Preface xiii
Acknowledgements xv
Acronyms xvii
About the Companion Website xix

1 Introduction 1
1.1 Scope of the Book 1
1.2 Motivation Examples 2
1.2.1 Free-Falling Object 2
1.2.1.1 First Program in Matlab 4
1.2.1.2 First Program in Python 10
1.2.2 Ligand–Receptor Interactions 14
1.3 Organization of the Book 21
Exercises 21
Bibliography 22

2 Attitude Estimation and Control 23


2.1 Attitude Kinematics and Sensors 23
2.1.1 Solve Quaternion Kinematics 26
2.1.1.1 MATLAB 26
2.1.1.2 Python 29
2.1.2 Gyroscope Sensor Model 33
2.1.2.1 Zero-Mean Gaussian White Noise 33
2.1.2.2 Generate Random Numbers 34
2.1.2.3 Stochastic Process 40
2.1.2.4 MATLAB 41
2.1.2.5 Python 45
2.1.2.6 Gyroscope White Noise 49
2.1.2.7 Gyroscope Random Walk Noise 50
2.1.2.8 Gyroscope Simulation 53
viii Contents

2.1.3 Optical Sensor Model 57


2.2 Attitude Estimation Algorithm 64
2.2.1 A Simple Algorithm 64
2.2.2 QUEST Algorithm 65
2.2.3 Kalman Filter 66
2.2.4 Extended Kalman Filter 75
2.2.4.1 Error Dynamics 76
2.2.4.2 Bias Noise 77
2.2.4.3 Noise Propagation in Error Dynamics 78
2.2.4.4 State Transition Matrix, Φ 84
2.2.4.5 Vector Measurements 84
2.2.4.6 Summary 86
2.2.4.7 Kalman Filter Update 86
2.2.4.8 Kalman Filter Propagation 87
2.3 Attitude Dynamics and Control 88
2.3.1 Dynamics Equation of Motion 88
2.3.1.1 MATLAB 91
2.3.1.2 Python 94
2.3.2 Actuator and Control Algorithm 95
2.3.2.1 MATLAB Program 98
2.3.2.2 Python 101
2.3.2.3 Attitude Control Algorithm 103
2.3.2.4 Altitude Control Algorithm 105
2.3.2.5 Simulation 106
2.3.2.6 MATLAB 107
2.3.2.7 Robustness Analysis 107
2.3.2.8 Parallel Processing 110
Exercises 113
Bibliography 115

3 Autonomous Vehicle Mission Planning 119


3.1 Path Planning 119
3.1.1 Potential Field Method 119
3.1.1.1 MATLAB 122
3.1.1.2 Python 126
3.1.2 Graph Theory-Based Sampling Method 126
3.1.2.1 MATLAB 128
3.1.2.2 Python 129
3.1.2.3 Dijkstra’s Shortest Path Algorithm 130
3.1.2.4 MATLAB 130
3.1.2.5 Python 131
Contents ix

3.1.3 Complex Obstacles 134


3.1.3.1 MATLAB 135
3.1.3.2 Python 141
3.2 Moving Target Tracking 145
3.2.1 UAV and Moving Target Model 145
3.2.2 Optimal Target Tracking Problem 148
3.2.2.1 MATLAB 149
3.2.2.2 Python 151
3.2.2.3 Worst-Case Scenario 153
3.2.2.4 MATLAB 157
3.2.2.5 Python 159
3.2.2.6 Optimal Control Input 164
3.3 Tracking Algorithm Implementation 167
3.3.1 Constraints 167
3.3.1.1 Minimum Turn Radius Constraints 167
3.3.1.2 Velocity Constraints 169
3.3.2 Optimal Solution 172
3.3.2.1 Control Input Sampling 172
3.3.2.2 Inside the Constraints 175
3.3.2.3 Optimal Input 177
3.3.3 Verification Simulation 180
Exercises 182
Bibliography 182

4 Biological System Modelling 185


4.1 Biomolecular Interactions 185
4.2 Deterministic Modelling 185
4.2.1 Group of Cells and Multiple Experiments 186
4.2.1.1 Model Fitting and the Measurements 188
4.2.1.2 Finding Adaptive Parameters 190
4.2.2 E. coli Tryptophan Regulation Model 191
4.2.2.1 Steady-State and Dependant Parameters 194
4.2.2.2 Padé Approximation of Time-Delay 195
4.2.2.3 State-Space Realization 196
4.2.2.4 Python 205
4.2.2.5 Model Parameter Ranges 206
4.2.2.6 Model Fitting Optimization 213
4.2.2.7 Optimal Solution (MATLAB) 221
4.2.2.8 Optimal Solution (Python) 223
4.2.2.9 Adaptive Parameters 226
4.2.2.10 Limitations 226
x Contents

4.3 Biological Oscillation 227


4.3.1 Gillespie’s Direct Method 231
4.3.2 Simulation Implementation 234
4.3.3 Robustness Analysis 241
Exercises 245
Bibliography 246

5 Biological System Control 251


5.1 Control Algorithm Implementation 251
5.1.1 PI Controller 251
5.1.1.1 Integral Term 252
5.1.1.2 Proportional Term 253
5.1.1.3 Summation of the Proportional and the Integral Terms 253
5.1.1.4 Approximated PI Controller 253
5.1.1.5 Comparison of PI Controller and the Approximation 254
5.1.2 Error Calculation: ΔP 260
5.2 Robustness Analysis: 𝜇-Analysis 269
5.2.1 Simple Examples 269
5.2.1.1 𝜇 Upper Bound 272
5.2.1.2 𝜇 Lower Bound 275
5.2.1.3 Complex Numbers in MATLAB/Python 278
5.2.2 Synthetic Circuits 280
5.2.2.1 MATLAB 281
5.2.2.2 Python 281
5.2.2.3 𝜇-Upper Bound: Geometric Approach 290
Exercises 291
Bibliography 292

6 Further Readings 295


6.1 Boolean Network 295
6.2 Network Structure Analysis 296
6.3 Spatial-Temporal Dynamics 297
6.4 Deep Learning Neural Network 298
6.5 Reinforcement Learning 298
Bibliography 298

Appendix A Solutions for Selected Exercises 301


A.1 Chapter 1 301
Exercise 1.4 301
Exercise 1.5 301
Contents xi

A.2 Chapter 2 302


Exercise 2.5 302
A.3 Chapter 3 302
Exercise 3.1 302
Exercise 3.6 303
A.4 Chapter 4 303
Exercise 4.1 303
Exercise 4.2 303
Exercise 4.7 304
A.5 Chapter 5 304
Exercise 5.2 304
Exercise 5.3 304

Index 307
xiii

Preface

This book is for control engineers to learn dynamic system modelling and sim-
ulation and control design and analysis using MATLAB or Python. The readers
are assumed to have the undergraduate final-year level of knowledge on ordinary
differential equations, vector calculus, probability, and basic programming.
We have verified all the MATLAB and Python codes in the book using MATLAB
R2021a and Python 3.8 in Spyder, the scientific Python development environment.
To reduce the confusion in running a particular program, most of the programs are
independent on their own. Organizing programming with multiple files is left as
an advanced skill for readers to learn after reading this book.

Leeds, West Yorkshire, England, UK Jongrae Kim


30 November 2021
xv

Acknowledgements

I have learned dynamic modelling and simulation through my undergraduate


and post-graduate education and research projects in the past 30 years. Hence,
this book will not be possible without having my teachers, supervisors, and
collaborators. I thank Dr Jinho Kim, Professor John L. Crassidis, Professor
João P. Hespanhna, Professor Declan G. Bates, Dr Daizhan Cheng, Professor
Kwang-Hyun Cho, Professor Frank Pollick, and Dr Rajeev Krishnadas.

Jongrae Kim
xvii

Acronyms

DCM direction cosine matrix


DNA deoxyribonucleic acid
EKF extended Kalman filter
KF Kalman filter
LHS left-hand side
LTI linear time-invariant
mRNA messenger RNA
mRNAP messenger RNA polymerase
N2L Netwton’s second law of motion
ODE ordinary differential equation
pdf probability density function
PI proportional integral
QUEST quaternion estimation algorithm
RHS right-hand side
RNA ribonucleic acid
xix

About the Companion Website

This book is accompanied by a companion website.

www.wiley.com/go/kim/dynamicmodeling

This website includes:


● The solutions for the problems listed in the chapters and the program codes used
in Python and MATLAB softwares.
1

Introduction

1.1 Scope of the Book

This book is for advanced undergraduate students, post-graduate students, or engi-


neers to acquire programming skills for dynamic system modelling and analysis
using control theory. The readers are assumed to have a basic understanding of
computer programming, ordinary differential equations (ODE), vector calculus,
and probability.
Most engineering curricula at the undergraduate level include only an
elementary-level programming course in the early of the undergraduate years.
Only a handful of self-motivated engineering students acquire advanced level
programming skills mainly from self-study through tedious time-consuming
practices and trivial mistakes. As modern engineering systems such as aircraft,
satellite, automobile, or autonomous robots are implemented through inseparable
tight integration of hardware systems and software algorithms, the demand for
engineers having fluent skills in dynamic system modelling and algorithm design
is increasing. In addition, the emergence of interdisciplinary areas merging the
experimental domain with mathematical and computational approaches such
as systems biology, synthetic biology, or computational neuroscience further
increases the necessity of the engineers who understand dynamics and are
capable of computational implementations of dynamic models.
This book aims to fill the gap in learning practical dynamic modelling, simu-
lation, and analysis skills in aerospace engineering, robotics, and biology. Learn-
ing programming in the engineering or biology domain requires not only domain
knowledge but also a robust conceptual understanding of algorithm design and
implementation. It is not, of course, the skills to learn in 14 days or less as many
online courses claim. To be confident in dynamic system modelling and analysis
takes more than several years of practice and dedication. This book provides the
starting point of the long journey for the readers to equip and prepare better for
real engineering and scientific problems.
Dynamic System Modelling and Analysis with MATLAB and Python: For Control Engineers,
First Edition. Jongrae Kim.
© 2023 The Institute of Electrical and Electronics Engineers, Inc. Published 2023 by John Wiley & Sons, Inc.
Companion Website: www.wiley.com/go/kim/dynamicmodeling
2 1 Introduction

1.2 Motivation Examples


1.2.1 Free-Falling Object
Newton’s second law of motion is given by
∑ d
Fi = (m𝑣) (1.1)
i
dt
where Fi is the i-th external force in Newtons (N) acting on the object characterized
by the mass, m, in kg, d∕dt is the time derivative, t is the time in seconds, 𝑣 is the
velocity in m/s, and m𝑣 is the momentum of the object. Newton’s second law states
that the sum of all external forces is equal to the momentum change per unit of time.
Consider a free-falling object shown in Figure 1.1. There exists only one exter-
nal force, i.e. the gravitational force acting downwards in the figure. Hence, the

left-hand side of (1.1) is simply given by i Fi = Fg , where Fg is the gravitational
force. Introduce the additional assumption that the object is within the reasonable
range from the sea level. With the assumption, the gravitational force, Fg , is known
to be proportional to the mass, and the proportional constant is the gravitational
acceleration constant, g, which is equal to 9.81 m/s2 in the sea level. Therefore,

Fg = mg. Replace the left-hand side of (1.1), i.e. i Fi , by Fg = mg provides
∑ d
mg = Fg = Fi = (m𝑣) (1.2)
i
dt
where the downward direction is set to the positive direction, which is the opposite
of the usual convention. It highlights that establishing a consistent coordinate system
at the beginning of modelling is vital in dynamic system simulation.

Fg

Figure 1.1 Free-falling object.


1.2 Motivation Examples 3

From the kinematic relationship between the velocity, 𝑣, and the displacement,
x, we have
dx
=𝑣
dt
where the origin of x is at the initial position of the object, m, and the positive
direction of x is downwards in the figure. The right-hand side of (1.2) becomes
( )
∑ d d dx
mg = Fg = Fi = (m𝑣) = m
i
dt dt dt
Finally, the leftmost and the rightmost terms are equal to each other as follows:
( )
d dx
mg = m
dt dt
and it is expanded as follows:
dm dx d2 x
mg = +m 2
dt dt dt
Using the short notations, ṁ = dm∕dt, ẋ = dx∕dt, and ẍ = d2 x∕dt2 , and after
rearrangements, the governing equation is given by

ẍ = g − ẋ (1.3)
m
For purely educational purposes, assume that the mass change rate is given by
ṁ = −m + 2 (1.4)
We can identify now that there are three independent time-varying states, which
̇ and the mass, m. All the other time-varying
are the position, x, the velocity, x,
states, for example, ẍ and m,
̇ can be expressed using the independent state vari-
ables. Define the state variables as follows:
x1 = x
x2 = ẋ
x3 = m
Obtain the time derivative of each state expressed in the state variable as follows:
ẋ 1 = ẋ = x2 (1.5a)

−m + 2 −x + 2
ẋ 2 = ẍ = g − ẋ = g − 3 x2 (1.5b)
m x3
ẋ 3 = ṁ = −m + 2 = −x3 + 2 (1.5c)
and this is called the state-space form.
̇
Let the initial conditions be equal to x1 (0) = x(0) = 0.0 m, x2 (0) = x(0) = 0.5 m/s,
and x3 (0) = m(0) = 5 kg. Equation (1.5) can be written in a compact form using the
4 1 Introduction

matrix–vector notations. Define the state vector, x, as follows:


⎡x1 ⎤
x = ⎢x2 ⎥
⎢ ⎥
⎣x3 ⎦
and the corresponding state-space form is written as
⎡ x2 ⎤
̇x = f(x) = ⎢g + (x3 − 2)(x2 ∕x3 )⎥ (1.6)
⎢ ⎥
⎣ −x3 + 2 ⎦
The second-order differential equation, (1.3), and the first-order differential
equation, (1.4), are combined into the first-order three-dimensional vector
differential equation, (1.6). Any higher order differential equations can be
transformed into the first-order multi-dimensional vector differential equation,
ẋ = f(x). Numerical integration methods such as Runge–Kutta integration
(Press et al., 2007) solves the first-order ODE. They can solve any high-order
differential equations by transforming them into the corresponding first-order
multi-dimensional differential equation.

1.2.1.1 First Program in Matlab


We are ready to solve (1.6) with the initial condition equal to x(0) = [0.0 0.5 5.0]T ,
where the superscript T is the transpose of the vector. We solve the differen-
tial equation from t = 0 to t = 5 seconds using Matlab. Matlab includes many
numerical functions and libraries to be used for dynamic simulation and analysis.
A numerical integrator is one of the functions already implemented in Matlab.
Hence, the only task we have to do for solving the differential equation is to
learn how to use the existing functions and libraries in Matlab. The complete
programme to solve the free-falling object problem is given in Program 1.1.
Producing Figure 1.2 is left as an exercise in Exercise 1.1.

1 clear ;
2
3 g r v _ c o n s t = 9 . 8 1 ; % [m/ s ^ 2 ]
4 i n i t _ p o s = 0 . 0 ; %[m]
5 i n i t _ v e l = 0 . 5 ; % [m/ s ]
6 i n i t _ m a s s = 5 . 0 ; %[ kg ]
7
8 init_time = 0; % [ s ]
9 final_time = 5.0; % [ s ]
10 time_interval = [ init_time final_time ] ;
11
12 x0 = [ i n i t _ p o s i n i t _ v e l i n i t _ m a s s ] ;
13 [ t o u t , x o u t ] = ode45 (@( time , s t a t e ) f r e e _ f a l l i n g _ o b j ( time , s t a t e ,
g r v _ c o n s t ) , t i m e _ i n t e r v a l , x0 ) ;
14
15 f i g u r e ( 1 ) ;
16 p l o t ( t o u t , x o u t ( : , 1 ) )
17 y l a b e l ( ’ p o s i t i o n [m] ’ ) ;
1.2 Motivation Examples 5

18 x l a b e l ( ’ time [ s ] ’ ) ;
19
20 figure ( 2 ) ;
21 plot ( tout , xout ( : , 2 ) )
22 y l a b e l ( ’ v e l o c i t y [m/ s ] ’ ) ;
23 x l a b e l ( ’ time [ s ] ’ ) ;
24
25 figure ( 3 ) ;
26 plot ( tout , xout ( : , 3 ) )
27 y l a b e l ( ’m( t ) [ kg ] ’ ) ;
28 x l a b e l ( ’ time [ s ] ’ ) ;
29
30 function d x d t = f r e e _ f a l l i n g _ o b j ( time , s t a t e , g r v _ c o n s t )
31 x1 = state (1) ;
32 x2 = state (2) ;
33 x3 = state (3) ;
34
35 d x d t = zeros ( 3 , 1 ) ;
36 d x d t ( 1 ) = x2 ;
37 d x d t ( 2 ) = g r v _ c o n s t + ( x3 −2) ∗ ( x2 / x3 ) ;
38 d x d t ( 3 ) = −x3 + 2 ;
39 end

Program 1.1 (Matlab) Free-falling object

200 70
60
150
50
Velocity (m/s)
Position (m)

40
100
30

50 20
10
0 0
0 1 2 3 4 5 0 1 2 3 4 5
Time (s) Time (s)
(a) figure(1) (b) figure(2)
5

4.5

4
m(t) (kg)

3.5

2.5

2
0 1 2 3 4 5
Time (s)
(c) figure(3)

Figure 1.2 Free-falling object position, velocity, and mass time histories.
6 1 Introduction

Now, we study the first program line by line. The m-script starts with the
command ‘clear’. The clear command removes all variables in the workspace.
In the workspace, there would be some variables defined and used in previous
activities. They may have the same names but different meanings and values in
the current calculation. For example, the gravitational acceleration ‘grv_const’ in
the third line is undefined in the current program and uses a variable of the same
name used to analyse objects falling on the moon. A falling object program in
the Moon was executed earlier, and ‘grv_const’ is still in the workspace. Without
the clear command, the incorrect constant is used in the program producing
wrong results. Hence, it is recommended to clear the workspace before starting
new calculations. We must be careful, however, that the clear command erases
all variables in the workspace. Before the clear command, we check if all values,
which might be generated from a long computer simulation, were saved.
From line 3 to line 12, several constants are defined. Based on the equations we
have seen earlier, it is tempting to write a code as follows:

g = 9.81
x = 0.0
v = 0.5
t = [0 5]
x0 = [ x v m]

Program 1.2 (Matlab) Poor style constant definitions

These seem to look compact and closer to the equations we derived. It is a bad
habit to write a program in this way. The list of problems in the above programming
style is as follows:
● It defines a variable with a single character, ‘g’, ‘x’, ‘v’, etc. Using a single char-
acter variable might cause confusion on the meaning of the variable and lead to
using them in wrong places with incorrect interpretations.
● Numerical numbers are written without units. There is no indication of units of
the numerical values, e.g. 9.81, is it m/s2 or ft/s2 ?
● It uses magic numbers. What do the numbers, 0 and 5, mean in defining ‘t’?
Program 1.1 uses a better style. The initial position is defined using the variable
name, ‘init_pos’, whose value is 0.0 and the unit is in metres. Appropriately named
variables reduce mistakes and confusion in the program. Program 1.1 indicates the
corresponding unit for each numerical value, e.g. the ‘init mass’ value 5.0 is in kg.
We understand the meaning of each variable by its name. The texts after ‘%’ are
the comments, where we could add various information such as the unit of each
numerical value.
1.2 Motivation Examples 7

In line 13, the built-in Runge–Kutta integrator, ode45(), is used to integrate the
differential equation provided by the function, ‘free_falling_obj’, at the end of the
m-script. Frequently, each function is saved as a separate m-script. It could also
be included in the m-script for the cases that the functions might be used in the
specific m-script only. To include functions in the m-script, they must be placed at
the end of the m-script as in this example.
Functions in Matlab begin with the keyword function and close with the
keyword end. In line 30, ‘dxdt’ is the return variable of the function and
‘free_falling_obj’ is the function name. The function has three input arguments.
A function can have any input argument used by the function. This particular
function, ‘free_falling_obj’, is not an ordinary function, however. This is the
function to describe the ODE. The function is to be passed into the built-in
integrator, ode45. The first two arguments of the function for ode45 must be time
and states, i.e. t and x in (1.6).
In lines 31–33, the variable ‘state’ is assumed to be a three-dimensional vector,
and each element of the vector corresponds to the states, x1 , x2 , and x3 . In line 35,
the return variable ‘dxdt’ is initialized as [0 0 0] by the built-in function zeros(3,1).
zeros(m,n) creates the m × n matrix filled in zeros. Lines 36, 37, and 38 define the
state-space form ODE, (1.6).
The function works perfectly well without the initialization line for ‘dxdt’,
line 35. However, it is not good programming if line 35 is removed. Without the
initialization, ‘dxdt’ in line 36 is a one-dimensional scalar value. In the next lines,
it becomes a two-dimensional value and a three-dimensional value. Each line, the
size of ‘dxdt’ changes, and this requires the computer to find additional memory
to store the additional value. This could increase the total computation time
longer and could be noticeably longer if this function is called a million times or
more. Hence, it is better to acquire all the required memory ahead as in line 35.

Efficiency vs. development cycle: We strive to create efficient programs, but


the prototyping phase requires a fast development cycle.

It is vital to have the habit of being conscious of the efficiency of algorithm imple-
mentation. On the other hand, try not to overthink the efficiency of the program.
Script languages such as Matlab and Python are for rapid implementation and
testing. Hence, it needs a proper balance between optimizing codes and saving the
development time.
Now, we are ready to solve the differential equation using the built-in numerical
integrator, ode45. ode45 stands for ODE with Runge–Kutta fourth- and fifth-order
8 1 Introduction

methods. Details of the Runge–Kutta integration methods can be found in Press


et al. (2007).
Recall, the following line from Program 1.1:

13 [ t o u t , x o u t ] = ode45 (@( time , s t a t e ) f r e e _ f a l l i n g _ o b j ( time , s t a t e ,


g r v _ c o n s t ) , t i m e _ i n t e r v a l , x0 ) ;

When we use ode45, the input argument starts with @ symbol, which is the
function handle. The function handle, @, is used when we pass function A, e.g.
‘free_falling_obj’, to function B, e.g. ode45, where function B would call function
A multiple times. With the function handle, we can control or construct the
function to be passed with some flexibility. ‘@(time,state)’ explicitly indicates
that the function to be passed has two arguments, ‘time’ and ‘state’, and they will
be passed between ode45 and ‘free_falling_obj’ function in the specific order, i.e.
‘time’ be the first and ‘state’ be the second argument. This order is required by the
integrator, ode45.
With the function handle, we can take some freedom to order the function argu-
ments differently in the function definition of ‘free_falling_obj’. For example, we
could write the function as follows:

function d x d t = f r e e _ f a l l i n g _ o b j ( time , g r v _ c o n s t , s t a t e )
x1 = state (1) ;
x2 = state (2) ;
x3 = state (3) ;

d x d t = zeros ( 3 , 1 ) ;
d x d t ( 1 ) = x2 ;
d x d t ( 2 ) = g r v _ c o n s t + ( x3 −2) ∗ ( x2 / x3 ) ;
d x d t ( 3 ) = −x3 + 2 ;
end

and the integration part is updated to follow the updated function definition as
follows:

[ t o u t , x o u t ] = ode45 (@( time , s t a t e ) f r e e _ f a l l i n g _ o b j ( time , g r v _ c o n s t ,


s t a t e ) , t i m e _ i n t e r v a l , x0 ) ;

The program works the same as the ones before the modifications. Also, we
notice that we have an additional input argument, ‘grv_const’. Similarly, we could
add more input parameters if they are necessary. As long as the first argument,
‘time’, and the second argument, ‘state’, are indicated in the function handle, the
function can have any number of input arguments in any order to pass to the
integrator, ode45.
Once the integration is completed, the results return to two output variables,
‘tout’ and ‘xout’. Execute the command, whos, in the Matlab command prompt,
the following information is displayed:
1.2 Motivation Examples 9

>> whos
Name Size Bytes Class Attributes

final_time 1 x1 8 double
grv_const 1 x1 8 double
init_mass 1 x1 8 double
init_pos 1 x1 8 double
init_time 1 x1 8 double
init_vel 1 x1 8 double
time_interval 1 x2 16 double
tout 61 x1 488 double
x0 1 x3 24 double
xout 61 x3 1464 double

The first column shows all variables created including the two output results from
the integrator. The second column shows the size of each variable: ‘tout’ is 61
rows and 1 column and ‘xout’ is 61 rows and 3 columns. Hence, each row of ‘xout’
corresponds to the time instance of the corresponding row values of ‘tout’. Why
is the number of row 61? This is determined by the integrator automatically to
adjust the integration accuracy and computation time. We can assign the number
of rows or the number of time steps explicitly, and this is covered in the later
chapters. The three columns of ‘xout’ correspond to the state, x, x, ̇ and m. The
̇ and the last
first column of ‘xout’ is for x, the second column of ‘xout’ is for x,
column of ‘xout’ is for m.
By executing the following line in the Matlab command prompt, we can print
out all values of x(t) in the command window:

>> x o u t ( : , 1 )

where ‘:’ indicates all rows. If we want to see the values of x from the 11th row to
the 15th row, then

>> x o u t ( 1 1 : 1 5 , 1 )

Similarly, the time history of ẋ is xout(:,2) and the time history of m is xout(:,3).
The plot command in Matlab plots the results as follows:

plot ( tout , xout ( : , 1 ) )

Before plotting each figure, open a new figure window using figure(1), figure(2),
and figure(3), respectively. The label for each axis is created using the commands
xlabel and ylabel for the horizontal and the vertical axes, respectively, where each
axis must indicate what quantity and what units are used.
10 1 Introduction

1.2.1.2 First Program in Python


Program 1.3 solves the free-falling object differential equation. The program is
remarkably similar to the Matlab script in Program 1.1. There are, however, many
differences between the two languages.

1 from numpy import l i n s p a c e


2 from s c i p y . i n t e g r a t e import s o l v e _ i v p
3
4 g r v _ c o n s t = 9 . 8 1 # [m/ s ^ 2 ]
5 i n i t _ p o s = 0 . 0 # [m]
6 i n i t _ v e l = 0 . 5 # [m/ s ]
7 i n i t _ m a s s = 5 . 0 # [ kg ]
8
9 init_cond = [ init_pos , init_vel , init_mass ]
10
11 init_time = 0 # [ s ]
12 final_time = 5.0 # [ s ]
13 num_data = 100
14 t o u t = l i n s p a c e ( i n i t _ t i m e , f i n a l _ t i m e , num_data )
15
16
17 def f r e e _ f a l l i n g _ o b j ( time , s t a t e , g r v _ c o n s t ) :
18 x1 , x2 , x3 = s t a t e
19 d x d t = [ x2 ,
20 g r v _ c o n s t + ( x3 −2) ∗ ( x2 / x3 ) ,
21 −x3 + 2 ]
22 return dxd
23
24
25 sol = solve_ivp ( free_falling_obj , ( init_time , final_time ) ,
i n i t _ c o n d , t _ e v a l=t o u t , a r g s =( g r v _ c o n s t , ) )
26 x o u t = s o l . y
27
28 import m a t p l o t l i b . p y p l o t a s p l t
29 p l t . f i g u r e ( 1 )
30 p l t . p l o t ( t o u t , x o u t [ 0 , : ] )
31 p l t . y l a b e l ( ’ p o s i t i o n [m] ’ ) ;
32 p l t . x l a b e l ( ’ time [ s ] ’ ) ;
33
34 p l t . f i g u r e ( 2 ) ;
35 p l t . p l o t ( t o u t , x o u t [ 1 , : ] )
36 p l t . y l a b e l ( ’ v e l o c i t y [m/ s ] ’ ) ;
37 p l t . x l a b e l ( ’ time [ s ] ’ ) ;
38
39 p l t . f i g u r e ( 3 ) ;
40 p l t . p l o t ( t o u t , x o u t [ 2 , : ] )
41 p l t . y l a b e l ( ’m( t ) [ kg ] ’ ) ;
42 p l t . x l a b e l ( ’ time [ s ] ’ ) ;

Program 1.3 (Python) Free-falling object


1.2 Motivation Examples 11

On lines 4 through 14, the constants are defined with the proper naming and
the units indicated in the comments. In Python, comments are placed after #.
The first two lines shown are not trivial to understand for the beginners of the
Python language. Python has many packages, and each package is a collection of
functions. There are several different ways to load these functions and the first line
in the program,

1 from numpy import l i n s p a c e

shows one of the methods. from and import are the keywords in Python. It loads
the function linspace from the library called numpy. numpy is one of the scien-
tific and engineering libraries and includes many useful functions such as matrix
manipulations, and maths functions.

Numpy vs. scipy: The two packages are very similar and have many common
functions. The execution speed of numpy is faster than scipy; in general, as
numpy is written in C-language while scipy is written in Python. Scipy, how-
ever, has more specialized functions, which are not implemented in numpy.

We might wonder why each function is manually loaded before it is used, unlike
in Matlab. This is one of the design principles of the Python language. If all func-
tions are pre-loaded or they are automatically searched and loaded when they are
used, then the search time or the size of the memory storing the function lists is
long or larger. Hence, it is more efficient to load the functions manually when they
are used.
The function linspace has three input arguments, for example, line 14 generates
an array of numerical values starting from the initial time, 0.0, to the final time,
5.0, whose number of elements is equal to ‘num data’, 100. Unlike the integrator
in Matlab, the Python integrator, discussed shortly later, needs the explicit time
lists as one of the input arguments.
In the second line, the numerical integrator, solve_ivp, is loaded

2 from s c i p y . i n t e g r a t e import s o l v e _ i v p

This is slightly different from the way to load a function shown in the first line.
scipy is another science and engineering function library. Some library divides the
functions in the library into several categories. integrate is one of the categories in
the scipy library. To access the functions under the category, integrate, the period is
used after the library name, i.e. scipy.integrate. The numerical integrator, solve_ivp,
12 1 Introduction

is defined in the integrate category of the scipy library. If we try to load the function
using from scipy import solve_ivp, it cannot find the integrator and generates an
import error.
The ODE are defined between lines 17 and 22. The first line of the function
definition begins with the keyword, ‘def’, the function name, ‘free_falling_obj’,
the three input arguments, and the colon, ‘:’ as follows:

def f r e e _ f a l l i n g _ o b j ( time , s t a t e , g r v _ c o n s t ) :

In general, the function to be defined could have any input arguments. The func-
tion to be passed to solve_ivp, however, must have the first two input arguments,
time and state, in this order. solve_ivp assumes that the first arguments and the sec-
ond argument of the function passed are t and x in ẋ = dx∕dt in (1.6). The main
body of the function is between the line below the function heading and the return
line. Those lines that belong to the main part of the function are indented. The
indentation in Python is not a decoration to simply improve the readability as in
many other programming languages. The indentation in Python is the way to indi-
cate which lines belong to the function body. The following is the first line of the
function body:

x1 , x2 , x3 = s t a t e

where ‘state’ is presumed to have three elements, and they are assigned to the three
new variables on the left-hand side of the equal sign, ‘x1’, ‘x2’, and ‘x3’. Instead of
unpacking the three elements one by one, it unpacks all the three elements in
one line.
‘dxdt’ is the list element in Python. In the list, each element is separated by the
comma, ‘,’. Finally, ‘dxdt’ becomes the return value of the function by the keyword,
return, and the function is passed to the integrator, solve_ivp.
The first input argument of the integrator is the function name describing the
ODE. The second one is the integration time interval. The third one is the initial
condition. ‘t eval’ is the list of time points, where the solution, x(t), is stored to the
output of the integrator. The last one is the arguments, whose name is reserved by
args. As the function ‘free_falling_obj’ has the additional input variable apart from
the time and the state, i.e. ‘grv_const’, this value must be sent to ‘solve_ivp’. args
is the input variable of ‘solve_ivp’ to pass additional input variables. ‘grv const’
is passed to the integrator by ‘arg=(grv const,)’. The data type of args is a tuple.
(1.3, 4.2, 4.3) or (1.3, 2.3) is a tuple. When there is only one element in a tuple, for
example, (1.2,), the comma at the end must not be omitted. (1.2) is interpreted as
floating-point 1.2, not a tuple. To make it a tuple, it must be (1.2,). Hence, there is
the comma after ‘grv const’ in ‘args=(grv const,)’.
1.2 Motivation Examples 13

Similar to Matlab, typing ‘whos’ at the command prompt in Python prints out
the following list to the screen:

Variable Type Data / I n f o


−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−
final_time float 5.0
free_falling_obj function <function f re e_fa lling_ob j
grv_const float 9.81
init_cond list n=3
init_mass float 5.0
init_pos float 0.0
init_time int 0
init_vel float 0.5
linspace function <function linspace at 0 x7f
num_data int 100
plt module <module ’ m a t p l o t l i b . p y p l o < . . .
sol OdeResult message : ’ The s o l v e r su< .
solve_ivp function <function solve_ivp at 0 x7f
tout ndarray 1 0 0 : 100 elems , type ‘ f l o a t 6 4 ‘ ,
xout ndarray 3 x100 : 300 elems , type ‘ f l o a t 6 4

The solution of the ODE is stored in ‘sol’, whose type is OdeResult, and it includes
various information about the integration results. Typing ‘sol’ in the command
prompt and hitting enter shows what variables are in ‘sol’. We can access x(t)
through ‘sol.y’. To avoid keep adding the dot to access x(t) inside ‘sol’, create a
new variable, ‘xout’, and store ‘sol.y’ into ‘xout’. We can also see from the variable
̇
list that the size of ‘xout’ is 3 ×100. Each of the rows corresponds to x(t), x(t), and
m(t), respectively.
To plot the results, a plotting library must be loaded. matplotlib is the most
widely used plotting library in Python. More specifically, plot functions under
matplotlib.pyplot category are the most frequently used. Load the functions as
follows:

import m a t p l o t l i b . p y p l o t

The way to access the functions under a specific category is using the dot next to
the package name. matplotlib.pyplot means that we want to access the functions
under the sub-category called pyplot in matplotlib instead of loading all functions
in matplotlib. Now, we can use the plot command in pyplot as follows:

m a t p l o t l i b . pyplot . p l o t ( tout , xout [ 0 , : ] )

This is inconvenient as the name becomes very long. To reduce the length of the
name, pyplot is loaded as follows:

import m a t p l o t l i b . p y p l o t a s p l t
14 1 Introduction

After the keyword as, any convenient name we would call it could be used. By
convention or almost standard, matplotlib.pyplot is called ‘plt’. Hence, the long
name to call ‘plot’ is shortened to

p l t . p l o t ( tout , xout [ 0 , : ] )

This plots x(t) vs. time t. Unlike Matlab, array indices in Python start at 0, not 1.
The first row of ‘xout’ is ‘xout[0,:]’, the second row of ‘xout’ is ‘xout[1,:]’, and so
forth. xlabel and ylabel commend work the same way as the ones in Matlab.

1.2.2 Ligand–Receptor Interactions


Ligand–receptor interactions are one of the most common interactions in
biomolecular systems. As shown in Figure 1.3, the ligands, L, bind to the recep-
tors, R, which spread on the cell boundary, form the ligand–receptor complex,
C, and the complex evokes further reactions through various cascade signalling
pathways inside the cell. L is produced with the rate given by a function of time,
f (t). From the control point of view, f (t) is considered as the input, R is the internal
state, and the concentration of C is the output of the ligand–receptor interactions.
The following molecular interactions describe the interactions between L, R, C,
and f (t):
kon
R + L −−−→ C (1.7a)
koff
C −−−→ R + L (1.7b)
kt
R −−→ ∅ (1.7c)
ke
C −−→ ∅ (1.7d)
1
f(t) −−→ L (1.7e)
1
QR −−→ R (1.7f)

Ligand (L)

Receptor (R)

Ligand–receptor complex (C)

Extra-cellular
Cell membrane
Intra-cellular

Figure 1.3 Ligand–receptor interactions form ligand–receptor complex.


1.2 Motivation Examples 15

where kon and koff are the reaction rates of binding or unbinding the receptor and
the ligand, R and L, respectively, to form or destroy the complex, C, the receptor
is destroyed with the rate of kt , the complex is also destroyed with the rate of ke ,
f (t) is the stimulus that produces the ligand at the unit rate, and QR is the internal
receptor generation at the unit rate.
We derive a set of ODE using the molecular interactions. To this end, we intro-
duce the following two assumptions:
● All the molecules and the sources are uniformly distributed in the reaction space
● There are a sufficient number of molecules for every molecular species to con-
sider concentration alone.
The first assumption makes the modelling being ODE. Otherwise, partial differen-
tial equations with the spatial coordinates are solved. Solving partial differential
equations is computationally a lot more challenging than solving ODE. The sec-
ond assumption indicates that the population of each molecular species is far away
from 0. The randomness of molecular interactions and the integer nature of the
number of molecules are ignored in the modelling.
Molecular interactions are stochastic. The probability of the occurrence
of each reaction is calculated in stochastic simulations. We will discuss the
details of stochastic modelling and simulation in the later chapter. On the other
hand, deterministic simulations are performed by assuming a large number
of molecules. The average molecular numbers show deterministic trajectories,
where the random fluctuations are negligible.
Consider the receptor, R, which is directly involved in the three reactions. L
binds to R and becomes C in (1.7a). The concentration of R is decreased by this
reaction. The change rate is proportional to the concentrations of R and L as fol-
lows:
d[R]
∝ −[R] × [L] (1.8)
dt
where [⋅] is the concentration of the molecules. The proportional constant is given
by kon in the reaction. The concentration unit is nanomolar (nM). Molar is equal
to N∕(NA V), where N is the number of molecules, NA is Avogadro’s number equal
to 6.022 × 1023 , and V is the reaction space volume in litres.
In (1.7b), C is decomposed into R and L. The concentration of R is increased
by this reaction. The decreasing rate is proportional to the concentration of C as
follows:
d[R]
∝ [C] (1.9)
dt
where the proportional constant is koff . The receptor is destroyed by itself at the
rate of kt as follows:
d[R]
∝ −[R] (1.10)
dt
16 1 Introduction

Finally, in (1.7f), R is created at the rate of QR :


d[R]
∝ [QR ] (1.11)
dt
where the proportional constant is 1.
Combining (1.8)–(1.11) as follows: Shankaran et al. (2007)
d[R]
= −kon [R][L] + koff [C] − kt [R] + [QR ] (1.12)
dt
Similarly, the following differential equations are established for L and C:
d[L]
= −kon [R][L] + koff [C] + [f (t)] (1.13a)
dt
d[C]
= kon [R][L] − koff [C] − ke [C] (1.13b)
dt
where koff = 0.24 [1/min], kon = 0.0972 [1/(min nM)], kt = 0.02 [1/min], ke = 0.15
[1/min], and [f (t)] = 0.0 [nM/min], i.e. no external stimulation. The values are the
ones for the epidermal growth factor receptor (EGFR), which plays an important
role in understanding tumour formation and growth.
Because of QR in d[R]∕dt, R would increase to infinity, which does not coin-
cide with the reality as there would be the possible maximum number of receptors
to be present in the cell. It is known that the maximum number of receptors for
the EGFR is around 100,000 (Wee and Wang, 2017, Carpenter and Cohen, 1979).
As the volume of the reaction space is given by 4 × 10−10 𝓁 in Shankaran et al.
(2007), the maximum concentration of R is 10, 000∕(NA V) ≈ 0.415 nM. We model
QR as follows:
{
0.0166 [nM/min], for [R] ≤ [R]max
[QR ] = (1.14)
0, otherwise
where [R]max is equal to 0.415 nM.
The initial conditions for the following simulation are set as follows: [R(0)] =
0.1 nM, [L(0)] = 0.0415 nM, and [C(0)] = 0 nM. In biomolecular network simu-
lations, we must confirm that the molecular quantities such as the number of
molecules or the concentrations must be non-negative. [C] at the beginning of the
simulation could become negative if the time rate is negative. In the above initial
conditions, [C] is strictly increasing because d[C(0)]∕dt = kon [R(0)][L(0)] is posi-
tive at the beginning. As we can see from (1.13b), d[C]∕dt is only negative when
[C] is high enough, i.e. [C] > kon [R][L]∕(koff + ke ).
The Matlab script to simulate the EGFR concentration kinetics is given in
Program 1.4.
1.2 Motivation Examples 17

1 clear ;
2
3 i n i t _ r e c e p t o r = 0 . 1 ; % [nM]
4 i n i t _ l i g a n d = 0 . 0 4 1 5 ; %[nM]
5 i n i t _ c o m p l e x = 0 . 0 ; %[ kg ]
6
7 i n i t _ t i m e = 0 ; % [ min ]
8 f i n a l _ t i m e = 1 8 0 . 0 ; % [ min ]
9 time_interval = [ init_time final_time ] ;
10
11 kon = 0 . 0 9 7 2 ; % [ 1 / ( min nM) ]
12 k o f f = 0 . 2 4 ; % [ 1 / min ]
13 k t = 0 . 0 2 ; % [ 1 / min ]
14 ke = 0 . 1 5 ; % [ 1 / min ]
15
16 f t = 0 . 0 ; % [nM/ min ]
17 QR = 0 . 0 1 6 6 ; % [nM/ min ]
18 R_max = 0 . 4 1 5 ; %[nM]
19
20 sim_para = [ kon k o f f k t ke f t QR R_max ] ;
21
22 x0 = [ i n i t _ r e c e p t o r i n i t _ l i g a n d i n i t _ c o m p l e x ] ;
23 [ t o u t , x o u t ] = ode45 (@( time , s t a t e ) R L C _ k i n e t i c s ( time , s t a t e , sim_para )
, t i m e _ i n t e r v a l , x0 ) ;
24
25 figure ( 1 ) ; c l f ;
26 subplot ( 3 1 1 ) ;
27 plot ( tout , xout ( : , 1 ) )
28 y l a b e l ( ’ R e c e p t o r [nM] ’ ) ;
29 x l a b e l ( ’ time [ min ] ’ ) ;
30 axis ( [ t i m e _ i n t e r v a l 0 0 . 5 ] ) ;
31 subplot ( 3 1 2 ) ;
32 plot ( tout , xout ( : , 2 ) )
33 y l a b e l ( ’ Ligand [nM] ’ ) ;
34 x l a b e l ( ’ time [ min ] ’ ) ;
35 axis ( [ t i m e _ i n t e r v a l 0 0 . 0 5 ] ) ;
36 subplot ( 3 1 3 ) ;
37 plot ( tout , xout ( : , 3 ) )
38 y l a b e l ( ’ Complex [nM] ’ ) ;
39 x l a b e l ( ’ time [ min ] ’ ) ;
40 axis ( [ t i m e _ i n t e r v a l 0 0 . 0 0 4 ] ) ;
41
42 function d x d t = R L C _ k i n e t i c s ( time , s t a t e , sim_para )
43 R = state (1) ;
44 L = state (2) ;
45 C = state (3) ;
46
47 kon = sim_para ( 1 ) ;
48 k o f f = sim_para ( 2 ) ;
49 k t = sim_para ( 3 ) ;
50 ke = sim_para ( 4 ) ;
51 f t = sim_para ( 5 ) ;
52 QR = sim_para ( 6 ) ;
18 1 Introduction

53 R_max = sim_para ( 7 ) ;
54
55 i f R > R_max
56 QR = 0 ;
57 end
58
59 d x d t = zeros ( 3 , 1 ) ;
60 d x d t ( 1 ) = −kon∗R∗L + k o f f ∗C − k t ∗R + QR ;
61 d x d t ( 2 ) = −kon∗R∗L + k o f f ∗C + f t ;
62 d x d t ( 3 ) = kon∗R∗L − k o f f ∗C − ke∗C ;
63 end

Program 1.4 (Matlab) EGFR receptor, ligand, and complex kinetics

Figure 1.4 shows the simulation results. The receptor concentration increases
almost linearly at the beginning and fluctuates later around the maximum con-
centration limit. The ligand–receptor reaction steadily consumes the ligand when
they bind together and become the ligand–receptor complex. The complex has a
peak concentration that occurred around 20 minutes and then slowly decayed.
Figure 1.5 shows the simulation results of the Python program, Program 1.5.
Unlike the figure commands in Matlab for Figure 1.4, plotting subfigures in mat-
plotlib is not as simple as in Matlab. We need advanced features in matplotlib.
The advanced features of subplots in matplotlib are introduced in detail later in
Program 2.2. As we notice in the figure, the figure fonts are too small to read. How
to adjust the figure font sizes is also discussed in Program 2.2.
Receptor (nM)

0.4

0.2

0
0 20 40 60 80 100 120 140 160 180
Time (min)

0.04
Ligand (nM)

0.02

0
0 20 40 60 80 100 120 140 160 180
Time (min)
× 10–3
4
Complex (nM)

0
0 20 40 60 80 100 120 140 160 180
Time (min)

Figure 1.4 (Matlab) EGFR receptor, ligand, and complex time histories.
Another Random Scribd Document
with Unrelated Content
many respects be well illustrated by their aid. Thus, they may be
employed:—

(1) To illustrate the distribution of the predicate in a proposition.


In the case of each of the four fundamental propositions we may
shade the part of the predicate concerning which information is
given us.

We then have,—

160

We see that with A and I, only part of P is in some of the cases


shaded; whereas with E and O, the whole of P is in every case
shaded; and it is thus made clear that negative propositions
distribute, while affirmative propositions do not distribute, their
predicates.

(2) To illustrate the opposition of propositions. Comparing two


contradictory propositions, e.g., A and O, we see that they have no
case in common, but that between them they exhaust all possible
cases. Hence the truth, that two contradictory propositions cannot
be true together but that one of them must be true, is brought home
to us under a new aspect. Again, comparing two subaltern
propositions, e.g., A and I, we notice that the former gives us all the
information given by the latter and something more, since it still
further limits the possibilities. The other relations involved in the
doctrine of opposition may be illustrated similarly.

(3) To illustrate the conversion of propositions. Thus it is made


clear by the diagrams how it is that A admits only of conversion per
accidens. All S is P limits us to one or other of the following,—

What then do we know of P? In the first case we have All P is S, in


the second Some P is S ; and since we are ignorant as to which of
the two cases holds good, we can only state what is common to
them both, namely, Some P is S.
Again, it is made clear how it is that O is inconvertible. Some S is
not P limits us to one or other of the following,—

161 What then do we know concerning P? The three cases give us


respectively,—(i) All P is S ; (ii) Some P is S and Some P is not S ; (iii)
No P is S. But (i) and (iii) are inconsistent with one another. Hence
nothing can be affirmed of P that is true in all three cases
indifferently.

(4) To illustrate the more complicated forms of immediate


inference. Taking, for example, the proposition All S is P, we may
ask, What does this enable us to assert about not-P and not-S
respectively? We have one or other of these cases,—

As regards not-P, these yield respectively (i) No not-P is S ; (ii) No


not-P is S. And thus we obtain the contrapositive of the given
proposition.
As regards not-S, we have (i) No not-S is P, (ii) Some not-S is P
and some not-S is not P.168 Hence in either case we may infer Some
not-S is not P.
168It is assumed in the use of Euler’s diagrams that S and P
both exist in the universe of discourse, while neither of them
exhausts that universe. This assumption is the same as that upon
which our treatment of immediate inferences in the preceding
chapter has been based.

E, I, O may be dealt with similarly.

(5) To illustrate the joint force of a pair of complementary or


contra-complementary or sub-complementary propositions (compare
section 100). Thus, the pair of complementary propositions, SaP and
PaS, taken together, limit us to

Similarly the pair of contra-complementary propositions, SaP and


PoS, limit us to the relation marked β on page 158; and the pair of
contra-complementary propositions, SoP and 162 PaS, to γ ; while the
pair of sub-complementary propositions, SoP and PoS, give us a
choice between δ and ε.

The application of the diagrams to syllogistic reasonings will be


considered in a subsequent chapter.

With regard to all the above, it may be said that the use of the
circles gives us nothing that could not easily have been obtained
independently. This is of course true; but no one, who has had
experience of the difficulty that is sometimes found by students in
properly understanding the elementary principles of formal logic, and
especially in dealing with immediate inferences, will despise any
means of illustrating afresh the old truths, and presenting them
under a new aspect.

The fact that we have not a single pair of circles corresponding to


each fundamental form of proposition is fatal if we wish to illustrate
any complicated train of reasoning in this way; but in indicating the
real nature of the information given by the propositions themselves,
it is rather an advantage than otherwise, inasmuch as it shews how
limited in some cases this information actually is.169
169 Dr Venn writes in criticism of Euler’s scheme, “A fourfold
scheme of propositions will not very conveniently fit in with a
fivefold scheme of diagrams… What the five diagrams are
competent to illustrate is the actual relation of the classes, not
our possibly imperfect knowledge of that relation” (Empirical
Logic, p. 229). The reply to this criticism is that inasmuch as the
fourfold scheme of propositions gives but an imperfect knowledge
of the actual relation of the classes denoted by the terms, the
Eulerian diagrams are specially valuable in making this clear and
unmistakeable. By the aid of dotted lines it is indeed possible to
represent each proposition by a single Eulerian figure; but the
diagrams then become so much more difficult to interpret that the
loss is considerably greater than the gain. The first and second of
the following diagrams are borrowed from Ueberweg (Logic, §
71). In the case of O, Ueberweg’s diagram is rather complicated;
and I have substituted a simpler one.
In the last of these diagrams we get the three cases yielded by
an O proposition by (1) filling in the dotted line to the left and
striking out the other, (2) filling in both dotted lines, (3) filling in
the dotted line to the right and striking out the other. These three
cases are respectively those marked γ, δ, ε, on page 158.

163 127. Lambert’s Diagrams.—A scheme of diagrams was


employed by Lambert170 in which horizontal straight lines take the
place of Euler’s circles. The extension of a term is represented by a
horizontal straight line, and so far as two such lines overlap it is
indicated that the corresponding classes are coincident, while so far
as they do not overlap these classes are shewn to be mutually
exclusive. Both the absolute and the relative length of the lines is of
course arbitrary and immaterial.
170
Johann Heinrich Lambert was a German philosopher and
mathematician who lived from 1728 to 1777. His Neues Organon
was published at Leipzig in 1768. Lambert’s own diagrammatic
scheme differs somewhat from both of those given in the text;
but it very closely resembles the one in which portions of the lines
are dotted. The modifications in the text have been introduced in
order to obviate certain difficulties involved in Lambert’s own
diagrams. See note 2 on page 165.

We may first shew how Lambert’s lines may be used in such a


manner as to be precisely analogous to Euler’s circles. 164 Thus, the
four fundamental propositions may be represented as follows:—
These diagrams occupy less space than Euler’s circles. But they
seem also to be less intuitively clear and less suggestive. The
different cases too are less markedly distinct from one another. It is
probable that one would in consequence be more liable to error in
employing them.

The different cases may, however, be combined by the use of


dotted lines so as to yield but a single diagram for each proposition
much more satisfactorily than in Euler’s scheme. Thus, All S is P may
be represented by the diagram

where the dotted line indicates that we are uncertain as to whether


there is or is not any P which is not S. We obviously get two cases
according as we strike out the dots or fill them in, and these are the
two cases previously shewn to be compatible with an A proposition.

Again, Some S is P may be represented by the diagram

and here we get the four cases previously given for an I 165
proposition by (a) filling in the dots to the left and striking out those
to the right, (b) filling in all the dots, (c) striking them all out, (d)
filling in those to the right and striking out those to the left.

Two complete schemes of diagrams may be constructed on this


plan, in one of which no part of any S line, and in the other no part
of any P line, is dotted.171 These two schemes are given below to
the left and right respectively of the propositional forms themselves.
171 It is important to give both these schemes as it will be
found that neither one of them will by itself suffice when this
method is used for illustrating the syllogism. For obvious reasons
the E diagram is the same in both schemes.

It must be understood that the two diagrams given above in the


cases of A, I, and O are alternative in the sense that we may select
which we please to represent our proposition; but either represents
it completely.

We shall find later on that for the purpose of illustrating the


syllogistic moods, Lambert’s method is a good deal less cumbrous
than Euler’s.172 An adaptation of Lambert’s diagrams in which the
contradictories of S and P are introduced as well 166 as S and P
themselves will be given in section 131. This more elaborated
scheme will be found useful for illustrating the various processes of
immediate inference.
172 Dr Venn (Symbolic Logic, p. 432) remarks, “As a whole
Lambert’s scheme seems to me distinctly inferior to the scheme of
Euler, and has in consequence been very little employed by other
logicians.” The criticism offered in support of this statement is
directed chiefly against Lambert’s own representation of the
particular affirmative proposition, namely,

This diagram certainly seems as appropriate to O as it does to I;


but the modification introduced in the text, and indeed suggested
by Dr Venn himself, is not open to a similar objection.

128. Dr Venn’s Diagrams.—In the diagrammatic scheme employed


by Dr Venn (Symbolic Logic, chapter 5) the diagram

does not itself represent any proposition, but the framework into
which propositions may be fitted. Denoting not-S by Sʹ and what is
both S and P by SP, &c., it is clear that everything must be contained
in one or other of the four classes SP, SPʹ, SʹP, SʹPʹ ; and the above
diagram shews four compartments (one being that which lies outside
both the circles) corresponding to these four classes. Every universal
proposition denies the existence of one or more of such classes, and
it may therefore be diagrammatically represented by shading out the
corresponding compartment or compartments. Thus, All S is P,
which denies the existence of SPʹ, is represented by

No S is P by

167 With three terms we have three circles and eight


compartments, thus,—

All S is P or Q is represented by

All S is P and Q by
It is in cases involving three or more terms that the advantage of
this scheme over the Eulerian scheme is most manifest. The
diagrams are not, however, quite so well adapted to the case of
particular propositions. Dr Venn (in Mind, 1883, pp. 599, 600)
suggests that we might draw a bar across the compartment declared
to be saved by a particular proposition;173 thus, Some S is P would
be represented by drawing a bar across the SP compartment. This
plan can be worked out satisfactorily; but in representing a
combination of propositions in this way special care is needed in the
interpretation of the diagrams. For example, if we have the diagram
for three terms S, P, Q, and are given Some S is P, 168 we do not
know that both the compartments SPQ, SPQʹ, are to be saved, and
in a case like this a bar drawn across the SP compartment is in some
danger of misinterpretation.
173 Dr Venn’s scheme differs from the schemes of Euler and
Lambert, in that it is not based upon the assumption that our
terms and their contradictories all represent existing classes. It
involves, however, the doctrine that particulars are existentially
affirmative, while universals are existentially negative.

129. Expression of the possible relations between any two classes


by means of the propositional forms A, E, I, O.—Any information
given with respect to two classes limits the possible relations
between them to something less than the five à priori possibilities
indicated diagrammatically by Euler’s circles as given at the
beginning of section 126. It will be useful to enquire how such
information may in all cases be expressed by means of the
propositional forms A, E, I, O.

The five relations may, as before, be designated respectively α, β,


γ, δ, ε.174 Information is given when the possibility of one or more of
these is denied; in other words, when we are limited to one, two,
three, or four of them. Let limitation to α, or β, the exclusion of γ, δ,
ε be denoted by α, β ; limitation to α, β, or γ (i.e., the exclusion of δ
and ε) by α, β, γ ; and so on.
174 Thus, the classes being S and P, α denotes that S and P
are wholly coincident; β that P contains S and more besides; β
that S contains P and more besides; δ that S and P overlap each
other, but that each includes something not included by the other;
ε that S and P have nothing whatever in common.

In seeking to express our information by means of the four


ordinary propositional forms, we find that sometimes a single
proposition will suffice for our purpose; thus α, β is expressed by All
S is P. Sometimes we require a combination of propositions; thus α
is expressed by the pair of complementary propositions All S is P and
all P is S, (since all S is P excludes γ, δ, ε, and all P is S further
excludes β). Some other cases are more complicated; thus the fact
that we are limited to α or δ cannot be expressed more simply than
by saying, Either All S is P and all P is S, or else Some S is P, some S
is not P, and some P is not S.

Let A = All S is P, A1 = All P is S, and similarly for the other


propositions. Also let AA1 = All S is P and all P is S, &c. Then the
following is a scheme for all possible cases:— 169
Limitation Limitation
denoted by denoted by
to to
α AA1 α, β , γ A or A1
β AO1 α, β , δ A or IO1
γ A1 O α, β , ε A or E
δ IOO1 α, γ , δ A1 or IO
ε E α, γ , ε A1 or E
α, β A α, δ, ε AA1 or OO1
α, γ A1 β, γ, δ IO or IO1
AA1 or AO1 or A1O or
α, δ β, γ, ε
IOO1 E
α, ε AA1 or E β , δ, ε O1
β, γ AO1 or A1O γ , δ, ε O
β, δ IO1 α, β , γ , δ I
β, ε AO1 or E α, β , γ , ε A or A1 or E
γ, δ IO α, β , δ, ε A or O1
γ, ε A1O or E α, γ , δ, ε A1 or O
δ, ε OO1 β , γ , δ, ε O or O1

It will be found that any combinations of propositions other than


those given above either involve contradictions or redundancies, or
else give no information because all the five relations that are à
priori possible still remain possible.

For example, AI is clearly redundant; AO is self-contradictory; A


or A1O is redundant (since the same information is given by A or
A1); A or O gives no information (since it excludes no possible case).
The student is recommended to test other combinations similarly. It
must be remembered that I1 = I, and E1 = E.
170 It should be noticed that if we read the first column
downwards and the second column upwards we get pairs of
contradictories.

130. Euler’s diagrams and the class relations between S, not-S, P,


not-P.—In Euler s diagrams, as ordinarily given, there is no explicit
recognition of not-S and not-P; but it is of course understood that
whatever part of the universe lies outside S is not-S, and similarly for
P, and it may be thought that no further account of negative terms
need be taken. Further consideration, however, will shew that this is
not the case; and, assuming that S, not-S, P, not-P all represent
existing classes, we shall find that seven, not five, determinate class
relations between them are possible.

Taking the diagrams given in section 126, the above assumption


clearly requires that in the cases of α, β, and γ, there should be
some part of the universe lying outside both the circles, since
otherwise either not-S or not-P or both of them would no longer be
contained in the universe. But in the cases of δ and ε it is different.
S, not-S, P, not-P are now all of them represented within the circles;
and in each of these cases, therefore, the pair of circles may or may
not between them exhaust the universe.

Our results may also be expressed by saying that in the cases of


α, β, and γ, there must be something which is both not-S and not-P;
whereas in the cases of δ and ε, there may or may not be something
which is both not-S and not-P. Euler’s circles, as ordinarily used, are
no doubt a little apt to lead us to overlook the latter of these
alternatives. If, indeed, there were always part of the universe
outside the circles, every proposition, whether its form were A, E, I,
or O, would have an inverse and the same inverse, namely, Some
not-S is not-P ; also, every proposition, including I, would have a
contrapositive. These are erroneous results against which we have to
be on our guard in the use of Euler’s fivefold scheme.

We find then that the explicit recognition of not-S and not-P


practically leaves α, β, and γ unaffected, but causes δ and ε each to
subdivide into two cases according as there is or is not anything that
is both not-S and not-P; and the 171 Eulerian fivefold division has
accordingly to give place to a sevenfold division.

In the diagrammatic representation of these seven relations, the


entire universe of discourse may be indicated by a larger circle in
which the ordinary Eulerian diagrams (with some slight necessary
modifications) are included. We shall then have the following
scheme:—
172 It may be useful to repeat these diagrams with an explicit
indication in regard to each subdivision of the universe as to whether
it is S or not-S, P or not-P.175 The scheme will then appear as
follows:—
175 We might also represent the universe of discourse by a
long rectangle divided into compartments, shewing which of the
four possible combinations SP, SPʹ, SʹP, SʹPʹ are to be found. This
plan will give the following which precisely correspond, as
numbered, with those in the text:—

(i) SP SʹPʹ

(ii) SP SʹP SʹPʹ

(iii) SP SPʹ SʹPʹ

(iv) SP SPʹ SʹP SʹPʹ

(v) SP SPʹ SʹP

(vi) SPʹ SʹP SʹPʹ

(vii
SPʹ SʹP
)

173 Comparing the above with the five ordinary Eulerian diagrams
(which may be designated α, β &c. as in section 126), it will be seen
that (i) corresponds to α; (ii) to β; (iii) to γ; (iv) and (v) represent
the two cases now yielded by δ; (vi) and (vii) the two yielded by ε.

Our seven diagrams might also be arrived at as follows:—Every


part of the universe must be either S or Sʹ, and also P or Pʹ ; and
hence the mutually exclusive combinations SP, SPʹ, SʹP, SʹPʹ must
between them exhaust the universe. The case in which these
combinations are all to be found is represented by diagram (iv); if
one but one only is absent we obviously have four cases which are
represented respectively by (ii), (iii), (v), and (vi); if only two are to
be found it will be seen that we are limited to the cases represented
by (i) and (vii) or we should not fulfil the condition that neither S nor
Sʹ, P nor Pʹ, is to be altogether non-existent; for the same reason
the universe cannot contain less than two of the four combinations.
We thus have the seven cases represented by the diagrams, and
these are shewn to exhaust the possibilities.

174 The four traditional propositions are related to the new


scheme as follows:—
A limits us to (i) or (ii);
I to (i), (ii), (iii), (iv), or (v);
E to (vi) or (vii);
O to (iii), (iv), (v), (vi), or (vii).

Working out the further question how each diagram taken by itself
is to be expressed propositionally we get the following results:
(i) SaP and SʹaPʹ ;
(ii) SaP and SʹoPʹ ;
(iii) SʹaPʹ and SoP ;
(iv) SoP, SoPʹ, SʹoP, and SʹoPʹ ;
(v) SʹaP and SoPʹ ;
(vi) SaPʹ and SʹoP ;
(vii) SaPʹ and SʹaP.

It will be observed that the new scheme is in itself more


symmetrical than Euler’s, and also that it succeeds better in bringing
out the symmetry of the fourfold schedule of propositions.176 A and
E give two alternatives each, I and O give five each; whereas with
Euler’s scheme E gives only one alternative, A two, O three, I four,
and it might, therefore, seem as if E afforded more definite and
unambiguous information than A, and O than I, which is not really
the case. Further, the problem of expressing each diagram
propositionally yields a more symmetrical result than the
corresponding problem in the case of Euler’s diagrams.
176 We have seen that, similarly, in the case of immediate
inferences symmetry can be gained only by the recognition of
negative terms.

This sevenfold scheme of class relations should be compared with


the sevenfold scheme of relations between propositions given in
section 84.

131. Lambert’s diagram and the class-relations between S, not-S,


P, not-P.—The following is a compact diagrammatic representation of
the seven possible class-relations between S, not-S, P, not-P, based
upon Lambert’s scheme. 175

In this scheme each line represents the entire universe of


discourse, and the first line must be taken in connexion with each of
the others in turn. Further explanation will be unnecessary for the
student who clearly understands the Lambertian method.

On the same principle and with the aid of dotted lines the four
fundamental propositional forms may be represented as follows:

176 In each case the full extent of a line represents the entire
universe of discourse; any portion of a line that is dotted may be
either S or Sʹ (or P or Pʹ, as the case may be).
This last scheme of diagrams is perhaps more useful than any of
the others in shewing at a glance what immediate inferences are
obtainable from each proposition by conversion, contraposition, and
inversion (on the assumption that S, Sʹ, P, and Pʹ all represent
existing classes). Thus, from the first diagram we can read off at a
glance SaP, PiS, PʹaSʹ, SʹiPʹ ; from the second SeP, PeS, PʹoSʹ, SʹoPʹ ;
from the third SiP and PiS ; and from the fourth SoP and PʹoSʹ. The
last two diagrams are also seen at a glance to be indeterminate in
respect to Pʹ and Sʹ, P and Sʹ, respectively (that is to say, I has no
contrapositive and no inverse, O has no converse and no inverse).

EXERCISES.

132. Illustrate by means of the Eulerian diagrams (1) the relation between A and E, (2)
the relation between I and O, (3) the conversion of I, (4) the contraposition of O, (5) the
inversion of E. [K.]

133. A denies that none but X are Y ; B denies that none but Y are X. Which of the five
class relations between X and Y (1) must they agree in rejecting, (2) may they agree in
accepting? [C.]

134. Take all the ordinary propositions connecting any two terms, combine them in pairs
so far as is possible without contradiction, and represent each combination
diagrammatically. [J.]
CHAPTER VI.

PROPOSITIONS IN EXTENSION AND IN INTENSION.

135. Fourfold Implication of Propositions in Connotation and


Denotation.—In dealing with the question whether propositions
assert a relation between objects or between attributes or between
objects and attributes, logicians have been apt to commit the fallacy
of exclusiveness, selecting some one of the given alternatives, and
treating the others as necessarily excluded thereby. It follows,
however, from the double aspect of names—in extension and
intension—that the different relations really involve one another, so
that all of them are implied in any categorical proposition whose
subject and predicate are both general names.177 If any one of the
relations is selected as constituting the meaning of the proposition,
the other relations are at any rate involved as implications.
177
In the discussion that follows we limit ourselves to the
traditional scheme of propositions.

The problem will be made more definite if we confine ourselves to


a consideration of connotation and denotation in the strict sense, as
distinguished from comprehension and exemplification, our terms
being supposed to be defined intensively.178 Both subject and
predicate will then have a denotation determined by their
connotation, and hence our 178 proposition may be considered from
four different points of view, which are not indeed really
independent of one another, but which serve to bring different
aspects of the proposition into prominence. (1) The subject may be
read in denotation and the predicate in connotation; (2) both terms
may be read in denotation; (3) both terms may be read in
connotation; (4) the subject may be read in connotation and the
predicate in denotation.
178 With extensive definitions we might similarly work out the
relations between the terms of a proposition in exemplification
and comprehension; and with either intensive or extensive
definitions, we might consider them in denotation and
comprehension. The discussion in the text will, however, be
limited to connotation and denotation, except that a separate
section will be devoted to the case in which both subject and
predicate are read in comprehension.

As an example, we may take the proposition, All men are


mortal.179 According to our point of view, this proposition may be
read in any of the following ways:
(1) The objects denoted by man possess the attributes connoted
by mortal ;
(2) The objects denoted by man are included within the class of
objects denoted by mortal ;
(3) The attributes connoted by man are accompanied by the
attributes connoted by mortal ;
(4) The attributes connoted by man indicate the presence of an
object belonging to the class denoted by mortal.
179 A distinction may perhaps be drawn between the four
following types of propositions; (a) All men are mortal ; (b) All
men are mortals ; (c) Man is mortal ; (d) Man is a mortal. Of
these, (a) naturally suggests the reading of subject in denotation
and predicate in connotation as meaning, the three other
readings being implications ; (b) is similarly related to the reading
numbered (2) above; (c) to (3); and (d) to (4).
It should be specially noticed that a different relation between
subject and predicate is brought out in each of these four modes of
analysing the proposition, the relations being respectively (i)
possession, (ii) inclusion, (iii) concomitance, (iv) indication.

It may very reasonably be argued that a certain one of the above


ways of regarding the proposition is (a) psychologically the most
prominent in the mind in predication; or (b) the most fundamental in
the sense of making explicit that relation which ultimately
determines the other relations; or (c) the most convenient for a
given purpose, e.g., for dealing with the problems of formal logic.
We need not, however, select the same mode of interpretation in
each case. There would, for example, be nothing inconsistent in
holding that to read the 179 subject in denotation and the predicate
in connotation is most correct from the psychological standpoint; to
read both terms in connotation the most ultimate, inasmuch as
connotation determines denotation and not vice versâ, and to read
both terms in denotation the most serviceable for purposes of logical
manipulation. To say, however, that a certain one of the four
readings alone can be regarded as constituting the import of the
proposition to the exclusion of the others cannot but be erroneous.
They are in truth so much implicated in one another, that the
difficulty may rather be to justify a treatment which distinguishes
between them.180
180 The true doctrine is excellently stated by Mrs Ladd Franklin
in an article in Mind, October, 1890, pp. 561, 2.

(1) Subject in denotation, predicate in connotation.


If we read the subject of a proposition in denotation and the
predicate in connotation, we have what is sometimes called the
predicative mode of interpreting the proposition. This way of
regarding propositions most nearly corresponds in the great majority
of cases with the course of ordinary thought;181 that is to say, we
naturally contemplate the subject as a class of objects of which a
certain attribute or complex of attributes is predicated. Such
propositions as All men are mortal, Some violets are white, All
diamonds are combustible, may be taken as examples. Dr Venn puts
the point very clearly with reference to the last of these three
propositions: “If I say that ‘all diamonds are combustible,’ I am
joining together two connotative terms, each of which, therefore,
implies an attribute and denotes a class; but is there not a broad
distinction in respect of the prominence with which the notion of a
class is presented to the mind in the two cases? As regards the
diamond, we think at once, or think very speedily, of a class of
things, the distinctive attributes of the subject being mainly used to
carry the mind on to the contemplation of the objects referred to by
them. But as regards the combustibility, the attribute itself is the
prominent thing … Combustible things, other than the diamond
itself, come scarcely, if at all, under 180 contemplation. The assertion
in itself does not cause us to raise a thought whether there be other
combustible things than these in existence” (Empirical Logic, p. 219).
181 Though perhaps what is actually present to the mind is
usually rather more complex than what is represented by any one
of the four readings taken by itself.

Two points may be noticed as serving to confirm the view that


generally speaking the predicative mode of interpreting propositions
is psychologically the most prominent:
(a) The most striking difference between a substantive and an
attributive (i.e., an adjective or a participle) from the logical point of
view is that in the former the denotation is usually more prominent
than the connotation, even though it may be ultimately determined
by the connotation, whilst in the latter the connotation is the more
prominent, even though the name must be regarded as the name of
a class of objects if it is entitled to be called a name in the strict
logical sense at all. Corresponding to this we find that the subject of
a proposition is almost always a substantive, whereas the predicate
is more often an attributive.
(b) It is always the denotation of a term that we quantify, never
the connotation. Whether we talk of all men or of some men, the
complex of attributes connoted by man is taken in its totality; the
distinction of quantity relates entirely to the denotation of the term.
Corresponding to this, we find that we naturally regard the quantity
of a proposition as pertaining to its subject, and not to its predicate.
It will be shewn in the following chapter that the doctrine of the
quantification of the predicate has at any rate no psychological
justification.

There are, however, numerous exceptions to the statement that


the subject of a proposition is naturally read in denotation and the
predicate in connotation; for example, in the classificatory sciences.
The following propositions may be taken as instances: All palms are
endogens, All daisies are compositae, None but solid bodies are
crystals, Hindoos are Aryans, Tartars are Turanians. In such cases as
these most of us would naturally think of a certain class of objects as
included in or excluded from another class rather than as possessing
or not possessing certain definite attributes; in other words, as Dr
Venn puts it, “the class-reference of the predicate is no less definite
than that of the subject” (Empirical Logic, p. 220). 181 In the case of
such a proposition as No plants with opposite leaves are orchids, the
position is even reversed, that is to say, it is the subject rather than
the predicate that we should more naturally read in connotation. We
may pass on then to other ways of regarding the categorical
proposition.

(2) Subject in denotation, predicate in denotation.


If we read both the subject and the predicate of a proposition in
denotation, we have a relation between two classes, and hence this
is called the class mode of interpreting the proposition. It must be
particularly observed that the relation between the subject and the
predicate is now one of inclusion in or exclusion from, not one of
possession. It may at once be admitted that the class mode of
interpreting the categorical proposition is neither the most ultimate,
nor—generally speaking—that which we naturally or spontaneously
adopt. It is, however, extremely convenient for manipulative
purposes, and hence is the mode of interpretation usually selected,
either explicitly or implicitly, by the formal logician. Attention may be
specially called to the following points:
(a) When subject and predicate are both read in denotation, they
are homogeneous.
(b) In the diagrammatic illustration of propositions both subject
and predicate are necessarily read in denotation, since it is the
denotation—not the connotation—of a term that we represent by
means of a diagram.
(c) The predicate of a proposition must be read in denotation in
order to give a meaning to the question whether it is or is not
distributed.
(d) The predicate as well as the subject must be read in
denotation before such a process as conversion is possible.
(e) In the treatment of the syllogism both subject and predicate
must be read in denotation (or else both in connotation), since
either the middle term (first and fourth figures) or the major term
(second and fourth figures) or the minor term (third and fourth
figures) is subject in one of the propositions in which it occurs and
predicate in the other.

The class mode of interpreting categorical propositions is


nevertheless treated by some writers as being positively 182
erroneous. But the arguments used in support of this view will not
bear examination.

(i) It is said that to read both subject and predicate in denotation


is psychologically false. It has indeed been pointed out already that
the class mode of interpretation is not that which as a rule first
presents itself to our mind when a proposition is given us; but we
have also seen that there are exceptions to this, as, for example, in
the propositions All daisies are compositae. All Hindoos are Aryan, All
Tartars are Turanians. It is, therefore, clearly wrong to describe the
reading in question as in all cases psychologically false. On the same
shewing, any other reading would equally be psychologically false,
for what is immediately present to the mind in judgment varies very
much in different cases. Undoubtedly there are many judgments in
regard to which we do not spontaneously adopt the class reading.
Still, analysis shews that in these judgments, as in others, inclusion
in or exclusion from a class is really implicated along with other
things, although this relation may be neither that which first
impresses itself upon us nor that which is most important or
characteristic.

(ii) It is asked what we mean by a class, by the class of birds, for


example, when we say All owls are birds. “It is nothing existing in
space; the birds of the world are nowhere collected together so that
we can go and pick out the owls from amongst them. The
classification is a mental abstraction of our own, founded upon the
possession of certain definite attributes. The class is not definite and
fixed, and we do not find out whether any individual belongs to it by
going over a list of its members, but by enquiring whether it
possesses the necessary attributes.”182 In so far as this argument
applies against reading the predicate in denotation, it applies equally
against reading the subject in denotation. It is in effect the
argument used by Mill (Logic, i. 5, § 3) in order to lead up to his
position that the ultimate interpretation of the categorical
proposition requires us to read both subject and predicate in
connotation, since denotation is determined by connotation. But if
this be granted, it does not prove the class reading of the 183
proposition erroneous; it only proves that in the class reading, the
analysis of the import of the proposition has not been carried as far
as it admits of being carried.
182 Welton, Logic, p. 218.

(iii) It is argued that when we regard a proposition as expressing


the inclusion of one class within another, even then the predicate is
only apparently read in denotation. “On this view, we do not really
assert P but ‘inclusion in P,’ and this is therefore the true predicate.
For example, in the proposition ‘All owls are birds,’ the real predicate
is, on this view, not ‘birds’ but ‘included in the class birds.’ But this
inclusion is an attribute of the subject, and the real predicate,
therefore, asserts an attribute. It is meaningless to say ‘Every owl is
the class birds,’ and it is false to say ‘The class owls is the class
birds.’”183 This argument simply begs the question in favour of the
predicative mode of interpretation. It overlooks the fact that the
precise kind of relation brought out in the analysis of a proposition
will vary according to the way in which we read the subject and the
predicate. An analogous argument might also be used against the

You might also like