Sections14-05.mws

Unit 3: Ordinary Differential Equations - Part 2

Chapter 14: Series Solutions

Sections14.5: the nonlinear spring and Lindstedt's method

Copyright

Copyright * 2001 by Addison Wesley Longman, Inc.

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America.

Initializations

> restart;

> with(plots):
with(DEtools):

Warning, the name changecoords has been redefined

> interface(showassumed=0);

>

A Nonlinear Oscillator

The differential equation

`x''`(t)+x(t)+a*x(t)^3 = 0

that is,

> q := diff(x(t),t,t) + x(t) + a*x(t)^3 = 0;

q := diff(x(t),`$`(t,2))+x(t)+a*x(t)^3 = 0

>

governs an undamped oscillator whose spring obeys a nonlinear restoration law, F = -(x+a*x^3) . For a*`>`*0 , the spring is called "hard," while for a < 0 , it is called "soft." The magnitude of the restorative force for the hard spring is greater than that of the linear spring (whose restorative force is just -k*x ). Likewise, the magnitude of the restorative force for the soft spring is less than that of the linear spring for small enough displacements.

When a = 0 the system is just a simple harmonic oscillator which clearly supports periodic solutions. We wish to show that for a <> 0 the system also exhibits periodic solutions. We show this by obtaining a first integral (a function constant on the trajectories in the phase plane) and showing that its level curves, the trajectories, are closed curves. To this end, multiply the differential equation by x'( t ), and integrate with respect to t , obtaining

> q2 := map(Int,expand(q*diff(x(t),t)),t);

q2 := Int(diff(x(t),t)*diff(x(t),`$`(t,2))+diff(x(t...

>

The antiderivative on the right is a constant we will call E , and each term on the left is an exact differential. Hence, we obtain

> q3 := lhs(value(q2)) = E;

q3 := 1/2*diff(x(t),t)^2+1/2*x(t)^2+1/4*a*x(t)^4 = ...

>

For each value of a , the level curves of E = E(x,`x'`) define solutions of the differential equation. Indeed, differentiating E with respect to t yields

> q4 := collect(diff(q3,t),diff);

q4 := diff(x(t),t)*(diff(x(t),`$`(t,2))+x(t)+a*x(t)...

>

which is the original differential equation multiplied by `x'`(t) .

Hence, a solution of the differential equation is a level curve of E(x,`x'`) and a level curve of E = E(x,`x'`) defines a solution of the nonlinear differential equation.

It is easier to plot the level curves of E(x,`x'`) if we change variables according to

u = x( t )

v = x'( t )

so that

u ' = x' = v

v ' = x'' = -u-a*u^3

which then gives E(u,v) in the form

E = 1/2 ``(u^2+v^2) + a/4 u^4

that is,

> E := subs(diff(x(t),t)=v,x(t)=u,lhs(q3));

E := 1/2*v^2+1/2*u^2+1/4*a*u^4

>

For each value of a , the level curves of E( u , v ) = constant define solutions of the differential equation. Some notion of how the level curves (which are phase plane trajectories) vary with a is obtained from the following animation in which three contours of E are shown while a varies from 0.2 to 2.

> f := z -> contourplot(subs(a=z,E),u=-1..1,v=-1..1, contours=[.1,.2,.3], color=black):
display([seq(f(k/5),k=1..10)],insequence=true, scaling=constrained);

[Maple Plot]

>

We rely on the graphs in the animation to support the claim that the trajectories for this differential equation are closed curves. Hence, for a <> 0 the undamped oscillator with the nonlinear spring supports periodic solutions.

>

Dependence of Frequency on Initial Displacement

In the nonlinear case, the (angular) frequency depends on the initial displacement. If we let that intial displacement be first 1, then 2, (along with an initial velocity x'(0) = 0), and obtain graphs of the numeric solutions when a = 1 , we obtain Figure 14.10, the following graph, which shows two solutions corresponding to a = 1 .

> p1:=DEplot(subs(a=1,q),x(t),t=0..10,[[x(0)=1,D(x)(0)=0], [x(0)=2,D(x)(0)=0]], stepsize=.1,linecolor=black):
p2:=subs(THICKNESS(3)=THICKNESS(1),p1):
display(p2, scaling=constrained, xtickmarks=5, ytickmarks=5, labels=[`t `,x],labelfont=[TIMES,ITALIC,12]);

[Maple Plot]

>

The graph clearly indicates different periods, and hence frequencies, for the two solutions which start with different initial displacements.

This is in distinction to the behavior of the linear oscillator where, for a = 0 , the angular frequency is

omega = sqrt(k/m) = 1

a constant depending on just the spring constant k and the mass m . Indeed, for a = 0 we have

x(t) = c[1]*cos(t)+c[2]*sin(t)

that is,

> dsolve(subs(a=0,q),x(t));

x(t) = _C1*sin(t)+_C2*cos(t)

>

and the angular frequency omega = 1 is the multiplier of t in the trig functions in the solution.

In the nonlinear case, the dependence of the angular frequency on the initial displacement can be computed from the first integral E(u,v) . First, evaluate the constant E from the initial conditions ``(u,v) = ``(x,`x'`) = ``(A,0) , obtaining

> E0 := subs(v=0,u=A,E);

E0 := 1/2*A^2+1/4*a*A^4

>

Next, solve the equation E(u,v) = E[0] for v = dx/dt , obtaining the two solutions

v(u) = + 1/2 sqrt(2*A^4*a-4*u^2-2*u^4*a+4*A^2)

that is,

> V := solve(E=E0,v);

V := 1/2*sqrt(2*a*A^4-4*u^2-2*a*u^4+4*A^2), -1/2*sq...

>

If we set v(u) = dx/dt = du/dt and separate variables, we get

t = Int(du/v(u),u = A .. u[final])

On a closed trajectory in the phase plane, motion is clockwise. At ``(u,v) = ``(A,0) , the differential equations

u ' = x' = v

v ' = x'' = -u-a*u^3

give

v ' = -A-a*A^3 < 0

so motion at this point is downward, and hence, clockwise around the trajectory. Thus, we pick the negative square root for v(u) , and integrate to u[final] = 0 , one-quarter of the way around the trajectory. Thus, the total time for one orbit is

> T := Int(4/V[2],u=A..0);

T := Int(-8*1/(sqrt(2*a*A^4-4*u^2-2*a*u^4+4*A^2)),u...

>

To third-order, a series expansion of omega = 2*Pi/T in powers of a is then

omega = 1+3/8 A^2*a-21/256 A^4*a^2+81/2048 A^6*a^3

obtained in Maple via

> assume(A>0):
omega = series(2*Pi/T,a,4);

omega = series(1+3/8*A^2*a+(-21/256*A^4)*a^2+81/204...

>

Thus, for the nonlinear oscillator, the angular frequency depends on the initial displacement, and we have obtained a series expansion of this dependence. Shortly, we will compute this same expression by Lindstedt's perturbation technique.

>

Regular Perturbation

As we saw in Sections14.4, a regular perturbation will lead to an expansion containing secular terms which are not periodic. Hence, the regular perturbation series of Poincare cannot approximate the periodic solutions of the nonlinear oscillator. We therefore fail to learn about the depencence of the frequency on the initial displacement.

However, for the sake of completeness, we will develop the regular perturbation. The purpose is to justify the claim that it contains secular terms which prevent it from approximating the periodic solutions of the nonlinear oscillator.

Assume a regular perturbation series of the form

> X := add(x[k](t)*a^k,k=0..2);

X := x[0](t)+x[1](t)*a+x[2](t)*a^2

>

and substitute this into the differential equation, obtaining sum(A[k]*a^k,k = 0 .. 2) = 0 ,

that is,

> q5 := collect(simplify(subs(x(t)=X,q)),a);

q5 := x[2](t)^3*a^7+3*x[1](t)*a^6*x[2](t)^2+(3*x[0]...
q5 := x[2](t)^3*a^7+3*x[1](t)*a^6*x[2](t)^2+(3*x[0]...
q5 := x[2](t)^3*a^7+3*x[1](t)*a^6*x[2](t)^2+(3*x[0]...

>

where the coefficients A[k] are given by

> for k from 0 to 2 do
A[k] = map(coeff,q5,a,k);
od;

A[0] = (diff(x[0](t),`$`(t,2))+x[0](t) = 0)

A[1] = (diff(x[1](t),`$`(t,2))+x[0](t)^3+x[1](t) = ...

A[2] = (x[2](t)+diff(x[2](t),`$`(t,2))+3*x[0](t)^2*...

>

The identical vanishing of the A[k] gives differential equations for the x[k] . The first equation

`x''`[0](t)+x[0](t) = 0

depends only on x[0](t) , so can be solved immediately. For simplicity, we choose the initial point as ``(1,0) , thereby obtaining

x[0](t) = cos(t)

Each successive differential equation contains terms depending on the solution of the previous equations. We solve this sequence of equations, taking the initial point as ``(0,0) for each successive approximation.

Clearly, this is a job for Maple. To facilitate our work in Maple, we replace the symbols A[k] with Q[k] via the loop

> for k from 0 to 2 do
Q||k := map(coeff,q5,a,k);
od;

Q0 := diff(x[0](t),`$`(t,2))+x[0](t) = 0

Q1 := diff(x[1](t),`$`(t,2))+x[0](t)^3+x[1](t) = 0

Q2 := x[2](t)+diff(x[2](t),`$`(t,2))+3*x[0](t)^2*x[...

>

We then obtain x[0](t) , the solution of the first equation and initial condition ``(1,0) , as

> s0 := dsolve({Q0,x[0](0)=1,D(x[0])(0)=0},x[0](t));

s0 := x[0](t) = cos(t)

>

Each successive differential equation contains terms depending on the solutions of previous equations. We solve this sequence of equations, taking the initial point as (0,0) for each successive approximation. We thereby obtain

> for k from 1 to 2 do
s||k := combine(dsolve({subs(seq(s||n,n=0..k-1),Q||k),x[k](0)=0,D(x[k])(0)=0}, x[k](t)),trig);
od;

s1 := x[1](t) = 1/32*cos(3*t)-1/32*cos(t)-3/8*sin(t...

s2 := x[2](t) = 23/1024*cos(t)-9/256*t*sin(3*t)+1/1...

>

The solutions for both x[1](t) and x[2](t) contain secular terms, as predicted. The regular perturbation series is not useful for studying the dependence of the frequency on the initial displacement. We therefore consider Lindstedt's method for generating a more useful asymptotic expansion.

>

Lindstedt's Method

In Lindstedt's method, the angular frequency is made to depend on a by assuming

omega = omega(a) = 1 + sum(omega[k]*a^k,k = 1 .. infinity)

for which a truncated version is

> W := 1 + add(omega[k]*a^k,k=1..3);

W := 1+omega[1]*a+omega[2]*a^2+omega[3]*a^3

>

We then carry out a perturbation solution of the differential equation by writing

x(t) = Sum(x[k](t)*a^k,k = 0 .. infinity)

Since the angular frequence omega is related to the period T by

omega*T = 2*Pi

the two expansions in the Lindstedt method are merged by the change of variables tau = omega*t . In terms of tau , the solution assumes the form

x(t) = x(tau/omega) = U(tau) = Sum(u[k](tau)*a^k,k = 0 .. infinity)

and the differential equation becomes

omega^2*`U''`(tau)+U(tau)+a*U(tau)^3 = 0

where now, primes denote differentiation with respect to tau .

The change of variables rests on the chain rule which gives

dx/dt = dU/d/tau d*tau/dt = dU/d/tau omega

A second application of the chain rule then gives the omega^2 multiplying U''( tau ).

In fact, with the differential equation given by

> q;

diff(x(t),`$`(t,2))+x(t)+a*x(t)^3 = 0

>

the change of variables is effected in Maple by

> q6 := Dchangevar({t=tau/omega,x(t)=U(tau)},q,t,tau);

q6 := omega^2*diff(U(tau),`$`(tau,2))+U(tau)+a*U(ta...

>

We next write the first few terms in the expansion for U( tau ).

> UU := add(u[k](tau)*a^k,k=0..3);

UU := u[0](tau)+u[1](tau)*a+u[2](tau)*a^2+u[3](tau)...

>

Then, substitute into the differential equation

> q6;

omega^2*diff(U(tau),`$`(tau,2))+U(tau)+a*U(tau)^3 =...

>

the expansions for both U(tau) and omega(tau) , collect coefficients of like powers of a , and thus obtain

> q7 := collect(simplify(subs(omega=W,U(tau)=UU,q6)),a);

q7 := u[3](tau)^3*a^10+(3*u[2](tau)*u[3](tau)^2+ome...
q7 := u[3](tau)^3*a^10+(3*u[2](tau)*u[3](tau)^2+ome...
q7 := u[3](tau)^3*a^10+(3*u[2](tau)*u[3](tau)^2+ome...
q7 := u[3](tau)^3*a^10+(3*u[2](tau)*u[3](tau)^2+ome...
q7 := u[3](tau)^3*a^10+(3*u[2](tau)*u[3](tau)^2+ome...
q7 := u[3](tau)^3*a^10+(3*u[2](tau)*u[3](tau)^2+ome...
q7 := u[3](tau)^3*a^10+(3*u[2](tau)*u[3](tau)^2+ome...
q7 := u[3](tau)^3*a^10+(3*u[2](tau)*u[3](tau)^2+ome...
q7 := u[3](tau)^3*a^10+(3*u[2](tau)*u[3](tau)^2+ome...
q7 := u[3](tau)^3*a^10+(3*u[2](tau)*u[3](tau)^2+ome...

>

Putting this into the form sum(sigma[k]*a^k,k = 0 .. 3) = 0 , we get for sigma[k] the expresions

> for k from 0 to 3 do
sigma[k] = map(coeff,q7,a,k);
od;

sigma[0] = (u[0](tau)+diff(u[0](tau),`$`(tau,2)) = ...

sigma[1] = (diff(u[1](tau),`$`(tau,2))+u[0](tau)^3+...

sigma[2] = (2*omega[1]*diff(u[1](tau),`$`(tau,2))+d...

sigma[3] = (u[3](tau)+2*omega[3]*diff(u[0](tau),`$`...
sigma[3] = (u[3](tau)+2*omega[3]*diff(u[0](tau),`$`...

>

The identical vanishing of the sigma[k] give differential equations for the u[k] . To facilitate this calculation in Maple, we rewrite the equations sigma[k] = 0 as Q[k] = 0 via the following loop.

> for k from 0 to 3 do
Q||k := map(coeff,q7,a,k);
od;

Q0 := u[0](tau)+diff(u[0](tau),`$`(tau,2)) = 0

Q1 := diff(u[1](tau),`$`(tau,2))+u[0](tau)^3+u[1](t...

Q2 := 2*omega[1]*diff(u[1](tau),`$`(tau,2))+diff(u[...

Q3 := u[3](tau)+2*omega[3]*diff(u[0](tau),`$`(tau,2...
Q3 := u[3](tau)+2*omega[3]*diff(u[0](tau),`$`(tau,2...

>

The first equation contains only u[0](tau) , so this equation, and the initial conditions u[0](0) = A , u[0] '(0) = 0, lead to the solution

> s0 := dsolve({Q0,u[0](0)=A,D(u[0])(0)=0},u[0](tau));

s0 := u[0](tau) = A*cos(tau)

>

The equation for u[1](tau) contains terms in u[0](tau) . Incorporating this solution and the initial conditions u[1](0) = 0 , u[0] '(0) = 0, we obtain

> s1 := combine(dsolve({simplify(subs(s0,Q1)),u[1](0)=0,D(u[1])(0)=0}, u[1](tau)),trig);

s1 := u[1](tau) = -1/32*A^3*cos(tau)+1/32*A^3*cos(3...

>

As with the regular perturbation, we have secular terms appearing. However, the coefficient omega[1] is as yet undetermined, so we choose a value for it which will guarantee the vanishing of the secular term. Thus, collect all secular terms with

> q8 := collect(s1,[tau,sin]);

q8 := u[1](tau) = (A*omega[1]-3/8*A^3)*sin(tau)*tau...

>

and set the coefficient of the secular term equal to zero.

> q9 := map(coeff,q8,sin(tau));

q9 := 0 = (A*omega[1]-3/8*A^3)*tau

>

Solving for the value of omega[1] which eliminates the secular term from u[1](tau) , we find

> w[1] := solve(q9,omega[1]);

w[1] := 3/8*A^2

>

so that u[1](tau) becomes

> subs(omega[1]=w[1],s1);

u[1](tau) = -1/32*A^3*cos(tau)+1/32*A^3*cos(3*tau)

>

The equation for u[2](tau) contains terms involving u[0](tau), u[1](tau) and omega[1] . Thus, making the appropriate substitutions, we solve for the function u[2](tau) satisfying the initial conditions u[2](0) = 0, u[2] '(0) = 0, obtaining

> s2 := combine(dsolve({simplify(subs(s0,s1,omega[1]=w[1],Q2)), u[2](0)=0, D(u[2])(0)=0}, u[2](tau)),trig);

s2 := u[2](tau) = 23/1024*A^5*cos(tau)+1/1024*A^5*c...

>

Again, there are secular terms which we collect via

> q10 := collect(s2,[tau,sin]);

q10 := u[2](tau) = (A*omega[2]+21/256*A^5)*sin(tau)...

>

We then determine omega[2] by the requirement that there be no secular terms in u[2](tau) . Hence, form the equation

> q11 := map(coeff,q10,sin(tau));

q11 := 0 = (A*omega[2]+21/256*A^5)*tau

>

from which we determine

> w[2] := solve(q11,omega[2]);

w[2] := -21/256*A^4

>

The function u[2](tau) thus becomes

> subs(omega[2]=w[2],s2);

u[2](tau) = 23/1024*A^5*cos(tau)+1/1024*A^5*cos(5*t...

>

The equation for u[3](tau) contains terms in u[0](tau), u[1](tau), u[2](tau), omega[1] and omega[2] . Making the appropriate substitutions, and solving for the u[3](tau) which satisfies the initial conditions u[3](0) = 0, u[3] '(0) = 0, we obtain

> s3 := combine(dsolve({simplify(subs(s0,s1,s2,omega[1]=w[1], omega[2]=w[2], Q3)), u[3](0)=0,D(u[3])(0)=0}, u[3](tau)),trig);

s3 := u[3](tau) = -547/32768*A^7*cos(tau)-3/2048*A^...

>

Once again, there are secular terms which we gather together with

> q12 := collect(subs(omega[1]=w[1],omega[2]=w[2],s3),[tau,sin]);

q12 := u[3](tau) = (A*omega[3]-81/2048*A^7)*sin(tau...

>

To choose the omega[3] which eliminates the secular term from u[3](tau) , form the equation

> q13 := map(coeff,q12,sin(tau));

q13 := 0 = (A*omega[3]-81/2048*A^7)*tau

>

and solve, obtaining

> w[3] := solve(q13,omega[3]);

w[3] := 81/2048*A^6

>

Consequently, the solution for u[3](tau) is

> subs(omega[3]=w[3],s3);

u[3](tau) = -547/32768*A^7*cos(tau)-3/2048*A^7*cos(...

>

and, the first few terms of the expansion for omega are

> omega = 1 + add(w[k]*a^k,k=1..3);

omega = 1+3/8*A^2*a-21/256*A^4*a^2+81/2048*A^6*a^3

>

This compares favorably to the expansion

> series(2*Pi/T,a,4);

series(1+3/8*A^2*a+(-21/256*A^4)*a^2+81/2048*A^6*a^...

>

found in an earlier section.

The Lindstedt solution is then given by

> U(tau) = subs(s||(0..3),seq(omega[k]=w[k],k=1..3),UU);

U(tau) = A*cos(tau)+(-1/32*A^3*cos(tau)+1/32*A^3*co...
U(tau) = A*cos(tau)+(-1/32*A^3*cos(tau)+1/32*A^3*co...

>

where U(tau) = U(t*omega) = x(t) , and omega is as above. To judge the viability of the Lindstedt expansion, write the approximation as a function of t , obtaining, for x(t)

> q14 := subs(s||(0..3),seq(omega[k]=w[k],k=1..3),
tau=t*(1+add(w[k]*a^k,k=1..3)),UU);

q14 := A*cos(t*(1+3/8*A^2*a-21/256*A^4*a^2+81/2048*...
q14 := A*cos(t*(1+3/8*A^2*a-21/256*A^4*a^2+81/2048*...
q14 := A*cos(t*(1+3/8*A^2*a-21/256*A^4*a^2+81/2048*...
q14 := A*cos(t*(1+3/8*A^2*a-21/256*A^4*a^2+81/2048*...
q14 := A*cos(t*(1+3/8*A^2*a-21/256*A^4*a^2+81/2048*...
q14 := A*cos(t*(1+3/8*A^2*a-21/256*A^4*a^2+81/2048*...

>

Since our test of the utility of the expansion will be a graph, assign the values A = 2 and a = 1/10 to the initial displacement and spring parameter, respectively. Thus, the approximate solution for x(t) is

> q15 := subs(A=2,a=1/10,q14);

q15 := 506893/256000*cos(36461/32000*t)+2537/128000...

>

To establish xx(t) as a numeric reference solution against which to test Lindstedt's solution, execute

> F := dsolve({subs(a=1/10,q),x(0)=2,D(x)(0)=0},x(t),numeric):
xx := z -> subs(F(z),x(t)):

>

and then draw Figure 14.11, the graph of the Lindstedt solution (the dotted red curve), and a numeric solution (the solid black curve), for 100 <= t `` <= 110 .

> plot(['xx'(t),q15],t=100..110,color=[black,red], linestyle=[1,2], xtickmarks=6, ytickmarks=5, labels=[t,`x `], labelfont=[TIMES,ITALIC,12]);

[Maple Plot]

>

In the neighborhood of t = 105 , the two solutions are still in agreement. Figure 14.12, the next plot, shows these two solutions for 150 <= t `` <= 160 . In the neighborhood of t = 155 , the two solutions start separating.

> plot(['xx'(t),q15],t=150..160,color=[black,red], linestyle=[1,2], xtickmarks=6, ytickmarks=5, labels=[t,`x `], labelfont=[TIMES,ITALIC,12]);

[Maple Plot]

>

However, with a = 1/10 and t = 100 , the Lindstedt expansion gives remarkable accuracy.

>