Practical Matlab Modeling With Simulink Programming Ordinary and Partial Differential Equations 1st Edition Sulaymon L Eshkabilov Instant Download
Practical Matlab Modeling With Simulink Programming Ordinary and Partial Differential Equations 1st Edition Sulaymon L Eshkabilov Instant Download
https://ebookbell.com/product/practical-matlab-modeling-with-simulink-
programming-and-simulating-ordinary-and-partial-differential-
equations-sulaymon-l-eshkabilov-10889488
https://ebookbell.com/product/practical-matlab-with-modeling-
simulation-and-processing-projects-irfan-turk-10555516
https://ebookbell.com/product/development-of-innovative-drugs-via-
modeling-with-matlab-a-practical-guide-1st-edition-ronald-
gieschke-4606928
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
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
https://ebookbell.com/product/network-modeling-simulation-and-
analysis-in-matlab-theory-and-practices-chatterjee-12074970
https://ebookbell.com/product/practical-matlab-deep-learning-a-
projectsbased-approach-2nd-edition-2nd-michael-paluszek-46093502
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
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
Introduction������������������������������������������������������������������������������������������������������������xix
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
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
vii
Table of Contents
viii
Table of Contents
ix
Table of Contents
x
Table of Contents
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.
xix
Introduction
xx
Introduction
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
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.
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
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
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
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
E xample 5
Given an ODE, y + 2ty 2 = 0 , with the initial condition y(0) = 0.5.
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.)
9
Chapter 1 Analytical Solutions for ODEs
>> ysol=vectorize(solution)
ysol =
1./(t.^2 + 2)
>> t=(-5:.1:5); ysol_values=eval(ysol);
10
Chapter 1 Analytical Solutions for ODEs
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)
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
Here’s an example:
12
Chapter 1 Analytical Solutions for ODEs
Here’s an example:
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))
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:
%% 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)
/ 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)
æ 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.
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.
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
y + y + 2 y = 3 , y(0) = 1, y ( 0 ) = 0.
Now, let’s test the code to solve this equation: 1.3
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
21
Chapter 1 Analytical Solutions for ODEs
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:
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.
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
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 )
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
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
% 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
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:
28
Chapter 1 Analytical Solutions for ODEs
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().
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
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
The computed analytical solutions displayed in the command window are as follows
(see Figure 1-8):
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
% 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.
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.
ebookbell.com