First Order Equations from Lagrangian Method
First Order Equations from Lagrangian Method
It was seen in the last chapter that the Lagrangian methodology yields the system equations
in the second order. The next step would be to solve the equations to obtain the course of
evolution of the system starting from any given initial condition.
It is known that differential equations are much easier to solve if they are expressed in
the first order. Especially if the solution is to be obtained through numerical methods in a
computer, it is desirable to express the equations in first order form. Standard numerical
routines like the Runge-Kutta method can then be applied to obtain the solution.
Example 5.1 Find the generalized momenta and the first order equation for the spring-pendulum
system of Example 4.4.
Solution: Recall that the Lagrangian was given by
Here the generalized coordinates are ! and . Hence the generalized momenta are
"
and
#
Putting the derivative quantities in the left hand side we get two first order equations as
$ (5.3)
% & $
(5.4)
The differential equations in the conjugate momenta are obtained from (5.2), with the
Rayleigh term set to zero. The first equation is obtained from
as
('
&
Substituting we get
$
*+ '
)
(5.5)
C L2
q1 L1
q2 R
E
(5.7)
Next, we note that the kinetic energy is a homogeneous function of degree 2 in the generalized
velocities. To illustrate what this means, consider a two dimensional system, where is a
function of and . The functional form of would be such that if we multiply a constant
with " and then
$
$
Functions with such property are called homogeneous function of degree 2. The kinetic en-
ergy of all the systems considered so far follow this property (the reader may check this fact).
In fact, barring a few exceptions all physical systems have kinetic energy with this functional
form. Now differentiate both sides of the equation by , to get
Since the choice of is arbitrary, this equation would be valid for also. Hence
The same result would hold for a homogeneous function in more than two variables (the case
for higher dimensional systems). Thus in general we have
This result also goes by the name of the great mathematician Euler, called the Euler
theorem for homogeneous functions. From it, by (5.7) we have
OBTAINING FIRST ORDER EQUATIONS 64
The function in the right hand side is called the Hamiltonian function in classical mechan-
ics. We thus find that the Hamiltonian function is nothing but the total energy for systems in
which the above functional forms of and hold. Since all systems an engineer has to
deal with obey these functional forms and since total energy is a much clearer notion for an
engineer, we have preferred to begin from that premise to arrive at the Hamiltonian function.
In the Hamiltonian formalism, the fundamental variables are , and . It is therefore
necessary to express the function in terms of the generalized positions, momenta and time.
Since in our earlier discussions we have expressed as a function of , it will be necessary to
substitute in terms of . This can be easily obtained by using the definition of generalized
momenta as (5.1).
After
is obtained, the equations of motion in terms of can be obtained by
taking the differential of as
(5.9)
Since is a function of , and , using (5.8) we can also write as
The first two equations, expressed in the first order form, are called the Hamiltonian equa-
tions of motion. These provide an easy way of deriving the first order differential equations
of any system directly. The only drawback is the existance of the dissipative term as function
of the generalized velocities which are not the fundamental
variables in the Hamiltonian rep-
resentation. This, however, is no great deterrant since can always be substituted in terms of
the fundamental variables by using (5.11). Note also that the equations (5.11) give basically
the same functional relationship between and as the equations (5.1).
It may be noted that (5.13) is not a differential equation and hence is not needed to
represent the dynamics.
It only says that if the Lagrangian does not have explicit dependence
on time (i.e., if does not appear in its functional form), then also would not be explicitly
dependent on time. This is obvious, since both are composed of the functions and .
In absence of dissipative forces the first two equations take very symmetrical form:
(5.14)
(5.15)
Such symmetry in the form of dynamical equations has prompted generations of scientists to
probe these systems in details and through this a body of knowledge has emerged. Dynamical
systems where these equations hold are called Hamiltonian systems. We shall, however, not
like to concentrate on such systems which are almost nonexistent in engineering, and will
use differential equations of the form
(5.16)
'
(5.17)
Example 5.3 Let us take the system in the example 5.2 and derive the system equations by
the Hamiltonian method.
$
"
"
Hence the Hamiltonian equations are
$
OBTAINING FIRST ORDER EQUATIONS 66
Note that these equations are the same as those derived in example 5.2.
1 2
L
E q1 C q2 R
Example 5.4 The simple circuit of Fig. 5.2 was taken up in Chapter 3. If we want to obtain
the first order equations by the Hamiltonian method, we note:
" #
$
Therefore,
or,
('
and
The Hamiltonian function can then be expressed as
In terms of this Hamiltonian function,
(5.18)
and since , cannot be evaluated. The momentum equations are:
"
(5.19)
OBTAINING FIRST ORDER EQUATIONS 67
Since , . Therefore
"
(5.20)
Therefore (5.18), (5.19), and (5.20) are the three first order equations.
It may be noted that though the obtained equations are correct (in the sense that they
suffice in defining the time evolution), these are not the minimum set of equations required
to define the dynamics of the systems. In Example 5.3 there are three independent storage
elements, and so a minimum of three first order differential equations should suffice in defin-
ing the dynamics. In Example 5.4 there are two storage elements, and hence there should
be two independent differential equations. But the equations obtained are one more than the
minimum necessary number.
The problem lies in our assumption of the position coordinates as the charges flowing in
the loops irrespective of what constitute the elements of the loop. One possible way out is to
consider the charges flowing in the storage elements as the variables.
Example 5.5 In this example, we work out the differential equations of the system in the last
example in terms of the currents flowing through the inductor and the capacitor as shown in
Fig 5.3.
L q1 q
2
E C R
In this case
"
$
Therefore,
('
or, and
Therefore (5.24) and (5.23) are the two first order equations.
C2 q
3
L q1 q2 R 1
q1 q3 q1 q2
+ E R2
− C1
q q +q
1 2 3
Figure 5.4: The circuit pertaining to Example 5.6, with charges flowing in the storage ele-
ments chosen as the coordinates.
Example 5.6 In this example, we consider the same system as in Example 4.10, and define
the variables differently — the charges flowing in the storage elements forming the coordi-
nates. Since these branches form a tree, these variables suffice in defining the charges in all
other branches, as shown in Fig. 5.4. In this case
) $ )
)
'
OBTAINING FIRST ORDER EQUATIONS 69
This gives
) '
Thus can be written as
) $ )
'
. Since ) ,
The
first set
of Hamiltonian equations give
and ) are undefined, and ) .
The second set of Hamiltonian equations give
$
$
)
$ $ )
)
$ )
'
)
Algebraic manipulation of these three equations yield
)
)
)
These three are the first order differential equations of the system.
Example 5.7 The system under consideration is shown in Fig. 5.5. In this problem, the gen-
eralized coordinates are
: The charge flowing in the armature circuit
: The angle of the rotor
) : The angle of the load wheel.
The electrical circuit and the mechanical part can be treated as two subsystems. These
two subsystems interact through the torque exerted by the electrical side on the mechanical
side and the back emf exerted by the mechanical side on the electrical side. These are given
by
and
OBTAINING FIRST ORDER EQUATIONS 70
La Ra
q1 I 1 , R1
k
E I2
q2 q3 R2
Const.
Figure 5.5: The separately excited dc motor and mechanical load system with a flexible shaft.
where is a constant and is the field flux.
In the electrical subsystem,
$
Thus we can write
, the Hamiltonian of the electrical subsystem in terms of and as
This gives the 1st order equations as
(5.25)
" "
(5.26)
)
and
)
)
The Hamiltonian function of the mechanical system can be expressed as
)
)
The first order equations for the mechanical subsystem are obtained as
(5.27)
) )
(5.28)
)
)
) (5.29)
)
) )
)
) ) ) (5.30)
The interaction between the mechanical and electrical subsystems occur through the back emf
and the torque, which appear in equations (5.26) and (5.29) respectively. When expressed in
terms of the generalized coordinates, these become
and
Substituting these into (5.26) and (5.29) we get
(5.31)
)
(5.32)
Now let us demonstrate how to obtain the state equations by the Lagrangian methodology,
without treating the electrical and mechanical subsystems separately.
The total kinetic energy is
)
the total potential energy is
)
)
OBTAINING FIRST ORDER EQUATIONS 72
Now notice that the potential energy has terms dependent on the generalized velocities.
This violates the assumption
used in deriving the Lagrangian equation (4.15). Therefore in this case we have to use the
form that is derived without using this assumption. This is
(5.33)
)
)
)
) '
In this case the expression for the generalized momenta will be
which gives
$
)
)
And the first order equations are obtained from
as
"
(5.34)
)
)
(5.35)
)
) )
)
) ' (5.36)
Series Motor: If a series motor (with field resistance and field inductance ) supplies
the same load, no new state variable will be necessary. Since the field circuit is in series with
OBTAINING FIRST ORDER EQUATIONS 73
the armature circuit, will be replaced by
and by
in the state
variable equations.
However there will be major change in the torque and the emf equations as the field flux
is dependent on the field current. In this case,
$
and
Thus (5.31) will be modified to
and (5.32) will be modified to
)
)
Shunt motor: In case of a shunt motor, the dynamics of the shunt field will have to be
considered and hence an additional generalized coordinate ( ), the flow of charge in the
shunt field, will be included. In this case the back emf equation will be
(5.39)
(5.40)