0% found this document useful (0 votes)
41 views77 pages

Practical Matlab Modeling With Simulink Programming Ordinary and Partial Differential Equations 1st Edition Sulaymon L Eshkabilov Instant Download

The document is a comprehensive guide to MATLAB modeling with Simulink, focusing on programming and simulating ordinary and partial differential equations. Authored by Sulaymon L. Eshkabilov, it covers analytical and numerical methods for solving these equations, along with practical examples and applications. The book is intended for engineers and students in the field, providing essential tools and techniques for effective modeling.

Uploaded by

baqrliminola
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views77 pages

Practical Matlab Modeling With Simulink Programming Ordinary and Partial Differential Equations 1st Edition Sulaymon L Eshkabilov Instant Download

The document is a comprehensive guide to MATLAB modeling with Simulink, focusing on programming and simulating ordinary and partial differential equations. Authored by Sulaymon L. Eshkabilov, it covers analytical and numerical methods for solving these equations, along with practical examples and applications. The book is intended for engineers and students in the field, providing essential tools and techniques for effective modeling.

Uploaded by

baqrliminola
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/ 77

Practical Matlab Modeling With Simulink

Programming Ordinary And Partial Differential


Equations 1st Edition Sulaymon L Eshkabilov
download
https://ebookbell.com/product/practical-matlab-modeling-with-
simulink-programming-ordinary-and-partial-differential-
equations-1st-edition-sulaymon-l-eshkabilov-50195090

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.

Practical Matlab Modeling With Simulink Programming And Simulating


Ordinary And Partial Differential Equations Sulaymon L Eshkabilov

https://ebookbell.com/product/practical-matlab-modeling-with-simulink-
programming-and-simulating-ordinary-and-partial-differential-
equations-sulaymon-l-eshkabilov-10889488

Practical Matlab With Modeling Simulation And Processing Projects


Irfan Turk

https://ebookbell.com/product/practical-matlab-with-modeling-
simulation-and-processing-projects-irfan-turk-10555516

Development Of Innovative Drugs Via Modeling With Matlab A Practical


Guide 1st Edition Ronald Gieschke

https://ebookbell.com/product/development-of-innovative-drugs-via-
modeling-with-matlab-a-practical-guide-1st-edition-ronald-
gieschke-4606928

Financial Modelling Theory Implementation And Practice With Matlab


Source 1st Edition Joerg Kienitz

https://ebookbell.com/product/financial-modelling-theory-
implementation-and-practice-with-matlab-source-1st-edition-joerg-
kienitz-4151574
Practical Finite Element Modeling In Earth Science Using Matlab Guy
Simpson

https://ebookbell.com/product/practical-finite-element-modeling-in-
earth-science-using-matlab-guy-simpson-43394130

Network Modeling Simulation And Analysis In Matlab Theory And


Practices Hardcover Dacnhuong Le Abhishek Kumar Pandey T V M Sairam
Pramod Singh Rathore Jyotir Moy Chatterjee

https://ebookbell.com/product/network-modeling-simulation-and-
analysis-in-matlab-theory-and-practices-hardcover-dacnhuong-le-
abhishek-kumar-pandey-t-v-m-sairam-pramod-singh-rathore-jyotir-moy-
chatterjee-10461502

Network Modeling Simulation And Analysis In Matlab Theory And


Practices Chatterjee

https://ebookbell.com/product/network-modeling-simulation-and-
analysis-in-matlab-theory-and-practices-chatterjee-12074970

Practical Matlab Deep Learning A Projectsbased Approach 2nd Edition


2nd Michael Paluszek

https://ebookbell.com/product/practical-matlab-deep-learning-a-
projectsbased-approach-2nd-edition-2nd-michael-paluszek-46093502

Practical Matlab Applications For Engineers Misza Kalechman

https://ebookbell.com/product/practical-matlab-applications-for-
engineers-misza-kalechman-4345936
Practical MATLAB
Modeling with
Simulink
Programming and Simulating Ordinary
and Partial Differential Equations

Sulaymon L. Eshkabilov

www.allitebooks.com
Practical MATLAB
Modeling with Simulink
Programming and Simulating
Ordinary and Partial Differential
Equations

Sulaymon L. Eshkabilov

www.allitebooks.com
Practical MATLAB Modeling with Simulink: Programming and Simulating Ordinary
and Partial Differential Equations
Sulaymon L. Eshkabilov
Ag & Biosystems Engineering Department, North Dakota State University, Fargo, USA

ISBN-13 (pbk): 978-1-4842-5798-2 ISBN-13 (electronic): 978-1-4842-5799-9


https://doi.org/10.1007/978-1-4842-5799-9

Copyright © 2020 by Sulaymon L. Eshkabilov


This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information
storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now
known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the
trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not
identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the
material contained herein.
Managing Director, Apress Media LLC: Welmoed Spahr
Acquisitions Editor: Steve Anglin
Development Editor: Matthew Moodie
Coordinating Editor: Mark Powers
Cover designed by eStudioCalamar
Cover image from rawpixel.com
Distributed to the book trade worldwide by Springer Science+Business Media, 1 New York Plaza, New York,
NY 10004, U.S.A. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit
www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer
Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail [email protected]; for reprint, paperback, or audio rights,
please e-mail [email protected].
Apress titles may be purchased in bulk for academic, corporate, or promotional use. eBook versions and
licenses are also available for most titles. For more information, reference our Print and eBook Bulk Sales
web page at www.apress.com/bulk-sales.
Any source code or other supplementary material referenced by the author in this book is available to
readers on GitHub via the book’s product page, located at www.apress.com/9781484257982. For more
detailed information, please visit www.apress.com/source-code.
Printed on acid-free paper

www.allitebooks.com
To the memory of my father.
To my mother.
To my wife, Nigora, after 25 wonderful years together.

www.allitebooks.com
Table of Contents
About the Author��������������������������������������������������������������������������������������������������� xiii

About the Technical Reviewer���������������������������������������������������������������������������������xv


Acknowledgments�������������������������������������������������������������������������������������������������xvii

Introduction������������������������������������������������������������������������������������������������������������xix

Part I: Ordinary Differential Equations������������������������������������������������������������ 1


Chapter 1: Analytical Solutions for ODEs������������������������������������������������������������������ 3
Classifying ODEs��������������������������������������������������������������������������������������������������������������������������� 4
Example 1������������������������������������������������������������������������������������������������������������������������������������� 5
Example 2������������������������������������������������������������������������������������������������������������������������������������� 6
Example 3������������������������������������������������������������������������������������������������������������������������������������� 6
Analytical Solutions of ODEs��������������������������������������������������������������������������������������������������������� 8
dsolve( )����������������������������������������������������������������������������������������������������������������������������������� 8
Example 4������������������������������������������������������������������������������������������������������������������������������������� 8
Example 5������������������������������������������������������������������������������������������������������������������������������������� 9
Example 6����������������������������������������������������������������������������������������������������������������������������������� 11
Example 7����������������������������������������������������������������������������������������������������������������������������������� 11
Second-Order ODEs and a System of ODEs�������������������������������������������������������������������������������� 13
Example 8����������������������������������������������������������������������������������������������������������������������������������� 13
Example 9����������������������������������������������������������������������������������������������������������������������������������� 14
Example 10��������������������������������������������������������������������������������������������������������������������������������� 15
Example 11��������������������������������������������������������������������������������������������������������������������������������� 16
Example 12��������������������������������������������������������������������������������������������������������������������������������� 16
Example 13��������������������������������������������������������������������������������������������������������������������������������� 17
Laplace Transforms��������������������������������������������������������������������������������������������������������������������� 22

www.allitebooks.com
Table of Contents

Example 14��������������������������������������������������������������������������������������������������������������������������������� 24
laplace/ilaplace��������������������������������������������������������������������������������������������������������������������� 25
Example 15��������������������������������������������������������������������������������������������������������������������������������� 25
Example 16��������������������������������������������������������������������������������������������������������������������������������� 26
Example 17��������������������������������������������������������������������������������������������������������������������������������� 26
Example 18��������������������������������������������������������������������������������������������������������������������������������� 26
Example 19��������������������������������������������������������������������������������������������������������������������������������� 30
Example 20��������������������������������������������������������������������������������������������������������������������������������� 34
Example 21��������������������������������������������������������������������������������������������������������������������������������� 36
References���������������������������������������������������������������������������������������������������������������������������������� 40

Chapter 2: Numerical Methods for First-Order ODEs���������������������������������������������� 41


Euler Method������������������������������������������������������������������������������������������������������������������������������� 41
Example 1����������������������������������������������������������������������������������������������������������������������������������� 42
Improved Euler Method��������������������������������������������������������������������������������������������������������������� 44
Backward Euler Method�������������������������������������������������������������������������������������������������������������� 45
Example 2����������������������������������������������������������������������������������������������������������������������������������� 47
Midpoint Rule Method����������������������������������������������������������������������������������������������������������������� 50
Example 3����������������������������������������������������������������������������������������������������������������������������������� 51
Ralston Method��������������������������������������������������������������������������������������������������������������������������� 55
Runge-Kutta Method������������������������������������������������������������������������������������������������������������������� 56
Example 4����������������������������������������������������������������������������������������������������������������������������������� 57
Runge-Kutta-Gill Method������������������������������������������������������������������������������������������������������������ 60
Runge-Kutta-Fehlberg Method��������������������������������������������������������������������������������������������������� 63
Adams-Bashforth Method����������������������������������������������������������������������������������������������������������� 66
Example 5����������������������������������������������������������������������������������������������������������������������������������� 66
Milne Method������������������������������������������������������������������������������������������������������������������������������ 72
Example 6����������������������������������������������������������������������������������������������������������������������������������� 73
Taylor Series Method������������������������������������������������������������������������������������������������������������������ 75
Example 7����������������������������������������������������������������������������������������������������������������������������������� 75
Adams-Moulton Method������������������������������������������������������������������������������������������������������������� 78

vi
Table of Contents

Example 8����������������������������������������������������������������������������������������������������������������������������������� 80
MATLAB’s Built-in ODE Solvers��������������������������������������������������������������������������������������������������� 85
Example 9����������������������������������������������������������������������������������������������������������������������������������� 87
The OPTIONS, ODESET, and ODEPLOT Tools of Solvers���������������������������������������������������������� 93
Example 10��������������������������������������������������������������������������������������������������������������������������������� 95
Example 11��������������������������������������������������������������������������������������������������������������������������������� 98
Simulink Modeling�������������������������������������������������������������������������������������������������������������������� 103
Example 12������������������������������������������������������������������������������������������������������������������������������� 103
SIMSET�������������������������������������������������������������������������������������������������������������������������������������� 111
References�������������������������������������������������������������������������������������������������������������������������������� 112

Chapter 3: Numerical Methods for Second-Order ODEs��������������������������������������� 113


Euler Method����������������������������������������������������������������������������������������������������������������������������� 114
Example 1��������������������������������������������������������������������������������������������������������������������������������� 114
Example 2��������������������������������������������������������������������������������������������������������������������������������� 118
Example 3��������������������������������������������������������������������������������������������������������������������������������� 120
Example 4��������������������������������������������������������������������������������������������������������������������������������� 122
Example 5��������������������������������������������������������������������������������������������������������������������������������� 124
Runge-Kutta Method����������������������������������������������������������������������������������������������������������������� 128
Example 6��������������������������������������������������������������������������������������������������������������������������������� 128
Example 7��������������������������������������������������������������������������������������������������������������������������������� 131
Example 8��������������������������������������������������������������������������������������������������������������������������������� 134
Example 9��������������������������������������������������������������������������������������������������������������������������������� 136
Example 10������������������������������������������������������������������������������������������������������������������������������� 138
Adams-Moulton Method����������������������������������������������������������������������������������������������������������� 141
Example 11������������������������������������������������������������������������������������������������������������������������������� 141
Example 12������������������������������������������������������������������������������������������������������������������������������� 146
Simulink Modeling�������������������������������������������������������������������������������������������������������������������� 151
Example 13������������������������������������������������������������������������������������������������������������������������������� 151
Example 14������������������������������������������������������������������������������������������������������������������������������� 153
Example 15������������������������������������������������������������������������������������������������������������������������������� 156

vii
Table of Contents

Example 16������������������������������������������������������������������������������������������������������������������������������� 157


Nonzero Starting Initial Conditions������������������������������������������������������������������������������������������� 158
Example 17������������������������������������������������������������������������������������������������������������������������������� 159
ODEx Solvers����������������������������������������������������������������������������������������������������������������������������� 162
Example 18������������������������������������������������������������������������������������������������������������������������������� 163
Example 19������������������������������������������������������������������������������������������������������������������������������� 165
Example 20������������������������������������������������������������������������������������������������������������������������������� 166
Example 21������������������������������������������������������������������������������������������������������������������������������� 169
diff( )������������������������������������������������������������������������������������������������������������������������������������������ 172
Example 22������������������������������������������������������������������������������������������������������������������������������� 172

Chapter 4: Stiff ODEs�������������������������������������������������������������������������������������������� 177


Example 1��������������������������������������������������������������������������������������������������������������������������������� 177
Example 2��������������������������������������������������������������������������������������������������������������������������������� 179
Example 3��������������������������������������������������������������������������������������������������������������������������������� 180
Example 4��������������������������������������������������������������������������������������������������������������������������������� 183
Jacobian Matrix������������������������������������������������������������������������������������������������������������������������ 185
Example 5��������������������������������������������������������������������������������������������������������������������������������� 186
Example 6��������������������������������������������������������������������������������������������������������������������������������� 189

Chapter 5: Higher-Order and Coupled ODEs���������������������������������������������������������� 193


Fourth-Order ODE Problem������������������������������������������������������������������������������������������������������� 193
Robertson Problem������������������������������������������������������������������������������������������������������������������� 197
Akzo-Nobel Problem����������������������������������������������������������������������������������������������������������������� 199
HIRES Problem�������������������������������������������������������������������������������������������������������������������������� 206
Reference���������������������������������������������������������������������������������������������������������������������������������� 211

Chapter 6: Implicit ODEs��������������������������������������������������������������������������������������� 213


Example 1��������������������������������������������������������������������������������������������������������������������������������� 214
Example 2��������������������������������������������������������������������������������������������������������������������������������� 218
Example 3��������������������������������������������������������������������������������������������������������������������������������� 220
Example 4��������������������������������������������������������������������������������������������������������������������������������� 223

viii
Table of Contents

Example 5��������������������������������������������������������������������������������������������������������������������������������� 226


Example 6��������������������������������������������������������������������������������������������������������������������������������� 229
References�������������������������������������������������������������������������������������������������������������������������������� 232

Chapter 7: Comparative Analysis of ODE Solution Methods��������������������������������� 233


Example 1��������������������������������������������������������������������������������������������������������������������������������� 234
Drill Exercises��������������������������������������������������������������������������������������������������������������������������� 251
Exercise 1��������������������������������������������������������������������������������������������������������������������������������� 251
Exercise 2��������������������������������������������������������������������������������������������������������������������������������� 252
Exercise 3��������������������������������������������������������������������������������������������������������������������������������� 252
Exercise 4��������������������������������������������������������������������������������������������������������������������������������� 253
Exercise 5��������������������������������������������������������������������������������������������������������������������������������� 253
Exercise 6��������������������������������������������������������������������������������������������������������������������������������� 254
Exercise 7��������������������������������������������������������������������������������������������������������������������������������� 255
Exercise 8��������������������������������������������������������������������������������������������������������������������������������� 256
Exercise 9��������������������������������������������������������������������������������������������������������������������������������� 257
Exercise 10������������������������������������������������������������������������������������������������������������������������������� 258
Exercise 11������������������������������������������������������������������������������������������������������������������������������� 258
Exercise 12������������������������������������������������������������������������������������������������������������������������������� 259
Exercise 13������������������������������������������������������������������������������������������������������������������������������� 259

Part II: Boundary Value Problems in Ordinary Differential Equations�������� 261


Chapter 8: Boundary Value Problems������������������������������������������������������������������� 263
Dirichlet Boundary Condition Problem�������������������������������������������������������������������������������������� 267
Example 1��������������������������������������������������������������������������������������������������������������������������������� 267
Example 2��������������������������������������������������������������������������������������������������������������������������������� 271
Robin Boundary Condition Problem������������������������������������������������������������������������������������������ 274
Example 3��������������������������������������������������������������������������������������������������������������������������������� 274
Sturm-Liouville Boundary Value Problem��������������������������������������������������������������������������������� 279
Example 4��������������������������������������������������������������������������������������������������������������������������������� 280
Stiff Boundary Value Problem��������������������������������������������������������������������������������������������������� 285

ix
Table of Contents

Example 5��������������������������������������������������������������������������������������������������������������������������������� 285


References�������������������������������������������������������������������������������������������������������������������������������� 289
Drill Exercises��������������������������������������������������������������������������������������������������������������������������� 289
Exercise 1��������������������������������������������������������������������������������������������������������������������������������� 290
Exercise 2��������������������������������������������������������������������������������������������������������������������������������� 290
Exercise 3��������������������������������������������������������������������������������������������������������������������������������� 290
Exercise 4��������������������������������������������������������������������������������������������������������������������������������� 290
Exercise 5��������������������������������������������������������������������������������������������������������������������������������� 290
Exercise 6��������������������������������������������������������������������������������������������������������������������������������� 291
Exercise 7��������������������������������������������������������������������������������������������������������������������������������� 291
Exercise 8��������������������������������������������������������������������������������������������������������������������������������� 291
Exercise 9��������������������������������������������������������������������������������������������������������������������������������� 291
Exercise 10������������������������������������������������������������������������������������������������������������������������������� 291
Exercise 11������������������������������������������������������������������������������������������������������������������������������� 292
Exercise 12������������������������������������������������������������������������������������������������������������������������������� 292
Exercise 13������������������������������������������������������������������������������������������������������������������������������� 292

Part III: Applications of Ordinary Differential Equations.............................. 293


Chapter 9: Spring-Mass-Damper Systems����������������������������������������������������������� 295
Single Degree of Freedom System������������������������������������������������������������������������������������������� 295
Case 1: Free Vibration (Motion)������������������������������������������������������������������������������������������������� 295
Case 2: Forced Vibration (Motion)��������������������������������������������������������������������������������������������� 309
Two Degrees of Freedom System��������������������������������������������������������������������������������������������� 320
Three Degrees of Freedom System������������������������������������������������������������������������������������������� 328
Matrix Approach for n-Degree of Freedom System������������������������������������������������������������������ 336
References�������������������������������������������������������������������������������������������������������������������������������� 343

Chapter 10: Electromechanical and Mechanical Systems������������������������������������ 345


Modeling a DC Motor���������������������������������������������������������������������������������������������������������������� 345
Modeling a DC Motor with Flexible Load���������������������������������������������������������������������������������� 350
Modeling a Microphone������������������������������������������������������������������������������������������������������������ 356

x
Table of Contents

Modeling Motor: Pump Gear Box���������������������������������������������������������������������������������������������� 361


Modeling Double Pendulum������������������������������������������������������������������������������������������������� 371
References�������������������������������������������������������������������������������������������������������������������������������� 384

Chapter 11: Trajectory Problems�������������������������������������������������������������������������� 385


Falling Object���������������������������������������������������������������������������������������������������������������������������� 385
Thrown Ball Trajectories����������������������������������������������������������������������������������������������������������� 388
References�������������������������������������������������������������������������������������������������������������������������������� 400

Chapter 12: Simulation Problems������������������������������������������������������������������������� 401


Lorenz System�������������������������������������������������������������������������������������������������������������������������� 401
Lotka-Voltera Problem�������������������������������������������������������������������������������������������������������������� 407
References�������������������������������������������������������������������������������������������������������������������������������� 411
Drill Exercises��������������������������������������������������������������������������������������������������������������������������� 412
Exercise 1��������������������������������������������������������������������������������������������������������������������������������� 412
Exercise 2��������������������������������������������������������������������������������������������������������������������������������� 413
Exercise 3��������������������������������������������������������������������������������������������������������������������������������� 413
Exercise 4��������������������������������������������������������������������������������������������������������������������������������� 413
Exercise 5��������������������������������������������������������������������������������������������������������������������������������� 414
Exercise 6��������������������������������������������������������������������������������������������������������������������������������� 414
Exercise 7��������������������������������������������������������������������������������������������������������������������������������� 415
Exercise 8��������������������������������������������������������������������������������������������������������������������������������� 415
Exercise 9��������������������������������������������������������������������������������������������������������������������������������� 416
Exercise 10������������������������������������������������������������������������������������������������������������������������������� 416
Exercise 11������������������������������������������������������������������������������������������������������������������������������� 416
Exercise 12������������������������������������������������������������������������������������������������������������������������������� 417
Exercise 13������������������������������������������������������������������������������������������������������������������������������� 417
Exercise 14������������������������������������������������������������������������������������������������������������������������������� 418
Exercise 15������������������������������������������������������������������������������������������������������������������������������� 419
Exercise 16������������������������������������������������������������������������������������������������������������������������������� 420
Exercise 17������������������������������������������������������������������������������������������������������������������������������� 422
Exercise 18������������������������������������������������������������������������������������������������������������������������������� 423
xi
Table of Contents

Part IV: Partial Differential Equations.......................................................... 427


Chapter 13: Solving Partial Differential Equations����������������������������������������������� 429
pdepe()�������������������������������������������������������������������������������������������������������������������������������������� 430
One-Dimensional Heat Transfer Problem���������������������������������������������������������������������������������� 431
Example 1��������������������������������������������������������������������������������������������������������������������������������� 432
Two-Dimensional Heat Transfer: Solving an Elliptic PDE with the Gauss-Seidel Method��������� 436
Example 2��������������������������������������������������������������������������������������������������������������������������������� 438
del2(): Laplace Operator������������������������������������������������������������������������������������������������������������ 443
Example 3��������������������������������������������������������������������������������������������������������������������������������� 444
Wave Equation�������������������������������������������������������������������������������������������������������������������������� 447
Solving a One-Dimensional Wave Equation������������������������������������������������������������������������������ 448
Example 4��������������������������������������������������������������������������������������������������������������������������������� 451
Solving a Two-Dimensional Wave Equation������������������������������������������������������������������������������ 455
Example 5��������������������������������������������������������������������������������������������������������������������������������� 456
References�������������������������������������������������������������������������������������������������������������������������������� 459
Drill Exercises��������������������������������������������������������������������������������������������������������������������������� 460
Exercise 1��������������������������������������������������������������������������������������������������������������������������������� 460
Exercise 2��������������������������������������������������������������������������������������������������������������������������������� 460
Exercise 3��������������������������������������������������������������������������������������������������������������������������������� 460
Exercise 4��������������������������������������������������������������������������������������������������������������������������������� 461
Exercise 5��������������������������������������������������������������������������������������������������������������������������������� 461
Exercise 6��������������������������������������������������������������������������������������������������������������������������������� 461
Exercise 7��������������������������������������������������������������������������������������������������������������������������������� 461
Exercise 8��������������������������������������������������������������������������������������������������������������������������������� 461
Exercise 9��������������������������������������������������������������������������������������������������������������������������������� 462
Exercise 10������������������������������������������������������������������������������������������������������������������������������� 462
Exercise 11������������������������������������������������������������������������������������������������������������������������������� 462
Exercise 12������������������������������������������������������������������������������������������������������������������������������� 463
Exercise 13������������������������������������������������������������������������������������������������������������������������������� 463

Index��������������������������������������������������������������������������������������������������������������������� 465
xii
About the Author
Dr. Sulaymon L. Eshkabilov is currently a visiting
professor in the Department of Agriculture and Biosystems
Engineering at North Dakota State University. He obtained
his ME diploma from Tashkent Automobile Road Institute
in 1994, his MSc from Rochester Institute of Technology,
USA in 2004, and his PhD from Academy Sciences of
Uzbekistan in 2005. He was an associate professor at
Tashkent Automobile Road Institute from December 2006 to
January 2017. He also held visiting professor and researcher
positions at Ohio University from 2010 to 2011 and Johannes
Kepler University, Austria, from January to September 2017. He has taught the following
courses: “MATLAB/Simulink Applications for Mechanical Engineering and Numerical
Analysis” and “Modeling of Engineering Systems” for undergraduate students, an
“Advanced MATLAB/Mechatronics” seminar/class, and “Control Applications,” “System
Identification,” “Experimentation and Testing with Analog and Digital Devices” for
graduate students.
His research areas are mechanical vibrations, control, mechatronics, system
dynamics, image processing, and microstructure analysis of materials. He is the author
of more than 30 research papers and 5 books. Three of the five books are devoted to
MATLAB/Simulink applications for mechanical engineering students and numerical
analysis. From 2009 to 2020, he was an external academic expert for the European
Commission, assessing academic projects.

xiii
About the Technical Reviewer
Karpur Shukla is a research fellow at the Centre for
Mathematical Modelling at FLAME University in Pune,
India. His current research interests focus on topological
quantum computation, nonequilibrium and finite-­
temperature aspects of topological quantum field theories,
and applications of quantum materials effects for reversible
computing. He received an MSc in physics from Carnegie
Mellon University, with a background in theoretical analysis
of materials for spintronics applications as well as Monte Carlo simulations for the
renormalization group of finite-­temperature spin lattice systems.

xv
Acknowledgments
I express my special gratitude to the technical reviewers, proofreaders, and editors of
Apress for their very thorough work while reviewing the content and code in this book.
Without their critical insights and corrections at many points of the book, I would not
have been able to complete it with this quality. In addition, I would like to express my
special gratitude to Mark Powers for his on-time and well-planned correspondence
throughout this book project.
My cordial gratitude goes to my mother for her limitless support and love. Up until
the very last point of this book, she was always checking in about my progress.
I would like to thank my wife, Nigora, because without her great support, I would not
have been able to take up the challenging task of writing this book. I have spent many
weekends in my office writing and editing the book content and the MATLAB/Simulink
scripts and models. In addition, I would like to thank our children, Anbara, Durdona,
and Dovud, for being such delightful people and being the inspiration for my efforts
while writing this book.

xvii
Introduction
This book covers the most essential and hands-on tools and functions of the MATLAB
and Simulink packages and the Symbolic Math Toolbox (MuPAD notes) to solve, model,
and simulate ordinary differential equations (ODEs) and partial differential equations
(PDEs). It explains how to solve ODEs and PDEs symbolically and numerically via
interactive examples and case studies. The main principle of the book is “learn by doing,”
moving from the simple to the complex. This book contains dozens of solved problems
and simulation models embedded in MATLAB scripts and Simulink models, which
will help you to master programming and modeling essentials, as well as learn how to
program and model more difficult and complex problems that involve ODEs and PDEs.
Practical MATLAB Modeling with Simulink explains various practical issues
of programming and modeling in parallel by comparing the programming tools of
MATLAB to the modeling tools of Simulink. By studying this book, you’ll be proficient
at using the MATLAB/Simulink packages and at using the source codes and models
from the book’s examples as templates for your own projects to solve modeling and
simulation, or engineering problems with ODEs and PDEs.

What You Will Learn


By the end of the book, you’ll have learned how to do the following:

• Model complex problems using MATLAB and Simulink

• Use MATLAB and Simulink to solve ODEs and PDEs

• Use numerical methods to solve first-, second-, and higher-order and


coupled ODEs

• Solve stiff and implicit ODEs

• Employ numerical methods to solve first- and second-order linear


PDEs

xix
Introduction

• Solve ODEs symbolically with the Symbolic Math Toolbox of


MATLAB

• Understand the applications and modeling aspects of differential


equations in solving various simulation problems

This book is aimed at engineers, programmers, data scientists, and students


majoring in engineering, applied/industrial math, data science, and scientific
computing. This book continues where Apress’ Beginning MATLAB and Simulink leaves
off.
The book is composed of three parts. Part 1 consists of the following chapters:

• Chapter 1 is dedicated to general formulations and solving ODEs


symbolically using The Symbolic Math Toolbox functions and
MuPAD note commands.

• Chapter 2 covers the most essential programming aspects to solve


first-order ODEs numerically by writing scripts based on the Euler,
Runge-Kutta, Milne, Adams-Bashforth, Ralston, and Adams-Moulton
methods. You’ll write the scripts using MATLAB’s built-in ODE
solvers, such as ode23, ode23t, ode45, ode15s, ode113, odeset, etc.,
and Simulink modeling.

• Chapter 3 is dedicated to solving second-order ODEs symbolically


and numerically using the Euler, Runge-Kutta, Milne, Adams-­
Bashforth, Ralston, and Adams-Moulton methods. You’ll do this
using MATLAB’s built-in ODE solvers, such as ode23, ode23t, ode45,
ode15s, ode113, odeset, etc., and Simulink modeling.

• Chapter 4 addresses the issues of how to solve stiff ODEs by adjusting


a step size, specifying a solver setting, selecting an appropriate solver
type, and so forth.

• Chapter 5 is dedicated to solving higher-order and coupled ODEs.

• Chapter 6 is devoted to solving implicitly defined IVPs and


differential algebraic equations using MATLAB’s ode15i and Simulink
modeling.

xx
Introduction

• Chapter 7 is dedicated to a comparative analysis of solving ODEs


with MATLAB’s ODE solvers, Simulink modeling, script writing, and
computing analytical solutions with the Symbolic MATH Toolbox
(MuPAD notes).

Part 2 consists of the following chapter:

• Chapter 8 covers most essential tools of solving boundary value


problems of ODEs numerically by using MATLAB solvers such as
bvp4c, bvp5c, bvpinit, deval, etc.

Part 3 consists of the following chapters:

• Chapter 9 is devoted to applications of ODEs, specifically, modeling


and simulations of spring-mass-damper systems.

• Chapter 10 is devoted to applications of ODEs, specifically, modeling


and simulations of mechanical and electromechanical systems.

• Chapter 11 is devoted to applications of ODEs, specifically, modeling


and simulations of trajectory problems.

• Chapter 12 is devoted to applications of ODEs, specifically, modeling


and simulations of several simulation problems, such as the Lotka-­
Voltera and Lorenz systems.

Part 4 consists of the following chapter:

• Chapter 13 is devoted to solving partial differential equations using


PDE toolbox functions, such as pdepe() and the Laplacian operator
del2(), and writing scripts based on Gauss-Seidel and finite
difference methods.

How to Access the Source Code


All of the source code (such as M/MN files, Simulink models, and SLX/MDL files)
discussed in the book is available to readers via the Download Source Code button at
www.apress.com/9781484257982.

xxi
Introduction

A Note to Users
The given scripts in the context of the book may not be the best solutions to the given
problems, which was done intentionally in some cases to emphasize methods used to
improve them; in other cases, the given scripts are the most appropriate solutions to the
best knowledge of the author. Should I spot any better alternative solutions to exercises
given in the context of the book, I intend to publish them via the MathWorks MATLAB
Central User Community’s file exchange via my file exchange link there—under my
name.
No matter how hard we have worked to proofread the content of the book, it is
inevitable that there might be some typographical errors that have slipped through and
will appear in print. My apologies.
Sulaymon L. Eshkabilov
January 2020

xxii
PART I

Ordinary Differential
Equations
CHAPTER 1

Analytical Solutions
for ODEs
Many modeling problems in engineering applications can be formulated using ordinary
differential equations. There are a few different definitions of differential equation; one of
the simplest ones is “A differential equation is any equation which contains derivatives,
either ordinary derivatives or partial derivatives” given in [1]. From this definition,
we can derive that there are two types of differential equations: ordinary differential
equations (ODEs) and partial differential equations (PDEs). ODEs contain one type of
derivative or one independent variable, while PDEs contain two or more derivatives
or independent variables. For example, a general form for first-order ODEs can be
expressed by:

dy
= f ( y ,x ) (1-1)
dx

where y(x) is a dependent variable whose values depend on values of the


independent variable of x. Another good example of an ODE is Newton’s second law of
motion formulated by:

dp mdv
ma = = = F ( t ,v ) (1-2)
dt dt
dv
where F(t, v) is the force, which is a function of time (t) and velocity (v);
is a velocity
dt
change rate (acceleration) of a moving object; m is the mass of a moving object; a is an
dp
acceleration of a moving object; p is momentum; and is its derivative.
dt

3
© Sulaymon L. Eshkabilov 2020
S. L. Eshkabilov, Practical MATLAB Modeling with Simulink, https://doi.org/10.1007/978-1-4842-5799-9_1
Chapter 1 Analytical Solutions for ODEs

The previous formulation of Newton’s second law can be also rewritten in the
following way:

md æ dx ö md 2 x æ dx ö
ç ÷= = F ç t ,x , ÷ (1-3)
dt è dt ø dt 2 è dt ø

æ dx ö
where the derivative ç ÷ of the displacement (x) of a moving object is the velocity
è dt ø
(v). In other words, the velocity is a change rate of the displacement x(t) of a moving
object in time. This can be visualized with the flowchart displayed in Figure 1-1.

Figure 1-1. Flowchart expressing motion and exerted force of a moving object

C
 lassifying ODEs
There are two classifications of ODE-related problems.

• Initial value problems (IVPs): Here’s an example: x = xt - 3 x with


these initial conditions: x ( 0 ) = 3, x ( 0 ) = 1 .
• Boundary value problems (BVPs): Here’s an example: x = xt - 3 x
with these boundary conditions: x(0) = 3, x(2) = 1.50.
IVPs are defined with ODEs together with a specified value, called the initial
condition, of the unknown function at a given point in the solution domain. In the IVP of
ODEs, there might be a unique solution, no solution, or many solutions. By definition,

4
Chapter 1 Analytical Solutions for ODEs

the IVP of ODEs can be explicitly defined or implicitly defined. Most IVPs are explicitly
defined.
We will start with explicitly defined IVPs and then move on to implicitly defined
ones. Besides being categorized by solution type (how the solution values change over
the solution search space), IVPs are divided into stiff and nonstiff problems. Moreover,
ODEs are either linear or nonlinear and are either homogeneous or nonhomogeneous.
Here are some specific examples of different ODE types, categories, and groups:
ì x = -0.04 x + 10 4 yz
ï
Stiff ODEs: í y = 0.04 x - 10 4 yz - 3 * 107 y 2   t ∈ [0, 40]
ï z = 3 * 107 y 2
î
Nonstiff ODEs: y + 2 y = 2t , w
 + w = 5
dv
Linear ODEs: = 9.81 - 0.198v , x + 3 x + 5 x = 0
dt
dv
Nonlinear ODEs: = 9.81 - 0.198v 2 , x + 3 xx + 5 x 2 = 0
dt
Homogeneous ODEs: y + 2 y = 0 , x + 3 x + 5 x = 0

Nonhomogeneous ODEs: y + 2 y = sin ( x ) , x + 3 x + 5 x = e 2t

This chapter contains several examples for ODEs and their application areas.

Example 1
This example shows an exponential growth problem. This equation could describe
unconstrained growth of biological organisms (bacteria), values of real estate or
investments, membership of a popular networking site, growth in retail business,
positive feedback of electrical systems, or generated chemical reactions. It is formulated
by the following first-order ODE:

dy
= m y has a solution: y(t) = y0eμt
dt

5
Chapter 1 Analytical Solutions for ODEs

Example 2
This example shows exponential decay. This equation could describe many phenomena
in nature and engineering, such as radioactive decay, washout of chemicals in a reactor,
discharge of a capacitor, and decomposition of material in a river. Exponential decay is
expressed with the following first-order ODE:

dy
= - m y has a solution: y(t) = y0e−μt
dt
Examples 1 and 2 are two simple examples of first-order ODEs.

Example 3
The motion of a falling object is expressed in the following way using Newton’s second
law:

md 2 y g dy
2
= mg -
dt dt

This is a second-order ODE that has a general solution in the following form:

ægt ö
-ç ÷ m ( mg - g g t )
y ( t ) = C1 e èmø
- + C2
g2

where m is the mass of a falling object; g is gravitational acceleration; and γ is an


air-­drag coefficient of a falling object. There are three parameters. Specifically, m, g,
d2 y dy
and γ are constant, and two parameters change over time: 2 (acceleration) and
dt dt
(velocity). In the general solution of a falling object using the equation of motion, C1 and
C2 are arbitrary numbers that are dependent on the initial conditions or, in other words,
can be computed considering the initial conditions of a falling object.
There are a few methods to evaluate the analytical solutions of ODEs, including
the separation of variables, introduction of new variables, and others. We show via
specific examples of these types of ODEs and explain how to evaluate their analytical
solutions and compute numerical solutions by employing different techniques in the
MATLAB/Simulink environment through scripts and building models. We evaluate
analytical solutions of ODEs via specific examples and demonstrate how to use the

6
Chapter 1 Analytical Solutions for ODEs

built-in functions of the Symbolic Math Toolbox1 and MuPAD2 notebooks. We put more
emphasis on the Symbolic Math Toolbox’s command syntaxes rather than MuPAD
notebooks. The reason for this is that in future releases of MATLAB, a technical support
for MuPAD notebooks will removed.
There are a number of numerical methods, including Euler (forward, backward,
modified), Heun, the midpoint rule, Runge-Kutta, Runge-Kutta-Gill, Adams-Bashforth,
Milne, Adams-Moulton, Taylor series, and trapezoidal rule methods. Some of these
methods are explicit, and others are implicit. To demonstrate how to employ these
methods, we will first describe their formulations concisely, and then we will work
on their implementation algorithms for writing scripts (programs) explicitly. We do
not attempt to derive any of the formulations used in these numerical methods, and
there are many literature sources [2, 3, 4, 5] explaining the theoretical aspects of these
methods.
In solving an IVP with numerical methods, we first start from an initial point (initial
conditions) and then take a step (equal step size or varying step size) forward in time to
compute numerical solutions. Some of the previously named numerical methods (e.g.,
Euler’s methods) are single-step methods, and others (Runge-Kutta, Adams-Bashforth,
Milne, Adams-Moulton, Taylor series) are multistep methods. Single-­step methods
refer to only one previous point and its derivative to determine the current value. Other
methods, such as Runge-Kutta methods, take some intermediate steps to obtain a
higher-order step and then drop off values before taking the next step. Unlike single-
step methods, multistep methods keep and use values from the previous steps instead
of discarding them. In this way, multistep methods link a few previously obtained
values (solutions) and derivative values. All of these methods, such as the single-step
and multistep methods, are assessed based on their accuracy and efficiency in terms
of computation time and resources (e.g., machine time) spent to compute numerical
solutions for specific types of IVPs of ODEs.

1
 ymbolic Math Toolbox is a registered trademark of The MathWorks Inc.
S
2
MuPAD is a registered trademark of The MathWorks Inc.

7
Chapter 1 Analytical Solutions for ODEs

Analytical Solutions of ODEs


The Symbolic MATH Toolbox (or MuPAD notebooks) has several functions capable
of evaluating analytical solutions of many analytically solvable ODEs. There are two
commands (built-in functions)—dsolve() and ilaplace/laplace—with which
analytical solutions of some ODEs can be evaluated.
Note that in this section we demonstrate—via a few examples of first- and second-­
order ODEs and systems of coupled differential equations—how to compute analytical
solutions of ODEs.

dsolve()
dsolve() is an ODE solver tool to compute an analytical (or general) solution of any
given ODE in MATLAB. dsolve() can be used with the following general syntaxes:

Solution = dsolve(equation)
Solution = dsolve(equation, conditions)
Solution = dsolve(equation, conditions, Name, Value)
[y1,...,yN] = dsolve(equations)
[y1,...,yN] = dsolve(equations, conditions)
[y1,...,yN] = dsolve(equations, conditions, Name, Value)

Example 4
Given an ODE, y + 2ty 2 = 0 . Note that initial or boundary conditions are not specified.
Here is the command by which we can compute a general analytical solution of the given
example.

>> y_solution=dsolve('Dy=-2*y^2*t')

Y_solution=-1/(C3-t^2)

Note that C3 is defined from the initial or boundary conditions of the given ODE.
There is an alternative command. The given problem with newer versions of
MATLAB (starting with MATLAB 2012) can be solved by using the following command
syntax:

8
Chapter 1 Analytical Solutions for ODEs

>>syms y(t); y_sol=dsolve(diff(y) == -2*y^2*t)


y_sol =
         0
-1/(-t^2 + C3)

E xample 5
Given an ODE, y + 2ty 2 = 0 , with the initial condition y(0) = 0.5.

>> Solution=dsolve('Dy=-2*y^2*t', 'y(0)=0.5')


Solution =
1/(t^2 + 2)

Here is the alternative command syntax for newer versions of MATLAB:

>> syms y(t); Solution=dsolve(diff(y) == -2*y^2*t, y(0)==0.5)


Solution =
1/(t^2 + 2)

Here is another alternative syntax for newer versions of MATLAB:

>> syms y(t) t; Dy=diff(y, t); Equation = Dy ==-2*y^2*t; IC=y(0)==0.5;


Solution=dsolve(Equation, IC); pretty(Solution)
1
------
2
t  + 2

The resulting analytical solution is in a symbolic formulation and thus can be plotted
(Figure 1-2) with ezplot or the recommended fplot. (ezplot will not be supported in
future releases of MATLAB.)

>> fplot(Solution, [-5, 5], 'r--o'), grid on


>>title('Solution of: $$ \frac{dy}{dt}+2y^2t=0, y_0 = 0.5 $$',
'interpreter', 'latex')
>> xlabel('\it t'), ylabel '\it Solution, y(t)'

9
Chapter 1 Analytical Solutions for ODEs

Figure 1-2. Analytical solution of y + 2ty 2 = 0, y ( 0 ) = 0.5

Numerical values of the resulting analytical solution (equation) can be computed


by vectorizing (parameterizing) the resulting symbolic formulation (solution), as shown
here:

>> ysol=vectorize(solution)
ysol =
1./(t.^2 + 2)
>> t=(-5:.1:5); ysol_values=eval(ysol);

10
Chapter 1 Analytical Solutions for ODEs

An alternative way of computing numerical solution values is to use fplot, as shown


here:

[t, yt]=fplot(Solution, [-5, 5]);

E xample 6
Given y + kty 2 = 0 , y ( 0 ) = 0.5 . Note that this exercise has one unspecified parameter, k.

>> syms k
>> solution=dsolve('Dy=-k*y^2*t', 'y(0)=0.5')
solution =
1/((k*t^2)/2 + 2)

Here is the alternative command syntax:

>> syms y(t) k; solution=dsolve(diff(y) == -k*y^2*t, y(0)==0.5)


solution =
1/((k*t^2)/2 + 2)

E xample 7
Given y - y e t = 2 , y ( 0 ) = 2. Let’s solve this exercise in a MuPAD note. Figure 1-3 shows
the commands used to compute an analytical solution for this exercise.

11
Chapter 1 Analytical Solutions for ODEs

Figure 1-3. MuPAD commands to solve y - y e t = 2, y ( 0 ) = 2 analytically

Note The options in dsolve() need to be set appropriately depending on


the problem type. For MATLAB 2008–2010 or earlier versions, you should set
IgnoreAnalyticConstraints to none to obtain all or any possible solutions.

Here’s an example:

solution=dsolve('Dy=-k*y^2*t', 'y(0)=0.5', ... 'IgnoreAnalyticConstraints',


'none')

Note For MATLAB 2012 or newer versions, you should set


IgnoreAnalyticConstraints to false to get all the possible correct answers
for all the argument values. Otherwise, dsolve() may output an incorrect answer
because of its pre-algebraic simplifications.

12
Chapter 1 Analytical Solutions for ODEs

Here’s an example:

solution=dsolve(diff(y)==-k*y^2*t, y(0)==0.5, ... 'IgnoreAnalyticConstraints',


false)

Second-Order ODEs and a System of ODEs


There are a myriad of processes and phenomena that are expressed via second-order
differential equations, for example, simple harmonic motions of a spring-mass system,
motions of objects with some acceleration (Newton’s second law), damped vibrations,
current flows in resistor-capacitor-industance circuits, and so forth. In a general form,
second-order ODEs are expressed in two different forms: homogeneous, as shown in
Equation (1-4), and nonhomogeneous, as shown in Equation (1-5).

y + p ( x ) y + q ( x ) y = 0
 (1-4)

y + p ( x ) y + q ( x ) y = g ( x )
 (1-5)

Note that the homogeneous ODEs in Equation 1-4 always have one trivial solution,
which is y(x) = 0, that satisfies the given equations in Equation 1-4. With respect to the
independent functions p(x), q(x), and g(x), the ODEs might be linear or nonlinear. In
some cases, the independent functions p(x), q(x), and g(x) might be constant values or
nonconstant values.
Let’s consider several examples of using second-order ODEs to compute general and
specific solutions with the Symbolic MATH Toolbox of MATLAB.

E xample 8
d 2u du ( 0 )
Given an ODE of 2
+ 100u = 2.5 sin (10t ) , the initial conditions: u ( 0 ) = 0 and = 0.
dt dt
usol=dsolve('D2u+100*u=2.5*sin(10*t)', 'u(0)=0', 'Du(0) 0');
pretty(usol)

%% Alternative syntax
syms u(t)
Du = diff(u);
u(t) = dsolve(diff(u, 2)==2.5*sin(10*t)-100*u, u(0)==0, Du(0) == 0);
13
Chapter 1 Analytical Solutions for ODEs

pretty(u(t))

The output from executing the two short scripts/commands is as follows:

3 sin(10 t)   sin(30 t)
  ----------- - --------- -
      320          320

               / t  sin(20 t) \
     cos(10 t) | - - -------- |
               \ 8     160    /

Example 9
ì y1¢ = y 2
Given the system of ODEs í ¢ , the initial conditions: y1 ( 0 ) = 1, y 2 ( 0 ) = 0 ;.
î y 2 = - y1 - 0.125 y 2
The given problem is a system of two first-order ODEs. This problem can be solved
directly with dsolve() similar to the previous examples, as shown here:

%% System of two 1st order ODEs solved with dsolve


yt=dsolve('Dy1=y2', 'Dy2=-y1-0.125*y2','y1(0)=1', 'y2(0)=0');
pretty(yt.y1)
pretty(yt.y2)

%% Alternative syntax
syms y1(t) y2(t)
z=dsolve(diff(y1,1)==y2, diff(y2,1)==(-y1-0.125*y2), y1(0)==1, y2(0)==0);
pretty(z.y1), pretty(z.y2)

The computed analytical solutions of the problem displayed in the command


window are as follows:

     /    1/2   \             /    1/2   \
     | 255    t |     1/2    | 255    t |
  cos| -------- |   255    sin| -------- |
     \    16    /             \    16    /
  --------------- + ----------------------
          1/16                    1/16
    exp(t)              255 exp(t)

14
Chapter 1 Analytical Solutions for ODEs

                 /    1/2   \
          1/2    | 255    t |
    16 255    sin| -------- |
                 \    16    /
  - -------------------------
                   1/16
         255 exp(t)

The computed analytical solutions are as follows:

æ 255t ö æ 255t ö
cos ç ÷ 255 sin ç ÷
è 16 ø è 16 ø
y1 ( t ) = +
16 t
e 25516 e t

æ 255t ö
16 255 sin ç ÷
è 16 ø
y2 (t ) = -
25516 e t

Example 10
y + 3 y 3 - y cos (100t ) = 2 , the initial conditions are:
Given a second-order ODE of 2 
y(0) = 0 and y ( 0 ) = 0.

>> Solution_dsolve=dsolve('2*D2y+3*(Dy^3)-cos(100*t)*abs(y)-2=0', ...


'y(0)=0','Dy(0) =0');
Warning: Explicit solution could not be found.
> In dsolve at 194

This is a good example for many ODEs that cannot be solved analytically by using
dsolve().
Let’s consider several examples to compute analytical solutions of ODEs in MuPAD
notebooks that are opened by typing a command in the command window, as shown
here:
>> mupad

15
Chapter 1 Analytical Solutions for ODEs

E xample 11
Let’s consider a second-order ODE, as shown in Figure 1-4:
y + y = sin(t ), y ( 0 ) = 1, y ( 0 ) = 2.


Figure 1-4. MuPAD tools used to solve a second-order ODE

E xample 12
y + 3 y 3 - y y = 2 , y(0) = 0, y ( 0 ) = 0. This is a second-order nonhomogeneous and
Given 
nonlinear ODE. Here is the solution syntax (solution command) of the given example in
MuPAD notes.

[Y:=ode({y″(t)+3∗(y′(t)^3)-y(t)∗abs(y(t))=2,y(0)=0,y′(0)=0},y(t))

[Ysolution:=solve(Y)

16
Chapter 1 Analytical Solutions for ODEs

No solution is computed in this exercise. When the MuPAD note (Symbolic MATH
Toolbox) cannot compute an analytical solution of a given ODE problem, it rewrites a
given problem formulation and produces no analytical solution expression.

Example 13
Given Ay + By + Cy = D, the initial conditions are: y(0) = a and y ( 0 ) = b. This is a second-
order and linear ODE. The [A, B, C, D] and [a, b] are scalars. Let’s write Unicode code
capable of solving the given ODE for any values of these scalars.
Here is the solution script (Unicode_2nd_ODE.m) with the dsolve() and syms
functions of the Symbolic MATH Toolbox:

% Unicode_2nd_ODE.m
syms y(t) t
Dy=diff(y, t);
D2y=diff(y, t, 2);
fprintf('To solve: A*ddy+B*dy+C*y=D at ICs: y(0)=a, dy(0)=b \n')
fprintf('Enter the values of [A, B, C, D] and [a, b] \n');
A = input('Enter A = ');
B = input('Enter B = ');
C = input('Enter C = ');
D = input('Enter D = ');
a = input('Enter a = ');
b = input('Enter b = ');
% Given ODE equation:
Equation = D2y==(1/A)*(D - B*Dy-C*y);
ICs = [y(0)==a; Dy(0)==b];
Solution=dsolve(Equation, ICs);
% Display the computed anaytical solution in the command window:
pretty(Solution)
fplot(Solution, [0, 5], 'b-'), grid on
xlabel('\it t')
ylabel('\it Solution, y(t) ')
title('\it Solution of: $$\frac{A*d^2y}{dt^2}+\frac{B*dy}{dt}+C*y=D,
y(0)=a, dy(0)=b$$', 'interpreter', 'latex')

17
Chapter 1 Analytical Solutions for ODEs

gtext(['\it A = '  num2str(A), '\it,  B = '  num2str(B), '\it,  


C = '  num2str(C), '\it,  D = '  num2str(D)])
gtext(['\it Initial Conditions:  a = '  num2str(a), '\it,  
b = '  num2str(b)])
grid on; shg

y + y + 2 y = 3 , y(0) = 1, y ( 0 ) = 0.
Now, let’s test the code to solve this equation: 1.3 

To solve: A*ddy+B*dy+C*y=D at ICs: y(0)=a, dy(0)=b


Enter the values of [A, B, C, D] and [a, b]
Enter A = 1.3
Enter B = 1
Enter C = 2
Enter D = 3
Enter a = 1
Enter b = 0
                 /   5 t \    / sqrt(235) t \
    sqrt(235) exp| - --- | sin| ----------- |
3                \    13 /    \     13     /
- - -----------------------------------------
2                       94

        /   5 t \    / sqrt(235) t \


     exp| - --- | cos| ----------- |
        \    13 /    \     13     /
   - -------------------------------
                    2

In addition, we obtain the next plot figure, shown in Figure 1-5, which displays the
numerical values of the computed analytical solution y(t).

18
Chapter 1 Analytical Solutions for ODEs

y + y + 2 y = 3 , y(0) = 1, y ( 0 ) = 0
Figure 1-5. Solution of the second-order ODE: 1.3 

You can use this code to solve any second-order ODE of an IVP that has scalar
[A, B, C, D] values. This code can be extended for a third-, fourth-, or higher-order
ODE in a similar manner. Here is one alternative solution script (Unicode_4th_
order_ODE.m) to solve any ODE up to the fourth order:

% Unicode_4th_order_ODE.m
%% Unicode to Solve up to 4-th order non-homogenuous linear ODEs of IVPs
%
% EQN:  Ax+B*dx + C*ddx + ... = F
% user entry (1) is ODE order #:  N
% user entry (2) values of:            A, B, C, ....
% user entry (3) initial conditions: IC1, IC2, IC3,...
syms x(t)
Dx=diff(x, t);
D2x=diff(x, t, 2);

19
Chapter 1 Analytical Solutions for ODEs

D3x=diff(x, t, 3);
D4x=diff(x, t, 4);
D5x=diff(x, t, 5);
D6x=diff(x, t, 6);
D7x=diff(x, t, 7);
N = input('Order of the ODE:  N  =  ');
if N == 1
disp('Solving: A*x+B*dx=F with one initial condtion: x(0) = ? ')
A = input(' Enter:  A =         ');
B = input(' Enter:  B =         ');
F = input(' Enter:  F =         ');
EQN = A*x+B*Dx==F;
IC1 = input(' Enter: x(0) =    ');
IC = x(0)==IC1;
Str0 ='Solution of: $$ A*x+B*\frac{dx}{dt}=F $$';
Str1=sprintf('A = %d,  B = %d, F = %d',  A, B, F);
Str2 =(['Initial Conditions: [ '  num2str(IC1), ' ]' ]);
elseif N == 2
disp('Solving: A*x+B*dx+C*ddx=E with two initial condtions: x(0) = ?,
dx(0) = ? ')
A = input(' Enter:  A =         ');
B = input(' Enter:  B =         ');
C = input(' Enter:  C =         ');
F = input(' Enter:  F =         ');
EQN = A*x+B*Dx+C*D2x==F;
IC1 = input(' Enter:   x(0) =    ');
IC2 = input(' Enter: dx(0) =    ');
IC = [x(0)==IC1, Dx(0)==IC2];
Str0 ='Solution of: $$ A*x+B*\frac{dx}{dt}+C*\frac{d^2x}{dt^2}=F $$';
Str1=sprintf('A = %d,  B = %d, C = %d, F = %d',  A, B, C, F);
Str2 =(['Initial Conditions: [' num2str(IC1), ', ' num2str(IC2), ' ]']);
elseif N == 3
disp('Solving: A*x+B*dx+C*ddx+D*dddx=F ')
disp('with three initial condtions: x(0) = ?, dx(0) = ? ddx(0) = ?')
A = input(' Enter:  A =         ');

20
Chapter 1 Analytical Solutions for ODEs

B = input(' Enter:  B =         ');


C = input(' Enter:  C =        ');
D = input(' Enter:  D =        ');
F = input(' Enter:  F =         ');
EQN = A*x+B*Dx+C*D2x+D*D3x==F;
IC1 = input(' Enter:    x(0) =    ');
IC2 = input(' Enter:  dx(0) =    ');
IC3 = input(' Enter: ddx(0) =    ');
IC = [x(0)==IC1, Dx(0)==IC2, D2x(0)==IC3];
Str0 ='Solution of: $$ A*x+B*\frac{dx}{dt}+C*\frac{d^2x}{dt^2}+D*\
frac{d^3x}{dt^3}=F $$';
Str1=sprintf('A = %d,  B = %d, C = %d, D = %d, F = %d',  A, B, C, D, F);
Str2 =(['Initial Conditions: [ '  num2str(IC1), ', ' num2str(IC2), ', '
num2str(IC3),' ]']);
else
disp('Solving: a*x+b*dx+c*ddx+d*dddx+e*ddddx=0 ')
disp('with four initial condtions: x(0) = ?, dx(0) = ? ddx(0) = ?,
dddx(0) = ?')
A = input(' Enter:  A =        ');
B = input(' Enter:  B =        ');
C = input(' Enter:  C =        ');
D = input(' Enter:  D =        ');
E = input(' Enter:  E =        ');
F = input(' Enter:  F =        ');
EQN = A*x+B*Dx+C*D2x+D*D3x+E*D4x==F;
IC1 = input(' Enter:   x(0)  =    ');
IC2 = input(' Enter:  dx(0)  =    ');
IC3 = input(' Enter: ddx(0)  =    ');
IC4 = input(' Enter: dddx(0) =   ');
IC = [x(0)==IC1, Dx(0)==IC2, D2x(0)==IC3, D3x(0)==IC4];
Str0 ='Solution of: $$ A*x+B*\frac{dx}{dt}+C*\frac{d^2x}{dt^2}+D*\
frac{d^3x}{dt^3} +E*\frac{d^4y}{dt^4}=F $$';
Str1=sprintf('A = %d,  B = %d, C = %d, D = %d,  E = %d, F = %d',  
A, B, C, D, E, F);

21
Chapter 1 Analytical Solutions for ODEs

Str2 =(['Initial Conditions: [ '  num2str(IC1),', ' num2str(IC2), ',


' num2str(IC3), ', ' num2str(IC3) ' ]']);
end
Solution = dsolve(EQN, IC);
fplot(Solution, [0, 3*pi], 'LineWidth', 2), grid on
xlabel('\it t')
ylabel('\it Solution, x(t) ')
title(Str0, 'Interpreter', 'latex')
gtext(Str1)
gtext(Str2)
grid on; shg

With this script (Unicode_4th_order_ODE.m), a user can obtain analytical and


numerical solutions up to fourth-order nonhomogeneous linear ODEs with respect to
their entries.

Laplace Transforms
Solutions of linear ordinary differential equations with constant coefficients can be
evaluated by using the Laplace transformation. One of the most important features of
the Laplace transforms in solving differential equations is that the transformed equation
is an algebraic equation that will be used to define a solution for the given differential
equation. In general, the Laplace transform application to solve differential equations
can be formulated in the following way.
Let’s consider that the given n-th order derivative of yn(x) = f (t). The Laplace
transform of yn(x) is as follows:

- sy ¢ ( 0 ) - y ( 0 ) = F ( s ) (1-6)

or as follows:
n
s nY ( s ) - ås n -1 y i -1 ( 0 ) = F ( s ) (1-7)
i =1

22
Chapter 1 Analytical Solutions for ODEs

In Equation (1.6) or (1.7), if we substitute constant values for the initial conditions at
t = 0 given as y(0) = a0; y′(0) = a1; y"(0) = a2; …; yn − 2(0) = an − 2; yn − 1(0) = an − 1.
Now, we can rewrite the expression in Equation (1-6 or 1-7) as follows:

ìdn y ü
 í n = f ( t ) ý => s nY ( s ) - s n -1a0 - s n - 2 a1 - s n - 3 a2 -¼- s an - 2 - an -1 = F ( s ) (1-8)
î dt þ

Subsequently, we first solve for Y(s), take the inverse Laplace transform from Y(s),
and obtain the solution y(t) of the n-th order differential equation.
The general steps to apply the Laplace and the inverse Laplace transforms to
determine the solution of differential equations with constant coefficients are as follows:

1. Take the Laplace transforms from both sides of the given


equation.

2. Solve for Y(s), in terms of F(s) and other unknowns.

3. Take the inverse Laplace transform of the found expression to


obtain the final solution of the problem.

Note that in step 3 we should also decompose the found expression from step 2 into
partial fractions to use tables of the inverse Laplace transform correspondences. The
schematic view of the Laplace and inverse Laplace transforms is given in Figure 1-6.

Differential Equation Solution

L L –1
Algebraic equation Solution

Figure 1-6. Flowchart of solving ODE with Laplace transform and its inverse

23
Chapter 1 Analytical Solutions for ODEs

E xample 14
Let’s consider a second-order nonhomogeneous differential equation, shown here:
d2 y dy
+ A + C = e nt , dy(0) = k, y(0) = m.
dt 2 dt
Now, by applying the steps depicted in the flowchart of the Laplace and inverse
transforms, we can write the Laplace transform of the given problem in steps explicitly.

ìd2 y dy ü ìd2 y ü ì dy ü
 í 2 + A + C = e nt ý => L í 2 ý +  í A ý + {C } = {e nt } (1-9)
î dt dt þ î dt þ î dt þ

1
{e nt } = (1-10)
s -n

So,

ìd2 y ü
 í 2 ý = s 2Y ( s ) - dy ( 0 ) - s * y ( 0 ) = s 2Y ( s ) - k - s * m (1-11)
î dt þ

ì dy ü ì dy ü
 í A ý = A *  í ý = A * ( s *Y ( s ) - y ( 0 ) ) = A * s *Y ( s ) - m (1-12)
î dt þ î dt þ

{C } = C (1-13)

Now plugging Equations (1-10), (1-11), (1-12), and (1-13) back into Equation (1-9),
we obtain the next expression:

1
s 2Y ( s ) - k - sm + AsY ( s ) - m + C = (1-14)
s -n

We solve Equation (1-14) for Y(s) and determine the following:

1 + ( sm + ( k + m - C ) ) ( s - n ) Cn - Cs - kn - mn + ks + ms + ms 2
Y (s ) = =- (1-15)
( s - n ) ( s 2 + As ) s ( A + s )( n - s )

From the expression Y(s) in Equation (1-15), we decompose partial fractions, and
then we take the inverse Laplace transform of both sides and obtain the solution in
Equation (1-16), which is y(t) of the given differential equation, as shown here:

24
Chapter 1 Analytical Solutions for ODEs

e nt Cn - kn - mn + 1 Cn - kn - mn - A ( k - mn - C ) + 1
y (t ) = - + (1-16)
An + n 2
An Ae At ( A + n )

A built-in function of the Symbolic MATH Toolbox, laplace(), is used to evaluate


the Laplace transform of any algebraic expression or differential equation, and the
ilaplace() function of the Symbolic MATH Toolbox is used to compute the inverse of
the evaluated Laplace transformed s domain expression. These two functions handle all
transformations by decomposing partial fraction procedures automatically and compute
an analytical solution of a given ODE exercise.

laplace/ilaplace
laplace/ilaplace are based on the Laplace and inverse Laplace transforms that are
built-in function tools of the Symbolic MATH Toolbox. The general syntaxes of laplace/
ilaplace are as follows:

F=laplace(f)
F=laplace(f, t)
F=laplace(f, var1, var2)

and

f=ilaplace(F)
f=ilaplace(F, s)
f=ilaplace(F, var1, var2)

Example 15
Given x(t) = sin (2t), the Laplace transform of x(t) is computed with the following
command syntaxes:

>> syms t
>> xt=sin(2*t); Xs=laplace(xt)
Xs =
2/(s^2 + 4)

25
Chapter 1 Analytical Solutions for ODEs

Example 16
Given, y(t) = sin (Kt), we have the following:

>> syms t K
>> yt=sin(K*t); Ys=laplace(yt)
Ys =
K/(K^2 + s^2)

Example 17
Given y(x) = ax3 + b, we have the following:

>> syms x a b
>> yx=a*x^3+b; Ys=laplace(yx)
Ys =
(6*a)/s^4 + b/s

Or, we can obtain the result in the t variable domain instead of s.

>> yx=a*x^3+b; Yt=laplace(yx, x, t)


Yt =
(6*a)/t^4 + b/t

The ilaplace() function syntaxes and implementation are exactly the same for
laplace. Let’s look at several ODE exercises to demonstrate how to use laplace and
ilaplace and compare their evaluated solutions with the ones obtained from dsolve().

Example 18
Given y + 2 y = 0 , y ( 0 ) = 0.5, let’s solve it with laplace/ilaplace and dsolve(). The
following script (Laplace_vs_Dsolve_old_MATLAB_ex14.m) is the solution. Note that this
script works only on MATLAB 2017a or earlier versions.

% Laplace_vs_Dsolve_old_MATLAB_ex18.m
clearvars; clc; close all
% Step #1. Define symbolic variables' names
syms t s Y
26
Chapter 1 Analytical Solutions for ODEs

ODE1='D(y)(t)=-2*y(t)';
% Step #2. Laplace Transforms
LT_A=laplace(ODE1, t, s);
% Step #3. Substitute ICs and initiate an unknown Y
LT_A=subs(LT_A,{'laplace(y(t),t, s)','y(0)'},{Y,0.5});
% Step #4. Solve for Y (unknown)
Y=solve(LT_A, Y);
display('Laplace Transforms of the given ODE with ICs'); disp(Y)
% Step #5. Evaluate Inverse Laplace Transform
Solution_Laplace=ilaplace(Y);
display('Solution found using Laplace Transforms: ')
pretty(Solution_Laplace)
% Step #6. Compute numerical values and plot them
t=0:.01:2.5; LTsol=eval(vectorize(Solution_Laplace));
figure, semilogx(t, LTsol, 'ro-')
xlabel('t'), ylabel('solution values')
title('laplace/ilaplace vs dsolve ')
grid on; hold on
% Compare with dsolve solution method
Y_d=dsolve('Dy=-2*y', 'y(0)=0.5'); display('Solution with dsolve')
pretty(Y_d); Y_sol=eval(vectorize(Y_d));
plot(t,Y_sol, 'b-', 'linewidth', 2), grid minor
legend('laplace+ilaplace', 'dsolve'), hold off; axis tight

Here is another version of the script (Laplace_vs_Dsolve_new_MATLAB_ex14.m) that


works on newer versions of MATLAB (starting from MATLAB 2018b and on).

% Laplace_vs_Dsolve_New_MATLAB_ex18.m
clearvars; clc; close all
% Step #1. Define symbolic variables' names
syms t s Y y(t) Dy(t)
assume([t, Y]>0);
Dy=diff(y,t);
ODE1=Dy==-2*y(t);
% Step #2. Laplace Transform
LT_A=laplace(ODE1, t, s);

27
Chapter 1 Analytical Solutions for ODEs

% Step #3. Substitute the arbitrary unknown Y and IC(s)


LT_A=subs(LT_A,laplace(y,t, s),Y);
LT_A=subs(LT_A, y(0), 0.5);
% Step #4. Solve for the arbitrary unknown Y
Y=solve(LT_A, Y);
disp('Laplace Transforms of the given ODE with ICs'); disp(Y)
% Step #5. Evaluate the Inverse Laplace Transform
Solution_Laplace=ilaplace(Y);
disp('Solution found using Laplace Transforms: ')
pretty(Solution_Laplace)
% Step #6. Compute numerical values and plot them
t=0:.01:2.5; LTsol=eval(vectorize(Solution_Laplace));
figure, semilogx(t, LTsol, 'ro-')
xlabel('t'), ylabel('solution values')
title('laplace/ilaplace vs. dsolve ')
grid on; hold on
% Compare with dsolve solution method
IC=y(0)==0.5;
Y_d=dsolve(ODE1, IC);
disp('Solution with dsolve')
pretty(Y_d); Y_sol=eval(vectorize(Y_d));
plot(t,Y_sol, 'b-', 'linewidth', 2), grid minor
legend('laplace+ilaplace', 'dsolve')
hold off; axis tight

Both versions of the script produce the same output. After executing the script
(Laplace_vs_Dsolve_old_MATLAB_ex18.m or ODE_Laplace_New_MATLAB_vers.m), the
following output is obtained:

Warning: Solutions are valid under the following conditions: -2 < s.


To include parameters and conditions in the solution, specify the
'ReturnConditions' value as 'true'.
Laplace Transforms of the given ODE with ICs
1/(2*s + 4)

28
Chapter 1 Analytical Solutions for ODEs

Solution found using Laplace Transforms:

  exp(-2 t)
  ---------
      2
Solution with dsolve

  exp(-2 t)
  ---------
      2

Figure 1-7 shows the plotted solutions and clearly displays a perfect convergence of
the solutions found with laplace/ilaplace and dsolve().

laplace/ilaplace vs. dsolve


0.5

0.45

0.4

0.35

0.3
solution values

0.25

laplace+ilaplace
0.2
dsolve

0.15

0.1

0.05

-2 -1 0
10 10 10
t

Figure 1-7. The problem y + 2 y = 0, y ( 0 ) = 0.5 solved with laplace/ilaplace,


dsolve()
29
Chapter 1 Analytical Solutions for ODEs

Note There are a few command syntaxes (functions) of the Symbolic Math


Toolbox that are not forward compatible, such as laplace/ilaplace and subs
employed while solving ODEs. This forward incompatibility issue was demonstrated
in Examples 4 and 5.

Example 19
y + y = sin t, y ( 0 ) = 1, and y ( 0 ) = 2 , here is the solution script (Laplace_vs_
Given 
Dsolve_old_MATLAB_ex19.m) of this second-order nonhomogeneous ODE with laplace,
ilaplace, and dsolve():

% Laplace_vs_Dsolve_old_MATLAB_ex19.m
% %%   LAPLACE TRANSFORMS
% Given: y"+y'=sin(t) with ICs: [1, 2] for y(0) & y'(0).
clearvars, clc, close all
syms t s Y
% Define the given ODE equation
ODE2nd='D(D(y))(t)+D(y)(t)-sin(t)';
% Step 1. Laplace Transforms
LT_A=laplace(ODE2nd, t, s);
% Step 2. Substitute ICs and initiate an unknown Y
LT_A=subs(LT_A,{'laplace(y(t),t, s)','y(0)','D(y)(0)'},{Y,1,2});
% Step 3.  Solve for Y unknown
Y=solve(LT_A, Y);
disp('Laplace Transforms of the given ODE with ICs'); disp(Y)
Solution_Laplace=ilaplace(Y);
disp('Solution found using ilaplace/laplace: ')
pretty(Solution_Laplace); t=0:.01:13;
LTsol=eval(vectorize(Solution_Laplace));
figure, plot(t, LTsol, 'ro-');
xlabel('\it t'),
ylabel('\it Solution y(t)')
ylabel('\it Solution y(t)')

30
Chapter 1 Analytical Solutions for ODEs

title('\it laplace/ilaplace vs. dsolve Solutions: $$ \frac{d^2y}{dt^2}+\


frac{dy}{dt}=sin(t)$$', 'interpreter', 'latex');
hold on
% dsolve solution method
Y=dsolve('D2y+Dy=sin(t)', 'y(0)=1, Dy(0)=2', 't');
disp('Solution with dsolve:  ');
pretty(Y); Y_sol=eval(vectorize(Y));
plot(t,Y_sol, 'b-', 'linewidth', 2); grid minor
legend('laplace+ilaplace', 'dsolve', 'location', 'southeast'); hold off

The computed analytical solutions displayed in the command window are as follows
(see Figure 1-8):

Laplace Transforms of the given ODE with ICs


(s + 1/(s^2 + 1) + 3)/(s^2 + s)

Solution found using Laplace Transforms:

      cos(t)   sin(t)   5 exp(-t)
  4 - ------ - ------ - ---------
        2        2         2
Solution with dsolve:

      cos(t)   sin(t)   5 exp(-t)
  4 - ------ - ------ - ---------
        2        2         2

31
Chapter 1 Analytical Solutions for ODEs

y + y = sin (t ) , y ( 0 ) = 1, y ( 0 ) = 2
Figure 1-8. Numerical solutions of 

Note that the previous script (Laplace_vs_Dsolve_old_MATLAB_ex19.m) works in


older versions of MATLAB and will not run in later versions after MATLAB 2018a. This
script (Laplace_vs_Dsolve_New_MATLAB_ex15.m) produces the same output:

% Laplace_vs_Dsolve_New_MATLAB_ex19.m
% %%   LAPLACE TRANSFORMS
% Given: y"+y'=sin(t) with ICs: [1, 2] for y(0) & y'(0).
clearvars, clc, close all
% Step 1. Define names of the symbolic variables
syms t s Y y(t) Dy(t)
Dy=diff(y, t);
D2y=diff(y, t, 2);
% Define the given ODE equation

32
Random documents with unrelated
content Scribd suggests to you:
through the streets to proclaim their reconciliation to the people, and
dismiss their soldiers, to the great relief of the court and Parisians, and at
the same time the King returned to his senses, so there was a general
thanksgiving at St. Denis, and for a time every one breathed more
200
freely.
In February Isabeau had another boy, and for the third time the King
and Queen chose the name of Charles for their son, who was made Comte
de Ponthieu and was afterwards Charles VII.
In May the Queen gave a great fête at the hôtel Barbette to the Duc
de Gueldre, at which Louis, Valentine, and several other seigneurs were
201
present.
One would almost suppose that serious thunderstorms in those days
must have been more frequent than at present in the north of Europe, for
three of truly southern violence took place in May and June of this year.
The first, accompanied by a furious wind and a shower of hailstones as big
as a goose’s egg, destroyed the vines and other crops for sixteen leagues;
in the second the lightning struck the hôtel St. Paul, penetrated into the
202
Queen’s room, where that night she was not sleeping, and consumed
the magnificent curtains of her bed. As a thank-offering for her escape she
sent offerings to several churches, and to the monks of St. Denis a sum to
say three masses a year for the soul of the late Dauphin. The third storm,
on the last day of June, did more harm than either of the others; it tore up
trees, unroofed houses, and destroyed a great part of the halle du Lendit,
near St. Denis, but left the part untouched where the judges of the royal
contributions resided. The people, who were vexed and harassed by them,
remarked that the devil had spared his own abode. The great cross on the
priory de l’Estrée was struck down.
The King went on much the same, being tolerably well for a few
weeks, and then ill for several weeks more. The Duc d’Orléans had
persuaded him to appoint him regent, and to give him absolute power
over all the Langue d’Oïl, or northern part of France. Some time after he
had an attack of madness, and Orléans, directly he had the government in
his hands, levied enormous taxes, forced loans from everybody, seized
provisions both of lay and ecclesiastics, and published a decree for
another heavy and universal tax throughout the kingdom, to which he
attached the signatures of his uncles of Burgundy and Berry, both of
whom at once publicly denied them, saying that the secretary of their
nephew was a forger. There was a general commotion; Louis was declared
unfit to govern, and even the Queen and Duchesse d’Orléans saw that this
sort of thing could not possibly go on. So directly the King was better a
council was called, in which the Queen, the Duchesse d’Orléans, all the
princes of the blood, the Constable, Chancellor, the chief minister, and
some of the nobles took part. By them it was settled that in case of the
King’s death the chief authority should be in the hands of the Queen until
the majority of her son. Meanwhile the Queen was president of the
Council. The direction of affairs was taken away from the Duc d’Orléans,
and the Duke of Burgundy regained his power next time the King was ill.
It had been promised by the King and Queen that the late Dauphin
should marry the eldest daughter of the Comte de Nevers, and she was
203
now betrothed to the Dauphin Louis, commonly called Duc d’Aquitaine,
and it was further arranged that the Princess Michelle should be married
to Philippe, eldest son of the Comte de Nevers, but that she should be left
to be brought up by the Queen her mother. The marriage of the Dauphin
and Marguérite of Burgundy was celebrated with great pomp at Paris in
the cathedral of Notre Dame in August 1404. There had been some talk of
marrying Jean, the second son of the King, to another daughter of the
Comte de Nevers, but this idea was given up and he was betrothed to
Jacqueline, only child of Guillaume, Comte de Hainault, and Marguérite de
Bourgogne, a great heiress.
Not long afterwards the Duke of Burgundy was taken ill on a journey
from Arras, where he had left the Duchess, to Brussels, in order to visit his
aunt, the Duchesse de Brabant. The roads were very bad, and though
pioneers were sent on before his litter to smooth and mend them, he
could not go on much further, but stopped at an inn called the “Stag,” and
sent for his three sons, Jean, Antoine, and Philippe. He expressed
repentance for his oppressions, exhorted his sons to fear God, to be good
brothers to each other, loyal subjects to the King, and to live at peace with
the rest of the royal family, after which he arranged his affairs and died.
So extravagant had he been that, in spite of his immense possessions,
it was doubtful whether he had left enough money to pay his debts, for
which reason the Duchess of Burgundy formally renounced communauté
de biens, laying her girdle, purse and keys upon his coffin, according to
204
the custom. She died very soon after.
At the same time the Duc de Berry was very ill, and when he
recovered and found the Duke of Burgundy was dead he was deeply
grieved. While the former was ill and the King mad, the Duc d’Orléans, at
the head of an armed band, broke into the Palais one night and carried
away nearly all the money to be found there. The Hundred Years’ War had
begun again, and there were constant fights going on, towns and castles
attacked and taken, seaports and villages surprised and sacked by
warships. The new Duke of Burgundy was much worse than the old one,
and had not, of course, the same authority in the council or royal family.
The Duc d’Orléans, though he hated his uncle, was obliged to have a
205
certain respect for him as a sort of representative of his father, and the
King, in spite of putting a stop every now and then to his tyrannical
proceedings, looked up to him with an amount of consideration which
neither he nor his brother entertained for Jean Sans-peur, who was as
ambitious and extravagant as his father, without his great qualities, and
was harder, more unscrupulous, more cruel, and more crafty. The chief
princes of the blood who ruled in council were now the Queen, the Duc de
Berry (the last surviving son of King Jean), Louis le Bon, Duc de Bourbon,
Louis II., King of Sicily (son of the late Duc d’Anjou, and a much better
man than his father), Charles III., King of Navarre (also an excellent
character), and Jean Sans-peur, Duke of Burgundy, besides, of course, the
Duc d’Orléans. But unfortunately the two most influential were the Dukes
of Burgundy and Orléans, the latter being always supported by the Queen
and her brother, Ludwig of Bavaria.
The brigands had reappeared all over the country and great distress
prevailed, large tracts of land went out of cultivation, travelling was unsafe
owing to the highwaymen who infested the roads, but the fêtes at court
grew more brilliant and licentious and the royal favourites more insolent.
Charles de Savoisy, who had long been a favourite of the King, and was
grand-maître d’hôtel to the Queen, was one of the most conspicuous. One
of his pages, galloping down the streets as a procession belonging to the
university was going by, knocked down some of the students, out of
insolent bravado. The others surrounded and gave him a blow. The page
fled to the hôtel Savoisy and demanded vengeance, whereupon the
retainers of Savoisy attacked the procession which was already entering
the church of Ste. Catherine, striking with sticks and swords those who
were still outside, and firing off cross-bows into the church, wounding
several people and injuring the sacred images, ornaments, and vestments
of the priests. When first Savoisy heard of it, he said his men had done
quite right to maintain the honour of his house; but finding that the
University had laid a complaint before the Queen and the Dukes of
Burgundy and Orléans, he was frightened and offered to give up the
culprits to be hanged. The University, however, proceeded with the case,
the Duc d’Orléans took it up, and just then the King came to his senses
and was very angry. He ordered Savoisy to be banished, his hôtel razed to
the ground, and a chapel built there at his expense instead. Savoisy was,
206
after a time, recalled and enriched again.
Meanwhile Louis d’Orléans, Isabeau, and her brother were amassing
an enormous amount of treasure, which they kept in safe places
distributed about. A convoy drawn by six horses and loaded entirely with
gold coin was stopped near Metz, being on the way to Germany, sent by
207
Isabeau. The people learned from the drivers of it that several others of
these convoys had safely reached their destination. But they did not pay
their tradesmen nor any of their debts. The servants of the household of
the King, Dauphin, and other royal children, could not get their wages, so
that thus it was nearly impossible to procure them proper food, clothes,
and attendance. An Augustine monk named Jacques Legrand, preaching
before the Queen on Ascension Day, harangued against the dissolute
habits of the court, where he declared that Venus reigned and corruption
was general. He said that drunkenness, debauchery, and licentious dances
went on all night, that the Queen had introduced the excessive luxury and
extravagance in dress which everywhere prevailed, as she would hear if
she went out in disguise. The Queen was very angry and some of her
ladies told the monk that they could not imagine why he was not afraid to
say such things, to which he replied that he could still less understand why
they dared to do them. He treated with indifference the threats aimed at
him, and when some of the courtiers told the King that he had been
speaking disrespectfully of the Queen and her goings on, he said he was
very glad of it, and that the monk should preach to him in his oratory on
Whitsunday. Charles listened with much attention to his sermon on the
excesses of the court and society, and when it was over praised him for
his fidelity and courage, took him under his protection, and resolved to
reform the state of things he complained of. But he fell ill again in June
208
and remained so during half July, so nothing was done.
There was a spell of very bad weather just then. The melting of snow
in the mountains of Haute Bourgogne caused a torrent to rush down from
the gorges carrying stones and rocks. It drowned many people, broke
down the walls of the great abbey of Cluny, and rushed in, driving the
monks up to the higher stories, where they remained till, in sixteen hours,
the flood went down, and they descended to dig out the dead bodies from
209
the ruins.
The Queen and Duc d’Orléans had formed the project of attaching to
their party the Duc de Bar, cousin of the King, by marrying his son to one
of the daughters of France. As the only available one was the Princess
Marie, notwithstanding her vows and dedication of the child at Poissy,
Isabeau, accompanied by Louis, set out for that convent to see her
daughter and talk to her on the subject. She found, however, that instead
of a ready consent, which she doubtless expected, the Princess Marie,
then about twelve years old, absolutely refused to leave the convent. The
Queen talked for a long time to her daughter, and the Duc d’Orléans
added his persuasions, but it was no use, she would not hear of it. She
said to the Queen that she had placed her there, she was dedicated to
God, and she should stay there, adding, “You have made a gift to God and
you cannot recall it.”
The King was ill just then, but when he got better they persuaded him
to try his influence. He consented rather reluctantly, but said she should
do as she chose. He went to see her and asked whether she would
consent to leave the convent and marry (she had, of course, not yet taken
the irrevocable vows). But the child replied that she had promised to be
the bride of Christ, and would hold to her vow unless her father could find
210
her a better and more powerful bridegroom. The Queen and Duc
d’Orléans, after their unsuccessful visit to the young princess, went to
hunt in the forest of St. Germain. There a frightful storm came on.
Isabeau, as usual, was terrified. Louis got off his horse and took refuge in
her carriage. The horses took fright and ran away down to the river, into
which they would certainly have plunged had not a man caught hold of
them and cut the traces, or whatever were the straps that fastened them
to the carriage. The lightning struck the room where the Dauphin was in
Paris, and killed one of his favourite esquires. The Dauphin was dreadfully
frightened but not hurt. His attendants consoled him and had holy water
211
thrown about the room. The people said that these floods and storms
were caused by the conduct of the Queen and Duc d’Orléans, who seem
to have been of the same opinion, for they were for a short time seized
with remorse and declared they would pay their debts. Louis even went so
far as to summon his creditors to his hôtel to receive their money, but
when they came he had changed his mind and would not pay them—at
least, only those who had come from a great distance.
One day the King, recovering suddenly from an attack of insanity, and
finding everything in a state of confusion and discomfort, began to inquire
the meaning of this condition of things. The Queen and the Duc d’Orléans
were away, so he questioned the governess of the Dauphin, who told him
that she really could not get proper clothes and scarcely proper food for
the Dauphin and his brothers and sisters, that the Queen would not attend
to the matter, and she did not know what to do. Charles was exceedingly
angry and grieved, for he was very fond of his children, and he sent for
the Dauphin and asked him if it were true. The boy hesitated, but after a
little persuasion told his father that it was, only that his mother had by
caresses and entreaties made him promise not to tell his father. Charles
then asked him how long it was since he had been with his mother, to
which he replied, about three months. The King thanked the governess for
her faithfulness, begged her to take care of the children, gave her a gold
cup he had been drinking from to reward her services, promising to do
more for her afterwards. Then he called a council and sent for the Duke of
212
Burgundy.
The Queen and the Duc d’Orléans, when they heard he was coming,
fled to Melun and fortified themselves there; which was easy enough as it
was a very strong place on an island in the Seine. It had been the
headquarters of the party of Navarre, as it had belonged to Queen
213
Blanche in the reign of Jean and Charles V.
In order to prevent the Dauphin from falling into the hands of the
Duke of Burgundy, they sent word to Ludwig of Bavaria, the Queen’s
brother, to bring not only him but the children of Burgundy also, to the
Queen’s country house at Pouilly, where they went to wait for them. But
the Parisians got to hear of it, and sent in haste to meet the Duke of
Burgundy and tell him to come as fast as he could, for the Queen had sent
for the Dauphin and they were afraid she was going to take him to
Germany. Jean Sans-peur, at the head of a strong body of armed men,
pushed on at full speed, but found when he got there that they had
already started. He rode after them and caught them up at about a league
and a half from Paris. They had been taken by boat to Vitry and had slept
at Villejuif. It was pouring with rain. The Duke of Bavaria represented that
the Queen had sent for the children and begged the Duke of Burgundy,
who had much the stronger party of the two, not to prevent his obeying
her orders. The Duke of Burgundy rode up to the Dauphin’s litter, and,
opening the portière, asked him if it were by his own free will that he had
left Paris. The Dauphin replied that he would much rather go back there to
his father; upon which the Duke of Burgundy ordered him to return at
once, and himself took hold of the bridles of the horses and turned them
back towards Paris. The Duke of Bavaria accompanied him, and the
Dauphin was soon lodged in the Louvre while the Duke of Burgundy
fortified himself in his hôtel d’Artois.
The rest of the party returned to Pouilly, where they found Isabeau
and Louis just going to dinner. But on hearing what had happened they
were so alarmed that, without even waiting to dine, they fled to Melun
214
and took refuge there.
There was now open war between the Queen and Duc d’Orléans and
the Burgundian party, and the royal family was divided and perplexed. The
King of Sicily and Duc de Bourbon tried to make peace and came to Melun
for that purpose, but it was no use; the Queen would not see them and
the Duc d’Orléans would not listen to them. He said the capture of the
Dauphin was an insult to the Queen and to himself. They went back in
despair, and begged the Duc de Berry to try. He also went to Melun, but it
was no use; the Queen would not go back to Paris.
She was at this time very angry with some of the members of her
household who had been spreading scandal about her. She dismissed
several of her maids-of-honour, among them one who had been her great
favourite, whom she often consulted, and who kept her seal. She put two
of the gentlemen of her household in prison and kept them there for some
time, in spite of the entreaties of their friends that they might be brought
215
to trial.
However, a conference was held at Vincennes, peace was patched up,
and they all returned to Paris, where the Queen took up her abode again
with the King at St. Paul, the Duc d’Orléans at his hôtel near the Bastille,
the Duke of Burgundy occupied the hôtel d’Artois, the King of Sicily the
hôtel d’Anjou, and the Duc de Berry the hôtel de Nesle. Each of these
hôtels was a fortress, and all the streets around them were defended with
chains and wooden doors.
Meanwhile, the King had another attack worse than ever. He was very
fierce, so that no one dared go near him, and refused to undress or wash.
This went on so long, and he got into such a dreadful state, that the
doctor said it must be stopped somehow. Ten or twelve men therefore
disguised themselves, wore armour under their clothes, and blackened
their faces. Then they rushed into the King’s room, “terrible to see,” as the
chronicler remarks. The King was so frightened that he let them get close
to him, and then they seized him, undressed and washed him, and put
clean clothes on him. He soon began to get better, but for some time did
not know any one but Juvenal des Ursins, who used to go to see him, and
whom he would recognise and talk to. Shortly after he recovered his
216
senses.
On the 16th of June, 1406, there was a total eclipse of the sun
between six and seven in the morning. It lasted half an hour, “and,” says
the chronicler, “nothing whatever could one see, any more than if it had
been night and there had been no moon.” People crowded into the
churches, and every one thought the world was coming to an end.
“However, the thing passed off, and the astronomers assembled and said
217
that the thing was very strange and the sign of a great evil to come.”
Two more royal marriages took place. Isabelle, Queen of England, was
married to Charles, eldest son of the Duc d’Orléans, and her little brother
Jean, to Jacqueline, daughter of the Comte de Hainault and niece of the
Duke of Burgundy. Isabelle hated this marriage and cried all the time, it
was said at court, because she thereby lost the title of Queen of England.
Miss Strickland, in her life of that Queen, observes that if she had been so
anxious to keep the crown of England, she could easily have done so by
marrying King Henry V., and that her grief was caused by her love for King
Richard. But at any rate, it is not difficult to understand that a girl of
218
seventeen might well object to be married to a boy of fifteen, and her
cousin, besides the fact of his being a subject while she had been a
queen. Miss Strickland goes on to state that after a short time she became
reconciled to this marriage, Charles of Orléans being accomplished and
precocious beyond his years, and devoted to her, but it was cut short by
her early death.
After the weddings the Comtesse de Hainault wished to take the Duc
de Touraine back with her. The Queen objected, and a dispute arose, but
as it had been agreed in the contract that he should be under her care,
she got her way, took leave of the Queen (the King was then ill), and
returned to Hainault. The Count came to meet them with a brilliant suite
and received the young prince with great ceremony, and in every place
through which they passed was music and rejoicing. The children had the
household of sovereign princes, and the Count tried to educate his son-in-
law in the ways of the country, that he might live in harmony with his
future subjects. The King, when he recovered, made no objection, but
consented to the Count’s request that his son should be brought up in
219
Hainault.
Never within the memory of any one alive had been seen such a
winter as that of 1407. The snow lay deep on the ground, wells were
frozen to an extraordinary depth, wine was frozen in the barrel and bread
at the bakers. Many people died of the cold, and it was known as “le
220
grand hiver.” The frost lasted sixty-six days, beginning in November.
Louis d’Orléans had been ill on and off all the autumn, and had been
staying at Beauté for the benefit of the fresh air of the forest which his
father had so loved. Valentine and her children were still in the country,
and the King at the Louvre. Isabeau had for some time been living in the
hôtel Barbette, where she had given birth to her twelfth and last child,
who was christened Philippe and died soon after. Isabeau was still weak,
and had not recovered from her illness; she had displayed extraordinary
grief at the death of this baby, for whom it was said she showed more
affection than for any of her other children. She was altogether low and
depressed in spirits, and Louis came every day to see and console her.
He was just then living at the hôtel de Nesle, not the great palace
opposite the Louvre, but the one afterwards called the hôtel de Soissons,
whence he and his daily rides to the hôtel Barbette were known and
watched by the men of Burgundy.
HOTEL BARBETTE.

On Wednesday evening, November 23, 1407, Louis and Isabeau were


having supper and spending the evening together at the hôtel Barbette.
Isabeau was splendidly dressed in long robes and an enormous headdress
with horns, covered with jewels. It was only eight o’clock, but the night
was dark and all the shops in that quarter were closed. Suddenly a
messenger from the King was announced for the Duc d’Orléans, who said
that he desired at once to see the Duke, as he had an important matter to
speak to him about.
221
Louis rose, took his leave, and went out. Mounting his mule, he
rode carelessly along, swinging his embroidered glove and humming a
song as he went. He was only accompanied by two esquires, both riding
the same horse, a young German page or esquire, and four or five varlets
carrying torches. As they passed a dark corner by a wall close to the
house of the Maréchal d’Evreux the horse of the two esquires seems to
have been aware of the presence of some men concealed in the darkness,
snorted violently, and ran away. The assassins rushed out and assailed the
Duke, who, thinking it was a mistake, exclaimed, “I am the Duc
d’Orléans,” to which, however, the reply was, “It is you we want.” The two
esquires looked round, expecting he was following them, and seeing the
struggle, managed to stop their horse, and returned. Louis d’Orléans lay
dead on the ground, covered with wounds; his German page, who had
defended him to the last, died as they came up, muttering, “Mon maître.”
The assassins rode off at full speed, laughing and strewing chaussetrapes,
or calthrops, behind them, and setting fire to a house to divert attention
from their flight. In a moment cries of alarm resounded on all sides; the
street was full of torches; some of the followers of the Duke rushed back
to the hôtel Barbette to tell the Queen, who heard the tumult with terror
and did not know what was happening.
Félibien says that the murderers came out of a house called Notre
Dame, because over the door was an image of our Lady, and that it was
opposite that of the Maréchal de Rieux. This house they had hired for the
purpose, and had been hidden in it for a fortnight. They were eighteen in
number. The wife of a shoemaker said that she opened her window, and
looking out into the street, she saw the Duke and his little group of
attendants come out of the hôtel Barbette; then the attack of the
murderers, the short fight, the fall of the Duke, his page, and another of
his followers; and that after all was over a tall man wrapped in a cloak,
with a red hood drawn over his face, came out of a house opposite, which
had lately been bought by the Duke of Burgundy, and pushing with his
foot the body of Orléans, said, “Il est mort, éteignez tous et allons nous
en.” She shouted, “Murder! Fire!” out of the window, but they turned with
threatening words and ordered her to be silent. The Maréchal de Rieux, a
friend and partisan of Louis d’Orléans, hearing the clamour and cries,
came out of his hôtel with a torch, and to his horror found him lying dead,
with his German page also dead and another of his followers dying; the
rest had fled. The body of Louis was carried to the nearest church, and
then to that of the Céléstins, and laid in the chapelle d’Orléans, which he
222
had founded.
Isabeau, wild with fear, ordered her litter at once, got into it, and was
carried to the hôtel St. Paul, where she took refuge with the King, taking
up her abode in the room adjoining his; while the news spread through
Paris, and the nobles, hastily arming, flocked to St. Paul to guard the King,
all the gates of Paris were closed but two, which were strictly guarded and
count kept of all who passed out or in.
The King, filled with grief and anger, sent for the provost of Paris and
ordered him to find out the assassins, and there was a general wonder
who was the instigator of this crime. Suspicions fell upon the Sieur de
Canny, who had cause enough to hate Louis d’Orléans, but it appeared
that he had not been in or near Paris at the time; and on the 25th the
provost of Paris presented himself at the hôtel St. Paul where the princes
were assembled, as a council was about to be held, and came into the
apartment where they were all waiting for the time for it to begin. The
King of Sicily and the Dukes of Burgundy, Berry, and Bourbon were
223
present, besides other princes of the blood.
The Duke of Burgundy was standing by a window talking to the King
of Sicily when the provost of Paris appeared and said that he believed he
could find out the author of the crime if he might have permission to
224
search the hôtels of all the princes. It appeared that a scullion who had
acted as spy for the murderers had been seen to escape and enter the
hôtel d’Artois, or Burgundy.
All the princes at once gave leave for their palaces to be searched
except the Duke of Burgundy, who hesitated and changed colour, and the
King of Sicily asked him if he knew anything of the affair. Taking him and
the Duc de Berry aside, he confessed his guilt. “C’est moi qui ai fait le
coup et ne sais comme il s’est fait, il faut que le diable m’ait tenté et
surpris.” The princes looked at each other in consternation. “Dieu!”
exclaimed the Duc de Berry, “je perds aujourd’hui mes deux neveux!”
Next day, when he presented himself to attend the council at the hôtel
de Nesle, the Duc de Berry stopped him, saying he had better not go in,
as it would please no one to see him there; he had better go back to his
hôtel. The Duke of Burgundy left the palace, the Comte de Saint-Pol
refusing to accompany him, got fresh horses, and fled to the nearest
fortress belonging to him, cutting the Pont Saint Maxence behind him to
stop pursuit. The Duc de Bourbon indignantly asked the Duc de Berry,
“Why did you let him go?” He grieved sincerely for his nephew, and never
again would sit at a council, or enter a room, or go to any place where the
Duke of Burgundy was.
CHAPTER VII
1407–1412

Departure of royal family—Hundred Years’ War—Valentine


d’Orléans—Queen returns to Louvre—Death of Valentine—
Forced reconciliation—Philippe de Bourgogne and Michelle de
France—Misconduct of the Duc de Bretagne—Death of Isabelle
de France—Of the Duc de Bourbon—Quarrels of the Duke and
Duchess of Aquitaine—Of the princes.

N
ever did there appear to be a more conspicuous example of
successful crime than the one recorded in the last chapter. Jean
Sans-peur had satisfied his vengeance and got rid of his rival,
and although retribution eventually fell upon him, he was for many years
able to rejoice in his deed and escape the punishment of it by reason of
his powerful position and the weakness of those opposed to him.

For Charles VI. was in a much worse state of health than he had been
at the time of the attack on Clisson, and though he was transported with
sorrow and indignation and swore vengeance upon the murderers, he
almost immediately fell into one of his fits of madness, and when he got
better he was so confused and weak as to be unable to take any decided
measures. The Queen had implored him to punish the assassins, but she
had no power to do so when he was again mad, and, fearing for her own
safety, she left Paris with the Duke of Aquitaine, his wife, her other
225
children and her brother, and took up her abode at Melun with them.
The other members of the royal family were afraid of the Duke of
226
Burgundy, who besides his violent character and immense power, could
easily have endangered France by throwing in his lot with the English, who
were carrying on the war, notwithstanding the absurd injustice of the
claim they put forward to the crown of France.
227
It will be remembered that, as was explained in the former volume,
Edward III. of England claimed that throne through his mother, Isabella,
daughter of Philippe IV., and persisted in it, although it was finally decided
that the Valois, as nearest heirs male, descending from Charles, brother of
that King, were the lawful possessors of the throne ascending to the loi
salique or Salic law, which henceforward was adopted by the country; and
notwithstanding the existence of daughters and grandsons through them,
who would have come before the sister of the then last Kings, Louis Hutin,
Philippe-le-Long and Charles-le-Bel, supposing the female line to have
been admitted at all.
But Henry IV. had still less pretensions than Edward III., for he was
not the lawful heir even of the English King. If, as has been shown, the
claim of King Edward was an unjust one, of course he had no ground to
stand upon. If, on the other hand, it were a just one, then it would
belong, not to the descendant of his third son, John of Gaunt, Duke of
Lancaster, but to the Mortimers, who descended by the female line from
Lionel, Duke of Clarence, his second son, Richard II., son of the Black
Prince, having left no children. In fact, the Mortimers were the right heirs
228
to the crown of England.
However, the English were still a very serious danger for France, and
the Duke of Burgundy would have been an invaluable ally, whom, in
consequence, they did not dare to drive to desperation. And as he always
posed as a friend of the people when he wanted to injure Louis d’Orléans,
who was supposed to be their chief oppressor, he was very popular with
the credulous mob, who did not, after the first horror caused by the
assassination of the King’s brother, trouble themselves much about it, but
said, alluding to the knotted stick which had been the emblem of Orléans,
229
and the plane of Burgundy, “Le bâton noueux est enfin raboté.”
Louis d’Orléans had been buried with great solemnity in the Chapelle
d’Orléans of the Céléstins, all the princes of the blood, including his
murderer, attending in white mantles, the day before the council at which
the Duke of Burgundy had owned his guilt. Valentine was still in the
country when the news was brought to her, with her children.
Overwhelmed with grief, she sent her daughter and her two eldest boys,
the young Duc d’Orléans and the Comte de Vertus, for safety, to the
strong castle of Blois, and with her youngest son and her daughter-in-law,
the Princess Isabelle, she set off, in spite of the fearful cold, to Paris,
where they arrived on December 10th, went to the hôtel St. Paul, threw
themselves at the feet of the King, who had got better again, and
implored justice on the murderer. Charles received his daughter and sister-
in-law with kindness and affection, and promised all they asked, but early
in January another of his attacks came on, and Valentine seeing that
nothing could be done and not thinking herself safe, as the Duke of
Burgundy seemed all powerful at Paris where he had returned amid the
acclamations of the mob, retired to Blois, and fortified herself there with
230
her children.
The great frost broke up and the melting of the snow and ice swelled
the rivers into frightful torrents, carrying away houses, trees, and cattle.
The monk of St. Denis says that he saw in the Seine masses of ice three
hundred feet long dashing against each other, destroying boats and
bridges. At Paris, on the second day of the thaw, the pont St. Michel was
swept away, with all the houses on it, and so was a wooden bridge on the
other branch of the Seine. Much it was feared that the Grand Pont also
would give way, as it shook terribly with the icicles, but only fourteen
shops fell. The roads were impassable by reason of the rocks and trees
with which they were covered by the floods. Many mills were destroyed,
and the price of bread rose. The King ordered all bakers to sell flour at the
same price, but great distress prevailed, and no one alive had ever seen
231
such a winter.
About May the Princess Marie took the perpetual vows at Poissy, in
presence of the King, Queen, and court.
The King went to Melun to visit the Queen, who had sent for the
provost of Paris and made him tell her all that had been done there, and
found that the Duke of Burgundy had been trying to throw upon her the
same suspicions of magic that he had formerly done upon the Duchesse
d’Orléans. He had now left Paris, and Isabeau, greatly incensed, resolved
to return there in state. Charles was taken ill again the day after his visit
to Melun, and Isabeau sent for several of the princes, including Berry,
Bourbon, Alençon, and the young Duc de Bretagne, husband of her
second daughter Jeanne, and went to Paris escorted by them, in a gilded
coach, the Dauphin Louis, who was usually called Duc d’Aquitaine, riding
in the procession for the first time, with a guard of three thousand men in
armour. Proclamations were issued that any one misbehaving or causing
any disturbance would be imprisoned in the Châtelet, which was indeed
232
no desirable place of abode.
The Queen took up her residence in the strong fortress of the Louvre
with her children, where she doubtless felt safer than in the hôtel St. Paul,
and had herself appointed regent in case of the King’s illness.
The princes were divided between their anger at the murder of
Orléans and their fear of Burgundy, but as he was now absent, the
Duchesse d’Orléans and her children came to Paris and appealed to the
Duc d’Aquitaine and other princes for vengeance on the murderer of their
husband and father. The King was just then ill again. As he, when in his
mad state, either did not know Isabeau at all, or else was so fierce that
she could not go near him without danger to her life, she had ceased to
take much trouble about him. In fact, a young girl called Odette had been
chosen, with the full consent of the Queen, to be his mistress and
constant companion. She seems to have been the only consolation of
Charles, who was devoted to her; always listened to her in his most insane
moments, and did whatever she told him. She was called by the
household and courtiers, “La petite reine.” Their daughter, named
Marguérite de Valois, was recognised by the King, and afterwards married
to a French noble.
The monk of St. Denis says she was of low origin, and such has been
the general opinion; but M. Vallet de Viriville says there is good reason to
suppose her to have been the daughter of Odin de Champdivers, a
Burgundian gentleman who had a château near Dôle, where, after the
233
death of Charles, she took refuge.
While the Queen and princes were deliberating on the means of
punishing Jean Sans-peur, the news of his victorious return from an
expedition to Flanders filled them with consternation. The Queen first tried
to borrow money to escape with the King and her children, but no one
would lend her any. The King, therefore, left Paris with the Duc de
Bourbon on the 3rd of November, and went by boat to the Céléstins, and
thence to St. Victor with 1,500 men. The Queen, with the Duke and
234
Duchess of Aquitaine, the rest of the children, the Duc de Berry, the
Kings of Sicily and Navarre left two days later, went down the Loire to
Tours and joined the King. The Duke of Burgundy entered Paris amidst
235
cries of “Noël! Noël!” from the populace.
Valentine Visconti, Duchesse d’Orléans, despairing of getting either
justice or vengeance, returned to Blois with her children, and also the little
son of Louis d’Orléans and the Dame de Canny, the afterwards famous
Dunois, the Bastard of Orléans.
Jean Sans-peur, finding the King, Queen, and royal family all gone,
was much disturbed. He resolved to negotiate, and persuaded his brother-
in-law, the Comte de Hainault, who was also father-in-law to the King’s
second son, to go to Tours for that purpose.
Perhaps what made peace with Burgundy more possible was the death
of Valentine Visconti on the 4th of December, at Blois. Overcome with
grief, disappointment, and anxiety, her health had given way. She took for
236
her device a chante-pleurs dropping tears, and the motto “Rien ne
m’est plus; plus ne m’est rien,” which she had embroidered on the black
hangings of her room. She always charged her sons to avenge their father,
and pointing to the little Jean (afterwards Dunois), then six years old, she
said, “Celui-là m’a été enlevé, il n’y a point d’enfant si bien taillé pour
venger la mort de son père.”
As the result of the negotiations an interview was arranged in solemn
state in the church of Notre Dame de Chartres. A platform was raised
before the great crucifix, all around sat the King, Queen, Kings of Sicily
and Navarre, Dukes de Berry and Bourbon, the Cardinal de Bar, the
Archbishop of Sens, and all the princes and great nobles. The Duke of
Burgundy, with his advocate, then came forward and knelt before the
King, the advocate making a speech of which the arrogance was only
thinly veiled by the formal respect for the sovereign, ending by asking
pardon for the Duke of Burgundy, to which the latter added, “Sire, de ce ie
vous prie.” The King was silent, but the Duc de Berry knelt before the
Queen, whispering something to her, upon which she rose, and with the
Duc d’Aquitaine and the Kings of Sicily and Navarre, knelt and joined in
the request, to which he replied, “Nous le voulons et accordons pour
l’amour de vous.” The Duke of Burgundy and his advocate then
approached the young princes of Orléans, who in deep mourning and with
tearful eyes stood behind the King; the advocate saying: “Messeigneurs
voici le Duc de Bourgogne qui vous prie qu’il vous plaise oster de vos
cœurs la vengeance ou hayne que porriez avoir contre luy pour l’éxcés fait
et perpetré en la personne de Monseigneur d’Orléans vostre père et que
doresnavant vous demourez et soyez bons amys ensemble;” to which
Burgundy added, “et de ce ie vous en prie.” The princes of Orléans, of
whom the eldest, the young Duke, was then seventeen, stood in silence,
and it was only in obedience to the desire of the King that they reluctantly,
and with tears, answered, “Sire, puisqu’il vous plait commander, nous luy
accordons sa requeste, et luy pardonnons toute la maleveillance que
aurions contre luy car en rien ne voulons désobéir à chose qui soit à
237
vostre plaisir.” Peace was then signed, sealed, and sworn upon the
gospels, but in spite of the grandeur and solemnity of the scene and the
intense interest and importance of the occasion, the whole thing was a
hollow and worthless form. There was no repentance in the heart of Jean
Sans-peur, and no forgiveness in those of the sons, friends, and followers
of Louis and Valentine d’Orléans. As to the Queen, she was too weak and
shallow for any lasting passion or feeling, in which her son the Duc
d’Aquitaine closely resembled her. He expressed great anger at the murder
of his uncle, and yet he persuaded his father to appoint the Duke of
Burgundy his guardian. It is true that at this time he was only twelve years
old, but the same vacillating, unreliable character was the despair of his
friends and of France during his life. Burgundian one week and Armagnac
the next, he, like his mother, was neither to be trusted by friends nor
feared by enemies.
The King and Queen returned to Paris in March. All the Queen’s ladies
were dressed in white, and there was much feasting at the palaces of the
238
King and Queen, and the hôtels of the nobles and chief burghers.
In June the Princess Michelle was married to the eldest son of the
Duke of Burgundy, Philippe, Comte de Charolais, and this marriage turned
out very happily, for Michelle, then seventeen years old, was a charming
character, like her sisters, and Philippe was in most respects unlike his
fierce, unscrupulous father. Gay, kind-hearted, and affectionate, he was
known as Philippe-le-Bon, and was adored by his subjects as no other
duke had been since all Burgundy mourned for Philippe de Rouvre, the
last of the beloved Capétienne house.
In August the Duke of Burgundy was hastily summoned by the King
and Queen to come to Paris and bring a strong body of men-at-arms who
might be wanted, as there was a serious quarrel going on with the Duc de
Bretagne, husband of their second daughter Jeanne; who had not only
239
brought over a number of English and made war on the Comtesse de
Penthièvre, but had quarrelled with his wife because she opposed his
proceedings, and was even said to have struck her. Her father and mother
were, of course, much incensed at this, so they resolved to send the Duke
of Burgundy and some of the other princes to attack and subdue him.
Jean Sans-peur was all the more willing as the Comte de Penthièvre had
married one of his daughters, so he came at once with his troops, and
preparations were going on vigorously for the invasion of Bretagne; but
the Duke, hearing of the indignation of his mother-in-law, “et de ceux qui
gouvernoit le roi,” became so frightened that he came to Paris and made
his submission. All the princes were very angry, and the Duc d’Orléans, his
brother-in-law, told him that the lion in his heart was not bigger than that
240
of a child of a year old. In fact, he seems to have been what some in
these days would call “well hustled,” and it would appear that the quarrel
between him and the Princess Jeanne was made up. One may imagine
that at any rate he must have altered his conduct as we find years after,
that the Penthièvres having taken him prisoner and threatened his life, she
persuaded her brother, the Dauphin, to forbid them to do him any injury,
and taking up arms herself she besieged and took their castles and forced
them to set him at liberty.
The next calamity that happened was the death, at Blois, of the
Princess Isabelle, Duchesse d’Orléans, in giving birth to her first child. The
young duke was overwhelmed with grief, and the only consolation he
241
seemed to find at first was in the infant daughter who survived. In her
“Life of Isabelle de Valois,” Miss Strickland declares that the second
marriage of Isabelle had been an extremely happy one, and remarks upon
the talents and virtues of the young Charles d’Orléans, the well-known
poet, of whose despairing verses on the death of Isabelle she gives a
translation, also of a later poem, which she declares to have been written
242
on the same subject. The young duke gave the rich dresses belonging
to her to make vestments for the abbey of St. Denis, where prayers were
said for her.
But none of the misfortunes that befel the royal family or the country
stopped the gaieties of the court. The King was at the Palais for Christmas
and sent for the Queen, who was at Vincennes, to come and join him and
bring the Duc d’Aquitaine, who had hitherto remained under her care. The
princes went to meet her and various splendid entertainments took place
when she arrived. She formally gave the Duc d’Aquitaine into the care of
the King, who appointed the Duke of Burgundy his governor. Nothing,
however, could be done in council without consent of the Queen. The
Ducs de Berry and Bourbon, disapproving of the overweening power of
Jean Sans-peur, left Paris and retired to their châteaux.
Jeanne, Duchesse de Bretagne, who had a son in this year, was very
anxious that her brother the Duc d’Aquitaine should come and attend her
“lever.” He was not allowed to do so, but a seigneur was sent instead,
243
with splendid jewels as presents for her. The monk of St. Denis in his
chronicle tells us that in the early part of July there was a strange omen in
Hainault. Innumerable flocks of birds of prey assembled and fought in the
air, as if leagued against each other. Storks, herons, and magpies attacked
rooks, crows, and jays, and a fierce battle ended in the victory of the
former, the ground being strewn with the bodies of the latter, and causing
people “of learning and experience” to say that bloody battles would soon
244
be going on.
It was a tolerably safe prediction to make at that time, more especially
as the death of Louis had not, as the Duke of Burgundy supposed it
would, annihilated the party of his opponents. On the contrary the
Orléanists married the young Duke Charles, now a widower, to Bonne,
daughter of Bernard, Comte d’Armagnac, one of the most powerful nobles
in the kingdom. He claimed descent from Clovis and had married a
daughter of the Duc de Berry. Brave, liberal, unscrupulous, a faithful
friend, and a relentless foe, he was the man chosen by the princes to take
the leadership of the party which none of them were capable of holding
themselves. From this time the name of the party changed from Orléanist
to Armagnac, and the strife became fiercer and more desperate than it
had ever been under the leadership of the more gentle, easy going Louis.
The royal family and court had sustained a great loss in the death of
the Duc de Bourbon, who died in August, 1410, on his way to help the
Armagnacs at the head of his troops, for he had never for an instant been
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