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

Quick Functional Programming David Matuszek pdf download

The document is about 'Quick Functional Programming' by David Matuszek, which aims to demystify functional programming and demonstrate its utility across popular programming languages like Python, Java, and Scala. It emphasizes that functional programming is a powerful tool that can enhance conventional programming practices without requiring complete abandonment of traditional methods. The book includes various chapters covering key concepts and examples in the mentioned languages, making it accessible to a broad audience of programmers.

Uploaded by

chivuviesti
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)
13 views

Quick Functional Programming David Matuszek pdf download

The document is about 'Quick Functional Programming' by David Matuszek, which aims to demystify functional programming and demonstrate its utility across popular programming languages like Python, Java, and Scala. It emphasizes that functional programming is a powerful tool that can enhance conventional programming practices without requiring complete abandonment of traditional methods. The book includes various chapters covering key concepts and examples in the mentioned languages, making it accessible to a broad audience of programmers.

Uploaded by

chivuviesti
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/ 47

Quick Functional Programming David Matuszek

download

https://ebookbell.com/product/quick-functional-programming-david-
matuszek-49607080

Explore and download more ebooks at ebookbell.com


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

Quick Functional Programming Quick Programming 1st Edition David


Matuszek

https://ebookbell.com/product/quick-functional-programming-quick-
programming-1st-edition-david-matuszek-49484134

Quick Clojure Effective Functional Programming 1st Ed Mark Mcdonnell

https://ebookbell.com/product/quick-clojure-effective-functional-
programming-1st-ed-mark-mcdonnell-6730354

Quick Clojure Effective Functional Programming Mark Mcdonnell

https://ebookbell.com/product/quick-clojure-effective-functional-
programming-mark-mcdonnell-6778682

Quick Functional Exercises For Seniors 50 Exercises To Optimize Your


Health 1st Edition Cody Sipe

https://ebookbell.com/product/quick-functional-exercises-for-
seniors-50-exercises-to-optimize-your-health-1st-edition-cody-
sipe-52674168
Functional Anatomy For Sport And Exercise Quick Reference 1st Edition
Clare Milner

https://ebookbell.com/product/functional-anatomy-for-sport-and-
exercise-quick-reference-1st-edition-clare-milner-1270880

Microsoft Excel Functions Quick Reference For Highquality Data


Analysis Dashboards And More 1st Edition Mandeep Mehta

https://ebookbell.com/product/microsoft-excel-functions-quick-
reference-for-highquality-data-analysis-dashboards-and-more-1st-
edition-mandeep-mehta-34873296

Microsoft Excel Functions Quick Reference For Highquality Data


Analysis Dashboards And More 1st Edition Mandeep Mehta

https://ebookbell.com/product/microsoft-excel-functions-quick-
reference-for-highquality-data-analysis-dashboards-and-more-1st-
edition-mandeep-mehta-44396112

Excel For Finance Quick Reference Guide Master Formulas Functions And
Analysis Techniques The Finance Toolbox Series Book 1 Schwartz

https://ebookbell.com/product/excel-for-finance-quick-reference-guide-
master-formulas-functions-and-analysis-techniques-the-finance-toolbox-
series-book-1-schwartz-217805110

Windows 11 Quick Guide Tips Learn How To Use Tons Of Windows 11 Hidden
Features Functions And Tricks Cecile Dean Charles J J

https://ebookbell.com/product/windows-11-quick-guide-tips-learn-how-
to-use-tons-of-windows-11-hidden-features-functions-and-tricks-cecile-
dean-charles-j-j-50493072
Quick Functional
Programming
Why learn functional programming? Isn’t that some compli-
cated ivory-­tower technique used only in obscure languages like
Haskell?

In fact, functional programming is actually very simple. It’s also


very powerful, as Haskell demonstrates by throwing away all the
conventional programming tools and using only functional pro-
gramming features. But it doesn’t have to be done that way.

Functional programming is a power tool that you can use in addi-


tion to all your usual tools, to whatever extent your current main-
stream language supports it. Most languages have at least basic
support.

In this book, we use Python and Java and, as a bonus, Scala. If you
prefer another language, there will be minor differences in syntax,
but the concepts are the same.

Give functional programming a try. You may be surprised


how much a single power tool can help you in your day-­to-­day
programming.
Quick Functional
Programming

David Matuszek
First edition published 2023
by CRC Press
6000 Broken Sound Parkway NW, Suite 300, Boca Raton, FL 33487-2742
and by CRC Press
4 Park Square, Milton Park, Abingdon, Oxon, OX14 4RN
CRC Press is an imprint of Taylor & Francis Group, LLC
© 2023 David Matuszek
Reasonable efforts have been made to publish reliable data and information, but
the author and publisher cannot assume responsibility for the validity of all
materials or the consequences of their use. The authors and publishers have
attempted to trace the copyright holders of all material reproduced in this
publication and apologize to copyright holders if permission to publish in this
form has not been obtained. If any copyright material has not been acknowledged
please write and let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be
reprinted, reproduced, transmitted, or utilized in any form by any electronic,
mechanical, or other means, now known or hereafter invented, including
photocopying, microfilming, and recording, or in any information storage or
retrieval system, without written permission from the publishers.

For permission to photocopy or use material electronically from this work,


access www.copyright.com or contact the Copyright Clearance Center, Inc.
(CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. For works
that are not available on CCC please contact mpkbookspermissions@tandf.
co.uk
Trademark notice: Product or corporate names may be trademarks or registered
trademarks and are used only for identification and explanation without intent
to infringe.
ISBN: 978-1-032-41532-1 (hbk)
ISBN: 978-1-032-41531-4 (pbk)
ISBN: 978-1-003-35854-1 (ebk)
DOI: 10.1201/9781003358541
Typeset in Minion
by SPi Technologies India Pvt Ltd (Straive)
To all my students,
past, present, and future.
Contents

About the Author, xi


Preface, xiii

Chapter 1   ◾    What Is Functional Programming? 1

Chapter 2   ◾    Methods and Functions 5


2.1 Methods 6
2.1.1 Methods in Python 6
2.1.2 Methods in Java 7
2.1.3 Methods in Scala 9
2.2 Function Literals 10
2.2.1 Function Literals in Python 11
2.2.2 Function Literals in Java 12
2.2.3 Function Literals in Scala 13
2.3 Sorting Examples 14
2.3.1 Sorting in Python 14
2.3.2 Sorting in Java 16
2.3.3 Sorting in Scala 18

vii
viii   ◾   Contents

Chapter 3   ◾    Higher-Order Functions 21


3.1 Higher-Order Functions in Python 22
3.2 Higher-Order Functions in Java 25
3.3 Higher-Order Functions in Scala 27

Chapter 4   ◾    Functional Interfaces in Java 31


4.1 Single Abstract Methods 31
4.2 Anonymous Inner Classes 32
4.3 Defining Functional Interfaces 33
4.4 Method References 34
4.5 The Other Method Reference 37
4.6 Provided Functional Interfaces 38
4.6.1 IntPredicate 38
4.6.2 Function Composition 39
4.6.3 Predicates Again 41
4.6.4 Unary Operators 42
4.6.5 More Functions and Operators 43
4.6.6 Suppliers and Consumers 44

Chapter 5   ◾    If Expressions 47


5.1 If Expressions in Python 47
5.2 If Expressions in Java 48
5.3 If Expressions in Scala 49

Chapter 6   ◾    Comprehensions 51


6.1 List Comprehensions in Python 52
6.2 Comprehensions in Java 54
6.3 For Expressions in Scala 54
6.4 For Comprehensions in Scala 57
Contents   ◾   ix

Chapter 7   ◾    Closures 59


7.1 Closures in Python 60
7.2 Closures in Java 61
7.3 Closures in Scala 63
7.4 Closure Example 64

Chapter 8   ◾    Currying 67


8.1 Currying in Python 69
8.2 Currying in Java 71
8.3 Currying in Scala 72

Chapter 9   ◾    Function Composition 75


9.1 Function Composition in Python 75
9.2 Function Composition in Java 77
9.3 Function Composition in Scala 78

Chapter 10   ◾    Optional Values 79


10.1 Optional in Python 80
10.2 Optional in Java 80
10.3 Option in Scala 81

Chapter 11   ◾    Lists 83


11.1 Recursion 84
11.2 Lists in Python 86
11.3 Lists in Java 87
11.4 Lists in Scala 87

Chapter 12   ◾    Streams 91


12.1 Generators in Python 92
12.2 Streams in Java 92
x   ◾   Contents

12.3 Numeric Streams in Java 95


12.4 Streams in Scala 95

Chapter 13   ◾    Important Functions 97


13.1 Important Functions in Python 98
13.2 Important Functions in Java 99
13.3 Important Functions in Scala 102
13.4 Additional Functions in Scala 105

Chapter 14   ◾    Pipelines 107


14.1 Pipelines in Python 109
14.2 Pipelines in Java 110
14.2.1 Intermediate Operations 110
14.2.2 Terminal Operations 112
14.2.3 Collectors 114
14.2.4 Example 115
14.3 Pipelines in Scala 116

Chapter 15   ◾    Summary and Final Examples 119


15.1 Examples in Python 120
15.2 Examples in Java 122
15.3 Examples in Scala 123

Afterword 125

Index, 127
About the Author

I ’m David Matuszek, known to most of my students as “Dr.


Dave.”

I wrote my first program on punched cards in 1963 and immedi-


ately got hooked.

I taught my first computer classes in 1970, as a graduate student in


Computer Science at The University of Texas in Austin. I eventu-
ally got my PhD from there, and I’ve been teaching ever since.
Admittedly, I spent over a dozen years in industry, but even then,
I taught as an adjunct for Villanova university.

I finally escaped from industry and joined the Villanova faculty


full time for a few years and then moved to the University of
Pennsylvania, where I directed a Master’s program (MCIT,
Masters in Computer and Information Technology) for students
coming into computer science from another discipline.

Throughout my career, my main interests have been in artificial


intelligence (AI) and programming languages. I’ve used a lot of
programming languages.

I retired in 2017, but I can’t stop teaching, so I’m writing a series


of “quick start” books on programming and programming

xi
xii   ◾   About the Author

languages. I’ve also written two science fiction novels, Ice Jockey
and All True Value, and I expect to write more. Check them out!

And hey, if you’re a former student of mine, drop me a note. I’d


love to hear from you!

david.matuszek@gmail.com
Preface

Y ou probably think that functional programming (FP) is


something dreamed up by ivory-­ tower academics using
obscure languages that few people understand.

You’re right.

You probably think that those weird languages such as Haskell,


Standard ML, and OCaml are never going to be very popular with
ordinary programmers.

Right again.

But did you notice…

• That ivory-­tower academics are some pretty smart people?


• That the programming language you use every day, what-
ever it is, is getting more FP features?

“Pure” functional programming, abandoning all the conventional


programming techniques, really is difficult. But you don’t have to
do that. Think of it this way: Conventional programming consists
of a collection of hand tools, and FP adds a power tool to the mix.
Just one—it doesn’t do everything, and you still need all the other
tools (unless you’re an ivory-­tower academic), but where you can
use it, it saves a lot of work.
xiii
xiv   ◾   Preface

Here’s a spoiler: FP will let you replace many of your loops with
shorter, simpler, easier to understand function calls. Yes, there’s
some unfamiliar syntax involved, but it’s just syntax, and you can
get used to it very quickly. The new concepts, the parts you might
think are the most difficult, turn out to be trivially simple.

You may be surprised how much a single power tool can help you
in your day-­to-­day programming.

FP is coming into prominence now because it is a far better way to


write concurrent programs, suitable for multi-­core computers.
However, this is only a book about functional programming, not
about concurrent programming; that would require a far larger
volume.

Each chapter after the first begins with an explanation of some


particular concept of functional programming. After that, there
are sections exemplifying that concept in each of three languages.

• Python, because it is a simple, widely known language.


Python has only a few of the most basic FP features.
• Java, because it is widely known and has many of the FP
features. The developers of these features have done an
awesome job in fitting these features into a language that
was never designed to hold them.
• Scala, which has been designed from the ground up to be
both object oriented and functional, and therefore provides
the cleanest and most complete set of FP features.

I have tried to make this book accessible to programmers who


do not know Python or Scala. The FP features of these languages
can be understood without an in-­depth knowledge of the language
in which they occur. Unfortunately, no such claim can be made
for Java.
Random documents with unrelated
content Scribd suggests to you:
modify, or suspend their accomplishment, whether such influence be
exercised by heat or cold, by time and rest, or by agitation or
pressure, or by any of those agents of which we have acquired a
knowledge, such as electricity, light, magnetism, &c.
(335.) The wonderful and sudden transformations with which
chemistry is conversant, the violent activity often assumed by
substances usually considered the most inert and sluggish, and,
above all, the insight it gives into the nature of innumerable
operations which we see daily carried on around us, have
contributed to render it the most popular, as it is one of the most
extensively useful, of the sciences; and we shall, accordingly, find
none which have sprung forward, during the last century, with such
extraordinary vigour, and have had such extensive influence in
promoting corresponding progress in others. One of the chief causes
of its popularity is, perhaps, to be sought for in this, that it is, of all
the sciences, perhaps, the most completely an experimental one;
and even its theories are, for the most part, of that generally
intelligible and readily applicable kind, which demand no intense
concentration of thought, and lead to no profound mathematical
researches. The simple process of inductive generalization, grounded
on the examination of numerous facts, all of them presenting
considerable intrinsic interest, has sufficed, in most instances, to
lead, by a clear and direct road, to its highest laws yet known. But,
on the other hand, these laws, when stated, are not yet fully
sufficient to lead us, except in very limited cases, to a deductive
knowledge of particulars never before examined, at least, not
without great caution, and constant appeal to experiment as a check
on our reasoning; so that we are justified in regarding the axioms of
chemistry, the true handles of deductive reasoning, as still unknown,
and, perhaps, likely long to remain so. This is no fault of its
cultivators, who have comprised in their list the highest and most
varied talents and industry, but of the inherent complexity of the
subject, and the infinite multitude of causes which are concerned in
the production of every, even the simplest, chemical phenomenon.
(336.) The history of chemistry (on which, however, we are not
about to enlarge,) is one of great interest to those who delight to
trace the steps by which mankind advance to the discovery of truth
through a series of mistakes and failures. It may be divided, 1st, into
the period of the alchemists, a lamentable epoch in the annals of
intellectual wandering; 2dly, that of the phlogistic doctrines of
Beccher and Stahl, in which, as if to prove the perversity of the
human mind, of two possible roads the wrong was chosen; and a
theory obtained universal credence on the strength of an induction,
valid as such, but wrongly interpreted, which is negatived, in every
instance, by an appeal to the balance. This, too, happened, not by
reason of unlucky coincidences, or individual oversights, but of
necessity, and from an inherent defect of the theory itself, which
thus impeded the progress of the science, as far as a science of
experiment can be impeded by a false theory, by perplexing its
cultivators with the appearance of contradictions in their
experiments where none really subsisted, by destroying all their
confidence in the numerical exactness of their own results, and by
involving the subject in a mist of visionary and hypothetical causes in
place of the true acting principles. Thus, in the combustion of any
substance which is incapable of flying away in fumes, an increase of
weight takes place,—the ashes are heavier than the fuel. Whenever
this was observed, however, it was passed carelessly over as arising
from the escape of phlogiston, or the principle of inflammability,
which was considered as being either the element of fire itself, or in
some way combined with it, and thus essentially light. It is now
known that the increase of weight is owing to the absorption of, and
combination with, a quantity of a peculiar ingredient called oxygen,
from the air, a principle essentially heavy. So far as weight is
concerned, it makes no difference whether a body having weight
enters, or one having levity escapes; but there is this plain difference
in a philosophical point of view, that oxygen is a real producible
substance, and phlogiston is no such thing: the former is a vera
causa, the latter an hypothetical being, introduced to account for
what the other accounts for much better.
(337.) The third age of chemistry—that which may be called
emphatically modern chemistry—commenced (in 1786) when
Lavoisier, by a series of memorable experiments, extinguished for
ever this error, and placed chemistry in the rank of one of the exact
sciences,—a science of number, weight, and measure. From that
epoch to the present day it has constantly advanced with an
accelerated progress, and at this moment may be regarded as more
progressive than ever. The principal features in this progress may be
comprised under the following general heads:—

1. The discovery of the proximate, if not the ultimate,


elements of all bodies, and the enlargement of the list
of known elements to its present extent of between
fifty and sixty substances.
2. The developement of the doctrine of latent heat by Black,
with its train of important consequences, including the
scientific theory of the steam-engine.
3. The establishment of Wenzel’s law of definite proportions
on his own experiments, and those of Richter, a
discovery subsequently merged in the more general
wording and better development of Dalton’s atomic
theory.
4. The precise determination of the atomic weights of the
different chemical elements, mainly due to the
astonishing industry of Berzelius, and his unrivalled
command of chemical resources, as well as to the
researches of the other chemists of the Swedish and
German school.
5. The assimilation of gases and vapours, by which we are
led to regard the former, universally, as particular cases
of the latter, a generalization resulting chiefly from the
experiments of Faraday on the condensation of the
gases, and those of Gay-Lussac and Dalton, on the
laws of their expansion by heat compared with that of
vapours.
6. The establishment of the laws of the combination of
gases and vapours by definite volumes, by Gay-Lussac.
7. The discovery of the chemical effects of electricity, and
the decomposing agency of the Voltaic pile, by
Nicholson and Carlisle; the investigation of the laws of
such decompositions, by Berzelius and Hisinger: the
decomposition of the alkalies by Davy, and the
consequent introduction into chemistry of new and
powerful agents in their metallic bases.
8. The application of chemical analysis to all the objects of
organized and unorganized nature, and the discovery
of the ultimate constituents of all, and the proximate
ones of organic matter, and the recognisance of the
important distinctions which appear to divide these
great classes of bodies from each other.
9. The applications of chemistry to innumerable processes in
the arts, and among other useful purposes to the
discovery of the essential medical principles in
vegetables, and to important medicaments in the
mineral kingdom.
10. The establishment of the intimate connection between
chemical composition and crystalline form, by Haüy
and Vauquelin, with the successive rectifications the
statement of that connection has undergone in the
hands of Mitscherlich, Rose, and others, with the
progress of chemical and crystallographical knowledge.

(338.) To pursue these several heads into detail would lead us


into a treatise on chemistry; but a few remarks on one or two of
them, as they bear upon the general principles of all scientific
enquiry, will not be irrelevant. And first, then, with reference to the
discovery of new elements, it will be observed, that philosophical
chemistry no more aims at determining the one essential element
out of which all matter is framed—the one ultimate principle of the
universe—than astronomy at discovering the origin of the planetary
movements in the application of a determinate projectile force in a
determinate direction, or geology at ascending to the creation of the
earth. There may be such an element. Some singular relations which
have been pointed out in the atomic weights of bodies seem to
suggest to minds fond of speculation that there is; but philosophical
chemistry is content to wait for some striking fact, which may either
occur unexpectedly or be led to by the slow progress of enlarged
views, to disclose to us its existence. Still, the multiplication of so-
considered elementary bodies has been considered by some as an
inconvenience. We confess we do not coincide with this view.
Whatever they be, the obstinacy with which they resist
decomposition shows that they are ingredients of a very high and
primary importance in the economy of nature; and such as, in any
state of science, it would be indispensably necessary to be perfectly
familiar with. Like particular theorems in geometry, which, though
not rising to the highest point of generality, have yet their several
scopes and ranges of extensive application, they must be well and
perfectly understood in all their bearings. Should we ever arrive at
an analysis of these bodies, the chemical properties of the new
elements which will then come into view will be known only by our
knowledge of these, or of other compounds of the same class, which
they may be capable of forming. Not but that such an analysis would
be a most important and indeed triumphant achievement, and
change the face of chemistry; but it would undo nothing that has
been done, and render useless no point of knowledge which we
have yet arrived at.
(339.) The atomic theory, or the law of definite proportions,
which is the same thing presented in a form divested of all
hypothesis, after the laws of mechanics, is, perhaps, the most
important which the study of nature has yet disclosed. The extreme
simplicity which characterizes it, and which is itself an indication, not
unequivocal, of its elevated rank in the scale of physical truths, had
the effect of causing it to be announced at once by Mr. Dalton, in its
53
most general terms, on the contemplation of a few instances ,
without passing through subordinate stages of painful inductive
ascent by the intermedium of subordinate laws, such as, had the
contrary course been pursued by him, would have been naturally
preparatory to it, and such as would have led others to it by the
prosecution of Wenzel’s and Richter’s researches, had they been duly
attended to. This is, in fact, an example, and a most remarkable
one, of the effect of that natural propensity to generalize and
simplify (noticed in 171.), which, if it occasionally leads to over-hasty
conclusions, limited or disproved by further experience, is yet the
legitimate parent of many of our most valuable and soundest results.
Instances like this, where great and, indeed, immeasurable steps in
our knowledge of nature are made at once, and almost without
intellectual effort, are well calculated to raise our hopes of the future
progress of science, and, by pointing out the simplest and most
obvious combinations as those which are actually found to be
agreeable to the harmony of creation, to hold out the cheering
prospect of difficulties diminishing as we advance, instead of
thickening around us in increasing complexity.
(340.) A consequence of this immediate presentation of the law
of definite proportions in its most general form is, that its
subordinate laws—those which limit its generality in particular cases,
which diminish the number of combinations abstractly possible, and
restrain the indiscriminate mixture of elements,—remain to be
discovered. Some such limitations have, in fact, been traced to a
certain extent, but by no means so far as the importance of the
subject requires; and we have here abundant occupation for
chemists for some time.
(341.) The determination of the atomic weights of the chemical
elements, like that of other standard physical data, with the utmost
exactness, is in itself a branch of enquiry not only of the greatest
importance, but of extreme difficulty. Independent of the general
reasons for desiring accuracy in this respect, there is one peculiar to
the subject. It has been suggested (by Dr. Prout), and strongly
insisted on (by Dr. Thomson), that all the numbers representing
these weights, constituting a scale of great extent, in which the
extremes already known are in proportion to each other, as 1 to
upwards of 200, are simple even multiples of the least of them. If
this be really the case, it opens views of such importance as to
justify any degree of labour and pains in the verification of the law
as a purely inductive one. But in the actual state of chemical
analysis, with all deference to such high authority, we confess it
appears to us to stand in great need of further confirmation, since it
seems doubtful whether such accuracy has yet been attained as to
enable us to answer positively for a fraction not exceeding the three
or four hundredth part of the whole quantity to be determined: at
least the results of the first experimenters, obtained with the
greatest care, differ often by a greater amount; and this degree of
exactness, at least, would be required to verify the law satisfactorily
in the higher parts of the scale.
(342.) The mere agitation of such a question, however, points
out a class of phenomena in physical science of a remote and
singular kind, and of a very high and refined order, which could
never become known but in an advanced state of science, not only
practical, but theoretical,—we mean, such as consist in observed
relations among the data of physics, which show them to be
quantities not arbitrarily assumed, but depending on laws and
causes which they may be the means of at length disclosing. A
remarkable instance of such a relation is the curious law which Bode
observed to obtain in the progression of the magnitudes of the
several planetary orbits. This law was interrupted between Mars and
Jupiter, so as to induce him to consider a planet as wanting in that
interval;—a deficiency long afterwards strangely supplied by the
discovery of four new planets in that very interval, all of whose
orbits conform in dimension to the law in question, within such
moderate limits of error as may be due to causes independent of
54
those on which the law itself ultimately rests.
(343.) Neither is it irrelevant to our subject to remark, that the
progress which has been made in this department of chemistry, and
the considerable exactness actually attainable in chemical analysis,
have been owing, in great measure, to a circumstance which might
at first have been hardly considered likely to exercise much influence
on the progress of a science,—the discovery of platina. Without the
resources placed at the ready disposal of chemists by this invaluable
metal, it is difficult to conceive that the multitude of delicate
analytical experiments which have been required to construct the
fabric of existing knowledge could have ever been performed. This,
among many such lessons, will teach us that the most important
uses of natural objects are not those which offer themselves to us
most obviously. The chief use of the moon for man’s immediate
purposes remained unknown to him for five thousand years from his
creation. And, since it cannot but be that innumerable and most
important uses remain to be discovered among the materials and
objects already known to us, as well as among those which the
progress of science must hereafter disclose, we may hence conceive
a well-grounded expectation, not only of constant increase in the
physical resources of mankind, and the consequent improvement of
their condition, but of continual accessions to our power of
penetrating into the arcana of nature, and becoming acquainted with
her highest laws.
CHAP. V.
OF THE IMPONDERABLE FORMS OF MATTER.

Heat.

(344.) O ne of the chief agents in chemistry, on whose proper


application and management the success of a great number of its
enquiries depends, and many of whose most important laws are
disclosed to us by phenomena of a chemical nature, is HEAT.
Although some of its effects are continually before our eyes as
matters of the most common occurrence, insomuch that there is
scarcely any process in the useful arts and manufactures which does
not call for its intervention, and although, independent of this high
utility, and the proportionate importance of a knowledge of its nature
and laws, it presents in itself a subject of the most curious
speculation; yet there is scarcely any physical agent of which we
have so imperfect a knowledge, whose intimate nature is more
hidden, or whose laws are of such delicate and difficult investigation.
(345.) The word heat generally implies the sensation which we
experience on approaching a fire; but, in the sense it carries in
physics, it denotes the cause, whatever it be, of that sensation, and
of all the other phenomena which arise on the application of fire, or
of any other heating cause. We should be greatly deceived if we
referred only to sensation as an indication of the presence of this
cause. Many of those things which excite in our organs, and
especially of those of taste, a sensation of heat, owe this property to
chemical stimulants, and not at all to their being actually hot. This
error of judgment has produced a corresponding confusion of
55
language, and hence had actually at one period crept into physical
philosophy a great many illogical and absurd conclusions. Again,
there are a number of chemical agents, which, from their corroding,
blackening, and dissolving, or drying up the parts of some
descriptions of bodies, and producing on them effects not generally
unlike (though intrinsically very different from) those produced by
heat, are said, in loose and vulgar language, to burn them; and this
error has even become rooted into a prejudice, by the fact that
some of these agents are capable of becoming actually and truly hot
during their action on moist substances, by reason of their
combination with the water the latter contain. Thus, quicklime and
oil of vitriol both exercise a powerful corrosive action on animal and
vegetable substances, and both become violently hot by their
combination with water. They are, therefore, set down in vulgar
parlance as substances of a hot nature; whereas, in their relations to
the physical cause of heat, they agree with the generality of bodies
similarly constituted.
(346.) The nature of heat has hitherto been chiefly studied
under the general heads of—

1st, Its sources, or the phenomena which it usually


accompanies.
2d, Its communication from its sources to substances capable
of receiving it, and from these to others, with a view to
discover the laws which regulate its distribution
through space or through the bodies which occupy it.
3d, Its effects, on our senses, and on the bodies to which it is
communicated in its various degrees of intensity, by
which, means are afforded us of measuring these
degrees.
4th, Its intimate relations to the atoms of matter, as exhibited
in its capability of acquiring a latent state under certain
circumstances, and of entering into something like
chemical combinations.

(347.) The most obvious sources of heat are, the sun, fire,
animal life, fermentations, violent chemical actions of all kinds,
friction, percussion, lightning, or the electric discharge, in whatever
manner produced, the sudden condensation of air, and others, so
numerous, and so varied, as to show the extensive and important
part it has to perform in the economy of nature. The discoveries of
chemists, however, have referred most of these to the general head
of chemical combination. Thus, fire, or the combustion of
inflammable bodies, is nothing more than a violent chemical action
attending the combination of their ingredients with the oxygen of the
air. Animal heat is, in like manner, referable to a process bearing no
remote analogy to a slow combustion, by which a portion of carbon,
an inflammable principle existing in the blood, is united with the
oxygen of the air in respiration; and thus carried off from the
system: fermentation is nothing more than a decomposition of
chemical elements loosely united, and their re-union in a more
permanent state of combination. The analogy between the sun and
terrestrial fire is so natural as to have been chosen by Newton to
exemplify the irresistible force of an inference derived from that
principle. But the nature of the sun and the mode in which its
wonderful supply of light and heat is maintained are involved in a
mystery which every discovery that has been made either in
chemistry or optics, so far from elucidating, seems only to render
more profound. Friction as a source of heat is well known: we rub
our hands to warm them, and we grease the axles of carriage-
wheels to prevent their setting fire to the wood; an accident which,
in spite of this precaution, does sometimes happen. But the effect of
friction, as a means of producing heat with little or no consumption
of materials, was not fully understood till made the subject of direct
experiment by count Rumford, whose results appear to have
established the extraordinary fact, that an unlimited supply of heat
may be derived by friction from the same materials. Condensation,
whether of air by pressure, or of metals by percussion, is another
powerful source of heat. Thus, iron may be so dexterously
hammered as to become red-hot, and the rapid condensation of a
confined portion of air will set tinder on fire.
(348.) The most violent heats known are produced by the
concentration of the solar rays by burning glasses,—by the
combustion of oxygen and hydrogen gases mixed in the exact
proportion in which they combine to produce water,—and by the
discharge of a continued and copious current of electricity through a
small conductor. As these three sources of heat are independent of
each other, and each capable of being brought into action in a very
confined space, there seems no reason why they might not all three
be applied at once at the same point, by which means, probably,
effects would be produced infinitely surpassing any hitherto
witnessed.
(349.) Heat is communicated either by radiation between bodies
at a distance, or by conduction between bodies in contact, or
between the contiguous parts of one and the same body. The laws
of the radiation of heat have been studied with great attention, and
have been found to present strong analogies with that of light in
some points, and singular differences in others. Thus, the heat
which accompanies the sun’s rays comports itself, in all respects, like
light; being subject to similar laws of reflection, refraction, and even
of polarization, as has been shown by Berard. Yet they are not
identical with each other; Sir William Herschel having shown, by
decisive experiments, verified by those of Sir H. Englefield, that
there exist in a solar beam both rays of heat which are not luminous,
and rays of light which have no heating power.
(350.) The heat, radiated by terrestrial fires, and by bodies
obscurely hot, by whatever means they have acquired their heat
(even by exposure to the sun’s rays), differs very materially from
solar heat in their power of penetrating transparent substances. This
singular and important difference was first noticed by Mariotte, and
afterwards made the subject of many curious and interesting
experiments by Scheele, who found that terrestrial heat, or that
radiated from fires or heated bodies, is intercepted and detained by
glass or other transparent bodies, while solar heat is not; and that,
being so detained, it heats them: which the latter, as it passes freely
through them, is incapable of doing. The more recent researches of
Delaroche, however, have shown that this detention is complete only
when the temperature of the source of heat is low; but that, as that
temperature is higher, a portion of the heat radiated acquires a
power of penetrating glass; and that the quantity which does so
bears continually a larger and larger proportion to the whole, as the
heat of the radiant body is more intense. This discovery is very
important, as it establishes a community of nature between solar
and terrestrial heat; while at the same time it leads us to regard the
actual temperature of the sun as far exceeding that of any earthly
flame.
(351.) A variety of theories have been framed to account for
these curious phenomena; but the subject stands rather in need of
further elucidation from experiment, and is one which merits, and
will probably amply repay, the labours of those who may hereafter
devote their attention to it. The theory of the radiation of heat, in
general, which seems to agree best with the known phenomena, is
that of M. Prevost, who considers all bodies as constantly radiating
out heat in all directions, and receiving it by a similar means of
communication from others, and thus tending, in any space filled,
wholly or in part, with bodies at various temperatures, to establish
an equilibrium or equality of heat in all parts. The application of this
idea to the explanation of the phenomenon of dew we have already
seen (see 167.). The laws of such radiation, under various
circumstances, have been lately investigated in a beautiful series of
experiments on the cooling of bodies by their own radiation in
vacuo, by Messrs. Dulong and Petit, which offer some of the best
examples in science of the inductive investigation of quantitative
laws.
(352.) The communication of heat between bodies in contact, or
between the different parts of the same body, is performed by a
process called conduction. It is, in fact, only a particular case of
radiation, as has been explained above (217.); but a case so
particular as to require a separate and independent investigation of
its laws. The most important consideration introduced into the
enquiry by this peculiarity is that of time. The communication of heat
by conduction is performed, for the most part, with extreme
slowness, while that performed by direct radiation is probably not
less rapid than the propagation of light itself. The analysis of the
delicate and difficult points which arise in the investigation of this
subject in its reduction to direct geometrical treatment has been
executed with admirable success by the late Baron Fourrier, whose
recent lamented death has deprived science of an ornament it could
ill spare, thinned as its ranks have been within the last few years.
This acute philosopher and profound mathematician has developed,
in a series of elaborate memoirs presented to the French Institute,
the laws of the communication of heat through the interior of solid
masses, placed under the influence of any external heating and
cooling causes, and has in particular applied his results to the
conditions on which the maintenance of the actual observed
temperature on the earth’s surface depends; to the possible
influence of a supposed central heat on our climates; and to the
determination of the actual amount of the heat, derived to us from
the sun, or at least that portion of it on which the difference of the
seasons depends.
(353.) The principal effects of heat are the sensations of warmth
or cold consequent on its entry or egress into or out of our bodies;
the dilatation it causes in the dimensions of all substances in which it
is accumulated; the changes of state it produces in the melting of
solids, and the conversion of them and of liquids into vapour; and
the chemical changes it performs by actual decompositions effected
in the intimate molecules of various substances, especially those of
which vegetables and animals are composed; to which we may add,
the production of electric phenomena under certain circumstances in
the contact of metals, and the developement of electric polarity in
crystallised substances.
(354.) Cold has been considered by some as a positive quality,
the effect of a cause antagonist to that of heat; but this idea seems
now (with perhaps a single exception) to be universally abandoned.
The sensation of cold is as easily explicable by the passage of heat
outwards through the surface of the body as that of heat by its
ingress from without; and the experiments cited in proof of a
radiation of cold are all perfectly explained by Prevost’s theory of
reciprocal interchange. It is remarkable, however, how very limited
our means of producing intense cold are, compared with those we
possess of effecting the accumulation of heat in bodies. This is one
of the strongest arguments adducible in favour of the doctrines of
those who maintain the possibility of exhausting the heat of a body
altogether, and leaving it in a state absolutely devoid of it. But we
ought to consider, that the known methods of generating heat
chiefly turn on the production of chemical combinations: we may
easily conceive, therefore, that, to obtain equally powerful
corresponding frigorific effects, we ought to possess the means of
effecting a disunion equally extensive and rapid between such
elements, actually combined, as have already produced heat by their
union. This, however, we can only accomplish by engaging them in
combinations still more energetic, that is to say, in which we may
reasonably expect more heat to be produced by the new
combination than would be destroyed or abstracted by the proposed
decomposition. Chemistry, however, (unaided by electric agency,)
affords no means of suddenly breaking the union of two elements,
and presenting both in an uncombined state. A certain analogy to
such disunion, however, and its consequences, may be traced in the
sudden expansion of condensed gases from a liquid state into
vapour, which is the most powerful source of cold known.
(355.) The dilatation of bodies by heat forms the subject of that
branch of science called pyrometry. There is no body but is capable
of being penetrated by heat, though some with greater, others with
less rapidity; and being so penetrated, all bodies (with a very few
exceptions, and those depending on very peculiar circumstances,)
are dilated by it in bulk, though with a great diversity in the amount
of dilatation produced by the same degree of heat. Of the several
forms of natural bodies, gases and vapours are observed to be most
dilatable; liquids next, and solids least of all. The dilatation of solids
has been made a subject of repeated and careful measurement by
several experimenters; among whom, Smeaton, Lavoisier, and
Laplace, are the principal. The remarkable discovery of the unequal
dilatation of crystallised bodies by Mitscherlich has already been
spoken of. (266.) That of gases and vapours was examined about
the same time by Dalton and Gay-Lussac, who both arrived
independently at the conclusion of an equal dilatability subsisting in
them all, which constitutes one of the most remarkable points in
their history.
(356.) The dilatation of air by heat affords, perhaps, the most
unexceptionable means known of measuring degrees of heat. The
thermometer, as originally constructed by Cornelius Drebell, was an
air thermometer. Those now in common use measure accessions of
heat not by the degree of dilatation of air but of mercury. It has
been shown, by the researches of Dulong and Petit, that its
indications coincide exactly with that of the air-thermometer in
moderate temperatures; though at very elevated ones they exhibit a
sensible, and even considerable, deviation. By this instrument, which
owes its present convenience and utility to the happy idea of
Newton, who first thought of fixing determinate points on its scale,
we are enabled to estimate, or at least identify, the degrees of heat;
and thereby to investigate with accuracy the laws of its
communication and its other properties. Were we sure that equal
additions of heat produced equal increments of dimension in any
substance, the indications of a thermometer would afford a true and
secure measure of the quantity present; but this is so far from being
the case, that we are nearly in total ignorance on this important
point; a circumstance which throws the greatest difficulty in the way
of all theoretical reasoning, and even of experimental enquiry. The
laws of the dilatation of liquids, in consequence of this deficiency of
necessary preliminary knowledge, are still involved in great obscurity,
notwithstanding the pains which have been bestowed on them by
the elaborate experiments and calculations of Gilpin, Blagden, Deluc,
Dalton, Gay-Lussac, and Biot.
(357.) The most striking and important of the effects of heat
consist, however, in the liquefaction of solid substances, and the
conversion of the liquids so produced into vapour. There is no solid
substance known which, by a sufficiently intense heat, may not be
melted, and finally dissipated in vapour; and this analogy is so
extensive and cogent, that we cannot but suppose that all those
bodies which are liquid under ordinary circumstances, owe their
liquidity to heat, and would freeze or become solid if their heat could
be sufficiently reduced. In many we see this to be the case in
ordinary winters; for some, severe frosts are requisite; others freeze
only with the most intense artificial colds; and some have hitherto
resisted all our endeavours; yet the number of these last is few, and
they will probably cease to be exceptions as our means of producing
cold become enlarged.
(358.) A similar analogy leads us to conclude that all aëriform
fluids are merely liquids kept in the state of vapour by heat. Many of
them have been actually condensed into the liquid state by cold
accompanied with violent pressure; and as our means of applying
these causes of condensation have improved, more and more
refractory ones have successively yielded. Hence we are fairly
entitled to extend our conclusion to those which we have not yet
been able to succeed with; and thus we are led to regard it as a
general fact, that the liquid and aëriform or vaporous states are
entirely dependent on heat; that were it not for this cause, there
would be nothing but solids in nature; and that, on the other hand,
nothing but a sufficient intensity of heat is requisite to destroy the
cohesion of every substance, and reduce all bodies, first to liquids,
and then into vapour.
(359.) But solids, themselves, by the abstraction of heat shrink
in dimension, and at the same time become harder, and more brittle;
yielding less to pressure, and permitting less separation between
their parts by tension. These facts, coupled with the greater
compressibility of liquids, and the still greater of gases, strongly
induce us to believe that it is heat, and heat alone, which holds the
particles of all bodies at that distance from each other which is
necessary to allow of compression; which in fact gives them their
elasticity, and acts as the antagonist force to their mutual attraction,
which would otherwise draw them into actual contact, and retain
them in a state of absolute immobility and impenetrability. Thus we
learn to regard heat as one of the great maintaining powers of the
universe, and to attach to all its laws and relations a degree of
importance which may justly entitle them to the most assiduous
enquiry.
(360.) It was first ascertained by Dr. Black that when heat
produces the liquefaction of a solid, or the conversion of a liquid into
vapour, the liquid or the vapour resulting is no hotter than the solid
or liquid from which it was produced, though a great deal of heat
has been expended in producing this effect, and has actually entered
into the substance.
(361.) Hence he drew the conclusion that it has become latent,
and continues to exist in the product, maintaining it in its new state,
without increasing its temperature. He further proved, that when the
vapour condenses, or the liquid freezes, this latent heat is again
given out from it. This great discovery, with its natural and hardly
less important concomitant, that of the difference of specific heats in
different bodies, or the different quantities of heat they require to
raise their temperature equally, are the chief reasons for regarding
heat as a material substance in a more decided manner than light,
with which in its radiant state it holds so close an analogy.
(362.) The subject of latent heat has been far less attentively
studied than its great practical importance would appear to demand,
when we consider that it is to this part of physical science that the
theory of the steam-engine is mainly referable, and that material
improvements may not unreasonably be expected in that wonderful
instrument, from a more extended knowledge than we possess of
the latent heats of different vapours. This is not the case, however,
with the subject of specific heat, which was followed up immediately
after its first promulgation with diligence by Irvine; and, after a brief
interval, by Lavoisier and Laplace, as well as by our countryman
Crawfurd, who determined the specific heats of many substances,
both solid and liquid. After a considerable period of inactivity, the
subject was again resumed by Delaroche and Berard, and
subsequently by Dulong and Petit: the result of whose investigations
has been the inductive establishment of one of those simple and
elegant physical laws which carry with them, if not their own
evidence, at least their own recommendation to our belief, as being
in unison with every thing we know of the harmony of nature. The
law to which we allude is this:—that the atoms of all the simple
chemical elements have exactly the same capacity for heat, or are all
equally heated or cooled by equal accessions or abstractions of heat.
It is only among laws like this that we can expect to find a clew
capable of guiding us to a knowledge of the true nature of heat, and
its relations to ponderable matter.

Magnetism and Electricity.


(363.) These two subjects, which had long maintained a distinct
existence, and been studied as separate branches of science, are at
length effectually blended. This is, perhaps, the most satisfactory
result which the experimental sciences have ever yet attained. All
the phenomena of magnetic polarity, attraction, and repulsion, have
at length been resolved into one general fact, that two currents of
electricity, moving in the same direction repel, and in contrary
directions attract, each other. The phenomena of the communication
of magnetism and what is called its induced state, alone remain
unaccounted for; but the interesting theory which has been
developed by M. Ampere, under the name of Electro-dynamics, holds
out a hope that this difficulty will also in its turn give way, and the
whole subject be at length completely merged, as far as the
consideration of the acting causes goes, in the more general one of
electricity. This, however, does not prevent magnetism from
maintaining its separate importance as a department of physical
enquiry, having its own peculiar laws and relations of the highest
practical interest, which are capable of being studied quite apart
from all consideration of its electrical origin. And not only so, but to
study them with advantage, we must proceed as if that origin were
totally unknown, and, at least up to a certain point, and that a
considerably advanced one, conduct our enquiries into the subject
on the same inductive principles as if this branch of physics were
absolutely independent of all others.
(364.) Iron, and its oxides and alloys, were for a long time the
only substances considered susceptible of magnetism. The loadstone
was even one of the examples produced by Bacon of that class of
physical instances to which he applies the term “Instantiæ
monodicæ”—singular instances. And the history of magnetism
affords a beautiful comment on his remark on instances of this sort.
“Nor should our enquiries,” he observes, “into their nature be broken
off, till the properties and qualities found in such things as may be
esteemed wonders in nature are reduced and comprehended under
some certain law; so that all irregularity or singularity may be found
to depend upon some common form, and the wonder only rest in
the exact differences, degrees, or extraordinary concurrence, and
not in the species itself.” The discovery of the magnetism of nickel,
which though inferior to that of iron, is still considerable; that of
cobalt, yet feebler, and that of titanium, which is only barely
perceptible, have effectually broken down the imaginary limit
between iron and the other materials of the world, and established
the existence of that general law of continuity which it is one chief
business of philosophy to trace throughout nature. The more recent
discoveries of M. Arago (mentioned in 160.) have completed this
generalization, by showing that there is no substance but which,
under proper circumstances, is capable of exhibiting unequivocal
signs of the magnetic virtue. And to obliterate all traces of that line
of separation which was once so broad, we are now enabled, by the
great discovery of Oërsted, to communicate at and during pleasure
to a coiled wire of any metal indifferently all the properties of a
magnet;—its attraction, repulsion, and polarity; and that even in a
more intense degree than was previously thought to be possible in
the best natural magnets. In short, in this case, and in this case
only, perhaps, in science, have we arrived at that point which Bacon
seems to have understood by the discovery of “forms.” “The form of
any nature,” says he, “is such, that where it is, the given nature
must infallibly be. The form, therefore, is perpetually present when
that nature is present; ascertains it universally, and accompanies it
every where. Again, this form is such, that when removed, the given
nature infallibly vanishes. Lastly, a true form is such as can deduce a
given nature from some essential property, which resides in many
things.”
(365.) Magnetism is remarkable in another important point of
view. It offers a prominent, or “glaring instance” of that quality in
nature which is termed polarity (267.), and that under circumstances
which peculiarly adapt it for the study of this quality. It does not
appear that the ancients had any knowledge of this property of the
magnet, though its attraction of iron was well known to them. The
first mention of it in modern times cannot be traced earlier than
1180, though it was probably known to the Chinese before that
time. The polarity of the magnet consists in this, that if suspended
freely, one part of it will invariably direct itself towards a certain
point in the horizon, the other towards the opposite point; and that,
if two magnets, so suspended, be brought near each other, there will
take place a mutual action, in consequence of which, the positions of
both will be disturbed, in the same manner as would happen if the
corresponding parts of each repelled, and those oppositely directed
attracted, each other; and by properly varying the experiment, it is
found that they really do so. If a small magnet, freely suspended, be
brought into the neighbourhood of a larger one, it will take a
position depending on the position of the poles of the larger one,
with respect to its point of suspension. And it has been ascertained
that these and all other phenomena exhibited by magnets in their
mutual attractions and repulsions are explicable on the supposition
of two forces or virtues lodged in the particles of the magnets, the
one predominating at one end, the other at the other; and such that
each particle shall attract those in which the opposite virtue to its
own prevails, and repel those in which a similar one resides with a
force proportional to the inverse square of their mutual distance.
(366.) The direction in which a magnetic bar, or needle of steel,
freely suspended, places itself, has been ascertained to be different
at different points of the earth’s surface. In some places it points
exactly north and south, in others it deviates from this direction
more or less, and at some actually stands at right angles to it. This
remarkable phenomenon, which is called the variation of the needle,
and which was discovered by Sebastian Cabot in the year 1500, is
accompanied with another called the dip, noticed by Robert Norman
in 1576. It consists in a tendency of a needle, nicely balanced on its
centre, when unmagnetized, to dip or point downwards when
rendered magnetic, towards a point below the horizon, and situated
within the earth. By tracing the variation and dip over the whole
surface of the globe, it has been found that these phenomena take
place as they would do if the earth itself were a great magnet,
having its poles deeply situated below the surface,—and, what is
very remarkable, possessing a slow motion within it, in consequence
of which neither the variation nor dip remain constantly the same at
the same place. The laws of this motion are at present unknown;
but the discovery of electro-magnetism, by rendering it almost
certain that the earth’s magnetism is merely an effect of the
continual circulation of great quantities of electricity round it, in a
direction generally corresponding with that of its rotation, have
dissipated the greater part of the mystery which hung over these
phenomena; since a variety of causes, both geological and others,
may be imagined which may produce considerable deviations in the
intensity, and partial ones in the direction, of such electric currents.
The unequal distribution of land and sea in the two hemispheres, by
affecting the operation of the sun’s heat in producing evaporation
from the latter, which is probably one of the great sources of
terrestrial electricity, may easily be conceived to modify the general
tendency of such currents, and to produce irregularities in them,
which may render a satisfactory account of whatever still appears
anomalous in the phenomena of terrestrial magnetism. This branch
of science thus becomes connected, on a great scale, with that of
meteorology, one of the most complicated and difficult, but at the
same time interesting, subjects of physical research; one, however,
which has of late begun to be studied with a diligence which
promises the speedy disclosure of relations and laws of which at
present we can form but a very imperfect notion.
(367.) The communication of magnetism from the earth to a
magnetic body, or from one magnetic body to another, is performed
by a process to which the name of induction has been given, and
the laws and properties of such induced magnetism have been
studied with much perseverance and success,—practically, by
Gilbert, Boyle, Knight, Whiston, Cavallo, Canton, Duhamel,
Rittenhouse, Scoresby, and others; and theoretically, by Æpinus,
Coulomb, and Poisson, and in our own country by Messrs. Barlow
and Christie, who have investigated with great care the curious
phenomena which take place when masses of iron are presented
successively, in different positions, by rotation on an axis, to the
influence of the earth’s magnetism. The magnetism of crystallized
bodies (partly from the extreme rarity of such as are susceptible of
any considerable magnetic virtue) has not hitherto been at all
examined, but would probably afford very curious results.
(368.) To electricity the views of the physical enquirer now turn
from almost every quarter, as to one of those universal powers
which Nature seems to employ in her most important and secret
operations. This wonderful agent, which we see in intense activity in
lightning, and in a feebler and more diffused form traversing the
upper regions of the atmosphere in the northern lights, is present,
probably in immense abundance, in every form of matter which
surrounds us, but becomes sensible only when disturbed by
excitements of peculiar kinds. The most effectual of these is friction,
which we have already observed to be a powerful source of heat.
Everybody is familiar with the crackling sparks which fly from a cat’s
back when stroked. These, by proper management, may be
accumulated in bodies suitably disposed to receive them, and,
although then no longer visible, give evidence of their existence by
the exhibition of a vast variety of extraordinary phenomena,—
producing attractions and repulsions in bodies at a distance,—
admitting of being transferred by contact, or by sudden and violent
transilience of the interval of separation, from one body to another,
under the form of sparks and flashes;—traversing with perfect
facility the substance of the densest metals, and a variety of other
bodies called conductors, but being detained by others, such as
glass, and especially air, which are thence called non-conductors,—
producing painful shocks and convulsive motions, and even death
itself if in sufficient quantity, in animals through which they pass,
and finally imitating, on a small scale, all the effects of lightning.
(369.) The study of these phenomena and their laws until a
comparatively recent period occupied the entire attention of
electricians, and constituted the whole of the science of electricity. It
appears, as the result of their enquiries, that all the phenomena in
question are explicable on the supposition that electricity consists in
a rare, subtle, and highly elastic fluid, which in its tendency to
expand and diffuse itself pervades with more or less facility the
substance of conductors, but is obstructed and detained from
expansion more or less completely by non-conductors. It is
supposed, moreover, that this electric fluid possesses a power of
attraction for the particles of all ponderable matter, together with
that of a repulsion for particles of its own kind. Whether it has
weight, or is rather to be regarded as a species of matter distinct
from that of which ponderable bodies consist, is a question of such
delicacy, that no direct experiments have yet enabled us to decide it;
but at all events its inertia compared with its elastic force must be
conceived excessively small, so that it is to be regarded as a fluid in
the highest degree active, obeying every impulse, internal or
external, with the greatest promptitude; in short, a fluid whose
energies can only be compared with those of the ethereal medium
by which, in the undulatory doctrine, light is supposed to be
conveyed. The properties of hydrogen gas compared with those of
the denser aëriform fluids will, in some slight degree, aid our
conception of the excessive mobility and penetrating activity of a
fluid so constituted. Electricity, however, must be regarded as
differing in some remarkable points from all those fluids to which we
have hitherto been accustomed to apply the epithet elastic, such as
air, gases, and vapours. In these, the repulsive force of the particles
on which their elasticity depends is considered as extending only to
very small distances, so as to affect only those in the immediate
vicinity of each other, while their attractive power, by which they
obey the general gravitation of all matter, extends to any distance.
In electricity, on the other hand, the very reverse must be admitted.
The force by which its particles repel each other extends to great
distances, while its force of adhesion to ponderable matter must be
regarded as limited in its extent to such minute intervals as escape
observation.
(370.) The conception of a single fluid of this kind, which when
accumulated in excess in bodies tends constantly to escape, and
seek a restoration of equilibrium by communicating itself to any
others where there may be a deficiency, is that which occurs most
naturally to the mind, and was accordingly maintained by Franklin,
to whom the science of electricity is under great obligations for
those decisive experiments which informed us respecting the true
nature of lightning. The same theory was afterwards advocated by
Æpinus, who first showed how the laws of equilibrium of such a fluid
might be reduced to strict mathematical investigation. But there are
phenomena accompanying its transfer from body to body and the
state of equilibrium it affects under various circumstances, which
appear to require the admission of two distinct fluids antagonist to
each other, each attracting the other, and repelling itself; but each,
alike, susceptible of adhesion to material substances, and of transfer
more or less rapid from particle to particle of them. These fluids in
the natural undisturbed state are conceived to exist in a state of
combination and mutual saturation; but this combination may be
broken, and either of them separately accumulated in a body to any
amount without the other, provided its escape be properly
obstructed by surrounding it with non-conductors. When so
accumulated, its repulsion for its own kind and attraction of the
opposite species in neighbouring bodies tends to disturb the natural
equilibrium of the two fluids present in them, and to produce
phenomena of a peculiar description, which are termed induced
electricity. Curious and artificial as this theory may appear, there has
hitherto been produced no phenomenon of which it will not afford at
least a plausible, and in by far the majority of cases a very
satisfactory, explanation. It has one character which is extremely
valuable in any theory, that of admitting the application of strict
mathematical reasoning to the conclusions we would draw from it.
Without this, indeed, it is scarcely possible that any theory should
ever be fairly brought to the test by a comparison with facts.
Accordingly, the mathematical theory of electrical equilibrium, and
the laws of the distribution of the electric fluids over the surfaces of
bodies in which they are accumulated, have been made the subject
of elaborate geometrical investigation by the most expert
mathematicians, and have attained a degree of extent and elegance
which places this branch of science in a very high rank in the scale
of mathematico-physical enquiry. These researches are grounded on
the assumption of a law of attraction and repulsion similar to those
of gravity and magnetism, and which by the general accordance of
the results with facts, as well as by experiments instituted for the
express purpose of ascertaining the laws in question, are regarded
as sufficiently demonstrated.
(371.) The most obscure part of the subject is no doubt the
original mode of disturbance of electrical equilibrium, by which
electricity is excited in the first instance, either by friction or by any
other of those causes which have been ascertained to produce such
56
an effect: analogies, it is true, are not wanting ; but it must be
allowed that hitherto nothing decisive has been offered on the
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

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


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

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


personal growth every day!

ebookbell.com

You might also like