A Gentle Introduction to Scientific Computing Chapman Hall CRC Numerical Analysis and Scientific Computing Series 1st Edition Dan Stanescupdf download
A Gentle Introduction to Scientific Computing Chapman Hall CRC Numerical Analysis and Scientific Computing Series 1st Edition Dan Stanescupdf download
https://ebookmeta.com/product/introduction-to-computational-
engineering-with-matlab-chapman-hall-crc-numerical-analysis-and-
scientific-computing-series-1st-edition-timothy-bower/
https://ebookmeta.com/product/deep-learning-and-scientific-
computing-with-r-torch-chapman-hall-crc-the-r-series-1st-edition-
sigrid-keydana/
https://ebookmeta.com/product/introduction-to-scientific-
computing-and-data-analysis-2nd-edition-mark-h-holmes/
https://ebookmeta.com/product/gender-and-the-european-labour-
market-1st-edition-francesca-bettio-janneke-plantenga-mark-
smith-2/
A First Look at Communication Theory, 11th Edition
(International Student Edition) Em Griffin
https://ebookmeta.com/product/a-first-look-at-communication-
theory-11th-edition-international-student-edition-em-griffin/
https://ebookmeta.com/product/what-is-beauty-a-multidisciplinary-
approach-to-aesthetic-experience-1st-edition-martino-rossi-monti-
editor/
https://ebookmeta.com/product/the-whispered-word-secret-book-
scone-society-mystery-2-ellery-adams-2/
https://ebookmeta.com/product/keys-to-the-production-office-
unlocking-success-as-an-office-production-assistant-in-film-
television-1st-edition-jennifer-a-haire/
https://ebookmeta.com/product/power-mage-4-1st-edition-hondo-
jinx/
Speak No Evil 1st Edition Jewel Killian
https://ebookmeta.com/product/speak-no-evil-1st-edition-jewel-
killian/
A Gentle Introduction
to Scientific
Computing
Numerical Analysis and Scientific Computing Series
Series Editors:
Frederic Magoules, Choi-Hong Lai
About the Series
This series, comprising of a diverse collection of textbooks, references, and handbooks,
brings together a wide range of topics across numerical analysis and scientific computing.
The books contained in this series will appeal to an academic audience, both in
mathematics and computer science, and naturally find applications in engineering and the
physical sciences.
Dan Stanescu
University of Wyoming, USA
Long Lee
University of Wyoming, USA
MATLAB® is a trademark of The MathWorks, Inc. and is used with permission. The
MathWorks does not warrant the accuracy of the text or exercises in this book. This book's
use or discussion of MATLAB® software or related products does not constitute
endorsement or sponsorship by The MathWorks of a particular pedagogical approach or
particular use of the MATLAB® software.
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 [email protected]
Trademark notice: Product or corporate names may be trademarks or registered trademarks
and are used only for identification and explanation without intent to infringe.
DOI: 10.1201/9780429262876
Publisher's note: This book has been prepared from camera-ready copy provided by the
authors.
Contents
Preface
1 Introduction
1.1 Scientific Computing
1.2 MATLAB®: What and Why?
1.3 A Word of Caution
1.4 Additional Resources
3 Basics of MATLAB®
3.1 Defining and Using Scalar Variables
3.2 Saving and Reloading the Workspace
3.3 Defining and Using Arrays
3.4 Operations on Vectors and Matrices
3.5 More on Plotting Functions of One Variable
3.6 Loops and Logical Operators
3.7 Working with Indices and Arrays
3.8 Organizing Your Outputs
3.9 Number Representation
3.10 Machine Epsilon
3.11 Exercises
5 Systems of Equations
5.1 Linear Systems
5.2 Newton's Method for Nonlinear Systems
5.3 MATLAB® Built-in Functions
5.4 Exercises
6 Approximation of Functions
6.1 A Hypothetical Example
6.2 Global Polynomial Interpolation
6.3 Spline Interpolation
6.4 Approximation with Trigonometric Functions
6.5 MATLAB® Built-in Functions
6.6 Exercises
7 Numerical Differentiation
7.1 Basic Derivative Formulae
7.2 Derivative Formulae Using Taylor Series
7.3 Derivative Formulae Using Interpolants
7.4 Errors in Numerical Differentiation
7.5 Richardson Extrapolation
7.6 MATLAB® Built-in Functions
7.7 Exercises
8 Numerical Optimization
8.1 The Need for Optimization Methods
8.2 Line Search Methods
8.3 Successive Parabolic Interpolation
8.4 Optimization Using Derivatives
8.5 Linear Programming
8.6 Constrained Nonlinear Optimization
8.7 MATLAB® Built-in Functions
8.8 Exercises
9 Numerical Quadrature
9.1 Basic Quadrature Formulae
9.2 Gauss Quadrature
9.3 Extrapolation Methods: Romberg Quadrature
9.4 Higher-Dimensional Integrals
9.5 Monte Carlo Integration
9.6 MATLAB® Built-in Functions
9.7 Exercises
Bibliography
Index
Preface
“M A T T H E W THORNTON,
AN HONEST MAN.”
WILLIAM FLOYD.
Private virtue and undisguised sincerity were marked
characteristics of the revolutionary patriots. They were actuated by
pure and honest motives, and not by wild ambition and political
phrenzy. Noisy partisans and intriguing demagogues were not the
favourites of the people during the war of independence. The man
of genuine worth and modest merit was the one whom they
delighted to honour and trust.
In the character of William Floyd these qualities were happily
blended. He was a native of Suffolk, Long Island, in the state of New
York, born on the 17th of December, 1734. His grandfather, Richard
Floyd, immigrated from Wales in 1680, and settled at Setauket, Long
Island. During his childhood he was remarkable for frankness and
truth, and for amiableness of disposition and urbanity of manners.
He was an industrious student, and acquired a liberal education.
During the prosecution of his studies, he preserved his health in its
full vigour, by devoting a short period almost, daily to the use of his
gun, in pursuit of game, the only diversion to which he was ardently
attached. This exercise gave his system a healthy tone, and enabled
him to master his lessons with more accuracy than some who
confine themselves exclusively to their rooms, and become
debilitated for the want of physical action. Upon the health of the
body the improvement of the juvenile mind very much depends—
exercise in the open air should not be neglected.
The father of William M’Nicoll Floyd died before this son arrived
at his majority, and left him an ample fortune. He managed it with
prudence and economy, and when his country was doomed to pass
through the fiery furnace of a revolution, he was one of the most
opulent and influential men on Long Island. From his youth he had
been the advocate of liberal principles, and opposed to the
innovations of the British ministry, upon the chartered rights of the
American colonies. As oppression increased, his patriotic feelings
were more frequently and freely expressed, and when the Congress
of 1774 convened at Philadelphia, he was an active and zealous
member. By his uniform candour and purity of purpose, he gained
the unlimited confidence of his constituents and of his country. His
cool deliberation and calm deportment, under all circumstances,
were well calculated to preserve an equilibrium among those of a
more fiery temperament and of more rashness in action. The
Congress of 1774 was remarkable for clear and unanswerable
argument, calm and learned discussion, wise and judicious plans,
and reasonable but firm purposes. The course pursued operated
powerfully and favourably upon the minds of reflecting men, whose
influence it was important to obtain and secure.
Mr. Floyd also had command of the militia of his native county,
and when the British attempted to land at Gardner’s Bay, promptly
assembled them, and repelled the invading foe. In 1775 he was
again chosen a representative in Congress, and became one of its
active and efficient members. He was emphatically a working man,
and engaged constantly on important committee duties. During his
absence at Philadelphia, the British obtained possession of Long
Island, and forced his family to flee for their safety to Connecticut.
His property was materially injured by the enemy, and his mansion-
house converted into a military barrack, for the accommodation of
the invaders of his country. For seven years he was deprived of all
resources from his plantation, and was dependant upon his friends
for the protection of his family. The year following he was again
elected to a seat in the Continental Congress, and had the
satisfaction of affixing his name to the declaration of independence,
which he had advocated from its incipient stages to the time of its
adoption. In 1777 he was elected to the first senate of the state of
New York, convened under the new order of things. He immediately
became a prominent and leading member, and rendered important
services in forming a code of republican laws for the future
government of the empire state, carefully guarding the rights of
person and property inviolate.
In January, 1779, he again took his seat in the Continental
Congress, and entered upon the duties of his station with the utmost
vigour and industry. On the 24th of the ensuing August, he resumed
his station in the senate of his native state. Much important business
was before the legislature, requiring wisdom, energy, and unity of
action. To devise some plan of relief from a depreciated currency
and a prostrate credit, was an important item. Mr. Floyd was at the
head of a joint committee appointed for this purpose, and reported a
plan that proved him to be an able financier and a man of deep
thought and investigation. It was predicated upon a gradual and just
system of taxation, to be carried into effect by responsible and
honest agents, with good and sufficient sureties for the payment of
all monies collected to the proper officer—the state treasurer. In
October of that year, Mr. Floyd, Ezra L’Hommedieu, and John Loss
were appointed by the New York legislature delegates to a
convention of the eastern states convened for the purpose of
devising some system by which supplies of provisions could be more
readily obtained and preserved from the grasp of avaricious
monopolists.
Immediately after the discharge of the duties assigned him, he
again took his seat in Congress. On the third of December he was
elected one of the board of admiralty, and on the thirteenth of the
same month a member of the treasury board. By incessant
application to the various duties that devolved upon him, his health
became impaired, and in April following he obtained leave of
absence. In June he repaired to the senate of New York, and was
immediately appointed upon a joint committee to act upon
resolutions of Congress, involving the important relations between
the state and general government. He opposed, unsuccessfully, the
plan of making bills of credit a legal tender, but had the pleasure in
after life of seeing the principles he then advocated sanctioned and
adopted.
In September he was appointed upon a committee of the senate
to prepare a reply to the message of the governor. To effect a proper
organization of the general government, was the anxious desire of
the state legislatures. To confer upon Congress all necessary powers,
strictly defined and plain to be understood, was considered the only
safe policy to insure future safety. To this important subject the
governor had drawn the particular attention of the members. The
committee reported several resolutions on this point, which were
adopted and forwarded for the consideration of the national
legislature. They recommended the enactment of laws that should
produce an equal responsibility upon each of the states to bear its
pro rata proportion of the burden of the war, in the way and manner
that should be devised by the general government. In 1780 he was
again returned to Congress. In addition to the usual duties, he was
instructed by an act of the legislature, together with the other
members from New York, to obtain a settlement of the claims of his
native state, and those of New Hampshire, to the territory now
comprising the state of Vermont. This was a vexed question that
required much industry and wisdom to manage. These were
eminently possessed by Mr. Floyd, who, on that occasion, as upon all
others, discharged his duties to the entire satisfaction of his
constituents. He also, during the same session, introduced a
resolution for the cession of the western territories to the United
States. He also nominated, on the 10th of August, Robert L.
Livingston as secretary of foreign affairs, who was immediately
appointed to that important station.
In addition to serving in the senate of his own state, more or
less every year, he continued an active member of Congress until
1783, when he joined in the general joy of triumphant victory and
heart-cheering peace, and was once more permitted to return and
take possession of the ruins of his once flourishing plantation,
amidst the congratulation of his numerous friends, all animated by
the resplendent glories of LIBERTY. In order that he might repair his
private fortune, he declined the urgent request of his constituents to
consent to a re-election to Congress. He however continued to serve
in the senate of his native state until 1788, when he was returned a
member of the first Congress under the federal constitution. Worn
out in the service of his country, he retired at the end of his term
from the public arena, and once more entered upon the enjoyments
of domestic bliss.
Being possessed of a large tract of valuable land upon the banks
of the Mohawk river, then a dense wilderness, he commenced
gradual improvements upon it, and in 1803 took up his final
residence there. His friends often urged him to again become a
member of the national legislature, but he declined entering upon
any laborious public duties, except serving the district to which he
removed one term in the state senate, and also of serving as a
member of the convention of 1801, to revise the constitution of New
York. He was four times a member of the electoral college of his
state for the election of president and vice-president, and in 1800 he
travelled two hundred miles to give his vote for his old companion
and friend, Thomas Jefferson, in the dreary month of December.
He continued to improve his new plantation until he saw the
wilderness blossom as the rose, and his mansion surrounded by
happy neighbours, all basking in the clear sunshine of that freedom
he had been instrumental in acquiring. Envy was a stranger to his
philanthropic and patriotic bosom; he rejoiced in the happiness of
the whole human family; he delighted in the prosperity of all around
him.
In all things he was a practical man, free from pomp and vanity,
and systematic in all his proceedings. When his purposes were
formed, he prosecuted them with an unyielding energy that was
seldom arrested or thwarted. He was possessed of a clear head, a
strong mind, a good heart, a vigorous and sound judgment, matured
by long experience and a close observation of men and things. He
spoke but little in public assemblies, and rarely entered into debate.
Happy would it be for our country if we had more men like William
Floyd at the present day, instead of so many who talk more than
they work. Long speeches hang like an incubus over our legislatures,
and those who feel disposed, are prevented by them from doing the
business of the people promptly.
In all the private relations of life William Floyd presented a
model as worthy of imitation as that of his public career. He was
warm in his friendships, and most scrupulously honest in all his
transactions. His feelings and morals were of a refined cast, and the
most rigid integrity marked his every action. He thought and acted
for himself, and left others to do the same. He marked out his path
of duty from the reflections of his own mind, and pursued it steadily
and fearlessly. For more than fifty years he enjoyed the full fruition
of popular favours, and only one year before his death was elected a
member of the electoral college. His physical powers were
remarkable until a short time before his last illness. He was a man of
middle size, well formed, and of easy deportment. He was dignified
in his general appearance, and affable in his manners. For the last
two years of his life his health was partially impaired, and on the 1st
of August, 1821, he was seized with general debility, and on the
fourth day he folded his arms calmly, closed his eyes peacefully, and
met the cold embrace of death with the fortitude of a sage, a
patriot, and a Christian. Although general Floyd did not possess the
Ciceronian eloquence of an Adams, a Jefferson, or a Henry, he was
one of the most useful men of his day and generation. His examples
and his labours shed a lustre over his character, as rich and as
enduring as the fame of those who shone conspicuously in the
forum. He was an important link in the golden chain of liberty, and
was so esteemed by all his associates in Congress. The working man
was then properly appreciated. The most powerful orators of that
eventful era were concise and laconic. Long speeches were as
uncommon as they are now pernicious and unnecessary. The
business of our nation was performed promptly, expeditiously,
effectually, and economically. Let us imitate the examples of the
patriots of the times that tried their souls, and preserve, in its native
purity, the rich boon of liberty they have transmitted to us. Let us
emulate the virtues of general William Floyd, and we shall be highly
esteemed in life, deeply mourned in death, and our names will