Skip to main content
The Scientific World Journal logoLink to The Scientific World Journal
. 2022 May 17;2022:2357258. doi: 10.1155/2022/2357258

An Elementary Solution to a Duffing Equation

Alvaro H Salas 1,
PMCID: PMC9338748  PMID: 35915602

Abstract

In this work, we study the Duffing equation. Analytical solution for undamped and unforced case is provided for any given arbitrary initial conditions. An approximate analytical solution is given for the damped or trigonometrically forced Duffing equation for arbitrary initial conditions. The analytical solutions are expressed in terms of elementary trigonometric functions as well as in terms of the Jacobian elliptic functions. Examples are added to illustrate the obtained results. We also introduce new functions for approximating the Jacobian and Weierstrass elliptic functions in terms of the trigonometric functions sine and cosine. Results are high accurate.

1. Introduction

Many physical phenomena are modeled by nonlinear systems of ordinary differential equations. The Duffing equation is an externally forced and damped oscillator equation that exhibits a range of interesting dynamic behavior in its solutions. The Duffing oscillator is an important model of nonlinear and chaotic dynamics. It was introduced by Germanic engineer Duffing in 1918 [1]. The Duffing oscillator is described by the differential equation:

x¨+rx˙+ω02x+βx3=F  cos  ωt. (1)

It differs from the classical forced and damped harmonic oscillator only by the nonlinear term βx3, which changes the dynamics of the system drastically. Motivated by potential applications in physics, engineering, biology, and communication theory, the damped Duffing equation

x¨+rx˙+ω02x+βx3=0, (2)

is considered. Equation (2) is a ubiquitous model arising in many branches of physics and engineering, such as the study of oscillations of a rigid pendulum undergoing with moderately large amplitude motion [2, 3], vibrations of a buckled beam, and so on [35].

It has provided a useful paradigm for studying nonlinear oscillations and chaotic dynamical systems, dating back to the development of approximate analytical methods based on perturbative ideas [2], and continuing with the advent of fast numerical integration by the computer, to be used as an archetypal illustration of chaos [2, 57]. Various methods for studying the damped Duffing equation and the forced Duffing equation (1) in feedback control, strange attractor, stability, periodic solutions, and numerical simulations have been proposed, and a vast number of profound results have been established [2].

The Duffing equation has been studied extensively in the literature. However, only few works are devoted to the study of its analytical solutions not using perturbation methods [8, 9]. Our aim is to avoid using such perturbation methods. This study is organized as follows. In the first section, we give exact analytical solution for the undamped and unforced Duffing equation for any given arbitrary initial conditions. In the second section, we provide formulas for obtaining a good approximate analytical solution using a new ansatz. The problems are solved for any arbitrary initial conditions. Finally, in the last section, we give approximate analytical solution to (1) and we compare it with Runge–Kutta numerical solution. Other useful methods are the homotopy perturbation method (HPM) [1017], the Lindstedt–Poincaré method, and the Krylov–Bogoliubov–Mitropolsky method. The importance of numerical solution of differential equations in different fields of science and engineering is given in [18, 19].

2. Undamped and Unforced Duffing Equation

This is the equation:

x¨+px+qx3=0,x=xt, (3)

and given the initial conditions,

x0=x0 and x0=x˙0. (4)

The general solution to equation (3) may be written in terms of any of the twelve Jacobian elliptic functions [20]. Let, for example,

xt=c1cnωt+c2,m. (5)

Then,

x¨+px+qx3=c13q2c1mωcn3+2c1mω+c1pc1ωcn,where cn=cnωt+c2,m. (6)

Equating to zero, the coefficients of cnj to zero gives an algebraic system whose solution is

ω=p+qc12 and m=qc122p+qc12. (7)

Thus, the general solution to the Duffing equation is

xt=cnp+qc12t+c2,qc122p+qc12. (8)

The values for the constants c1 and c2 are determined from the initial conditions.

Definition 1 . —

The number Δ=p+qx022+2qx˙02 is called the discriminant for the Duffing equations (3) and (4).

We will distinguish three cases depending on the sign of the discriminant [20].

2.1. First Case: Δ > 0

The solution to the i.v.p. (3) and (4) is given by

xt=ΔpqcnΔt4signx˙0cn1qΔpx0,12p2Δ,12p2Δ. (9)

Making use of the addition formula,

cnx+y,m=cnx,mcny,m+snx,mdnx,msny,mdny,m1msnx,msny,m. (10)

The solution (9) may be expressed as

xt=x0cnΔt4|m+x˙0/Δ4snΔt4|mdnΔt4|m1+p+qx02/2Δ1/2snΔt4|m2, (11)

where

m=121pΔ. (12)

Solution (11) is a periodic solution with period

T=4K1/21p/ΔΔ4. (13)

Example 1 . —

Let us consider the i.v.p.

xt+xt+x3t=0,x0=1&x0=1. (14)

Using formula (9), the exact solution to (14) is given by

xt=61cn6t4cn111+6,12126|12126. (15)

According to the relations (11) and (12), the exact solution to the i.v.p. (14) may also be written as

xt=cn6t4|1/211/6+6  dn46t4|1/211/6sn6t4|1/211/61+26/26sn6t4|1/211/62. (16)

The period is given by

T=28434K121164.37417. (17)

In Figure 1, the comparison between the exact analytical solution (??) and the approximate numerical RK4 solution is presented. Full compatibility between the two analytical and numerical solutions is observed.

Figure 1.

Figure 1

Comparison between the exact solution and the numerical solution for Example 1.

2.2. Second Case: Δ < 0

In this case, q < 0. Define

δ=2px02+qx04+2x˙02q. (18)

Observe that

δ=p2Δq2>0. (19)

Let

xt=c2c1+yt, (20)

where y=y(t) is a solution to Duffing equation

yt+ayt+by3t (21)

with initial conditions

y0=y0=2cx˙0cx02 and y0=y˙0=c+x0cx0. (22)

Inserting ansatz (21) into the ode x′′(t)+px(t)+qx3(t)=0 and taking into account the relation,

yt2=y˙0+ay02+b2y04ay2tb2y4t, (23)

we get

cytcx0ytx04cx04yt+14x¨+px+qx3=8ac58ac4x08ac3x02+8ac2x03+4bc5+12bc4x0+12bc3x02+4bc2x03+c7q5c6qx0+2c5p+11c5qx0210c4px015c4qx03+20c3px02+15c3qx04+30c3x˙0220c2px0311c2qx0522c2x0x˙02+10cpx04+5cqx06+10cx02x˙022px05qx072x03x˙02+cx08ac416ac3x0+8ac2x02+4bc4+8bc3x0+4bc2x023c6q+10c5qx0+2c4p11c4qx0212c3px0+24c2px02+11c2qx04+22c2x˙0220cpx0310cqx0520cx0x˙02+6px04+3qx06+6x02x˙02yt+cx024bc3+4bc2x0+3c5q5c4qx02c3p2c2px0+10cpx02+5cqx04+10cx˙026px033qx056x0x˙02y2t+cx034bc2qc42c2p+2px02+qx04+2x˙02y3t. (24)

Equating to zero, the coefficients of yj(t) give an algebraic system. A solution to this system is

a=12p3δq,b=12pδq,c=δ4. (25)

Observe that the Duffing equations (21) and (22) have a positive discriminant given by

a+by022+2by˙02=δcx042c4x˙02+δc2+x0224c8x02. (26)

Then, the problem reduces to the first case.

Example 2 . —

Let us assume the following i.v.p.:

xt+2xtx3t=0,x0=1 and x0=1. (27)

The solution of i.v.p. (27) according to the relation (??) reads

xt=1.495352.99071+0.198509cn2.08627t|1.000180.230219  dn2.08627t|1.00018sn2.08627t|1.00018/11.00072sn2.08627t|1.000182. (28)

The period of solution (28) is given by

T=4K1/mwm=10.9034for m=1.00018 and w=2.08627. (29)

Comparison between the exact solution and numerical solution is shown in Figure 2.

Figure 2.

Figure 2

Comparison between the exact solution and the numerical solution for Example 2.

2.3. Third Case: Δ=0 and p ≠ 0

If the discriminant vanishes (Δ=0), then q < 0, and the only solution to problem (??) with

x02=x˙02=p+qy0222q (30)

reads

xt=pqtanhp2t±  tanh1x0qp, (31)

which may be verified by direct computation.

2.4. Fourth Case: Δ=0 and p=0

The solution is given by

xt=2x02+2qx0  t. (32)

Remark 1 . —

The solution to the i.v.p.

x¨+px+qx3=0, x0=x0 and x0=0, (33)

is

xt=x0cnp+qx02,qx022p+qx02. (34)

Remark 2 . —

Let p+p2+2qx˙02>0. Then, the solution to the i.v.p.

x¨+px+qx3=0,x0=0 and x0=x˙0, (35)

is

xt=2x˙0p2+2qx˙02+psnp+p2+2qx˙022t,p2+qx˙02p2+2qx˙02pqx˙02. (36)

Remark 3 . —

Using the identity

cnωt,m=164m+11+12/4m+1ωt;1/1216m216m+1ω2,1/2162m132m232m1ω3, (37)

the solution to the Duffing equations (3) and (4) may be written in terms of the Weierstrass elliptic function . More precisely, if Δ > 0, then

xt=AA2+4p/3A2q+p1+12/3A2q+pt+t0;1/123q2A46pqA2+p2,1/216p9q2A4+18pqA2+p2, (38)

where

t0=13A3q+3A2qx0+5Ap+px012Ax0;1123A4q26A2pq+p2,1216p9A4q2+18A2pq+p2, (39)
A=p±p+qx022+2qx˙02q=±p±Δq. (40)

The solution (38) is periodic with period

T=2ρ+dx4x3g2xg3, (41)

where ρ is the greatest real root to the cubic 4x3g2xg3=0 and

g2=1123q2A46pqA2+p2 and g3=1216p9A4q2+18A2pq+p2. (42)

On the other hand,

t;g2,g3=3g216m216m+11  cn23g2/16m216m+14t,mg24m+1248m248m+3, (43)

where m is a root to the sextic

4096g2327g32z612288g2327g32z5+13056g2327g32z45632g2327g32z3+1259g231836g32z2+125g23+108g32z+g2327g32=0. (44)

Thus,

ρ+dx4x3g2xg3=216m216m+13g24Km for m<1. (45)

3. Approximate Analytical Solution Using Elementary Functions

We define the generalized sine and cosine functions as follows:

sinmt=sin1+κt1+κ  cos21+κt, (46)
cosmt=1+κcos1+κt1+κ  cos21+κt, (47)
κ=114m12+144144m+m2. (48)

These functions are good approximations to the Jacobian elliptic functions sn and cn for −1 ≤ m ≤ 1/2. For example, let

T=2Kmπ1+κ. (49)

Then,

MaxTtT,1m1/2snt,m  sinmt=0.00290582, (50)
MaxTtT,1m1/2cnt,m  cosmt=0.00541969. (51)

Table 1 provides the errors for different values of m.

Table 1.

Errors for approximations (46) and (47).

m MaxTtT|sn(t, m) − sinm(t)| MaxTtT|cn(t, m) − cosm(t)|
0 0 0
0.05 0.0000186142 0.0000332484
0.1 0.0000775641 0.000139051
0.15 0.000182102 0.000327722
0.2 0.000338416 0.000611534
0.25 0.000553861 0.00100522
0.3 0.000837256 0.00152665
0.35 0.0011993 0.00219775
0.4 0.00165312 0.00304575
0.45 0.00221506 0.00410502
0.5 0.00290582 0.00541969
0.55 0.00375209 0.00704758
0.6 0.00478916 0.0.0090664
0.66 0.00606499 0.0115838
0.7 0.00764718 0.0147546
0.75 0.00963546 0.0188129
0.8 0.0121865 0.0241364
0.85 0.055962 0.0313949
0.9 0.0203137 0.0419635
0.95 0.0277681 0.0595356

More accurate approximations are obtained by letting

sinmt=sin1+κt1+κ  cos21+κt+μ  cos41+κt, (52)
cosmt=1+κ+μcos1+κt1+κ  cos21+κt+μ  cos41+κt, (53)
sinmt=sintκμ1/μ11μ  cos2tκμ1/μ1μ  cos4tκμ1/μ1+κ  cos2tκμ1/μ1+1. (54)
κ=5184m214256m+15633μ4+24192m2+92016m89856μ3+42048m2211392m+193536μ2+32256m2+207360m184320μ+9216m273728m+65536+72m9μ2+168m960μ96m256483μ+10 (55)
μ=4m21061m47768m3+24128m232768m+1638410521m6136752m5+786336m42345984m3+3792896m23145728m+1048576. (56)

For these new approximations, we will have

MaxTtT,1m0.9snt,m  sinmt=0.0607706, (57)
MaxTtT,1m0.9cnt,m  cosmt=0.030797. (58)

Table 2 provides the errors for different values of m.

Table 2.

Errors for approximations (52) and (53).

m MaxTtT|sn(t, m) − sinm(t)| MaxTtT|cn(t, m) − cosm(t)|
0 0 0
0.05 8.066e-9 6.548e-9
0.1 1.4551e-7 1.158e-7
0.15 8035e-7 6.51e-7
0.2 3.0125e-6 2.23e-6
0.25 8.45e-6 6.29e-6
0.3 0.00002 0.000015
0.35 0.00004 0.000031
0.4 0.000089 0.000061
0.45 0.00017 0.00011
0.5 0.00032 0.00021
0.55 0.00058 0.00037
0.6 0.0011 0.00065
0.65 0.0019 0.0012
0.7 0.0036 0.0021
0.75 0.0071 0.0039
0.8 0.0146 0.0079
0.85 0.0327 0.0173
0.9 0.0832 0.043
0.95 0.265 0.136

From Tables 1 and 2, it is seen that for the values 0.8 < m < 1, the approximations (46) and (47) are better than (53) and (54). Thus, we have

snt,m  sinmt,cnt,m  cosmt and dnt,m1msn2t,m=dnmt for 1m<1. (59)

We may write approximate elementary solution to Duffing equations (3) and (4) as follows:

xt=x0cosmΔt4+x˙0/Δ4sinmΔt4dnmΔt41+p+qx02/2Δ1/2sinmΔt42, (60)

where

m=121pΔ,p>0,Δ=p+qx022+2qx˙02>0. (61)
xt=A2A1+Bb0cosmωt+b1sinmωtdnmωt/1+b2sinmωt2,Δ<0. (62)

The values for the constants in (62) are the same as in (??).

Remark 4 . —

In the case when |m| > 1, we use the approximations:

cnt,mdn1/mmt, (63)
snt,m1msin1/mmt, (64)
dnt,m  cos1/mmt. (65)

Then, formula (60) takes the following form when p < 0 and m > 1:

xt=x0dn1/mΔ4mt+x˙0/Δ41/msin1/mmΔt4cos1/mΔ4mt1+1/mp+qx02/2Δ1/2sin1/m2Δ4mt, Δ>0. (66)

Similar formula for (62) when Δ < 0.

In the case when 0.9 < m ≤ 1.1, we may use the following approximations:

cnt,m18m1sinh2t2ttanhtsec  ht+sec  ht,sn14m1t  sec  h2tm5tanht,dn    sec  ht14m1tanhtsinht+t  sec  ht. (67)

Example 3 . —

Let us return to Example 1.

xt+xt+x3t=0,x0=1&x0=1. (68)

The approximate elementary analytical solution is

xappt=3.4319  cos1.43552t/14.2.22208  cos21.43552t0.638943  sin1.43552t1+4.14226  sin21.43552t/2.22208  cos21.43552t14./1.0.15872  cos21.43552t10.0917517  sin21.43552t/1.0.15872  cos21.43552t. (69)

The exact period is given by T=4.37417. The approximate period is that of (59), and it is given by

Tapp=2π1.4355163606=4.37695. (70)

This value differs from the exact value by 0.00278457. The error of the approximate solution comparted with exact solution is

maxT/2tT/2xapptxexactt=0.001847. (71)

Comparison between the exact solution and the approximate analytical solution is shown in Figure 3.

Figure 3.

Figure 3

Comparison between the exact solution and the approximate analytical solution for Example 3.

Example 4 . —

Let us return to Example 2. Let (Figure 4)

xt+2xtx3t=0,x0=1 and x0=1. (72)

Figure 4.

Figure 4

Comparison between the exact solution and the approximate analytical solution for Example 4.

Remark 5 . —

From (47)–(44) or (53)–(44), we obtain the following approximate expression for the Weierstrass elliptic function by means of the cosine function:

t;g2,g3=3g216m216m+11  cosm23g2/16m216m+14tg24m+1248m248m+3, (73)

where m is a root to the sextic (44).

Example 5 . —

Let g2=2 and g3=1. For this choice, m=0.0119056. We have

t;2,12.7186713.73048  cos2.32484t/14.0.0835474  cos22.32484t0.474691. (74)

The period is T=2.70262, and the error on the interval −(T/2) ≤ t ≤ (T/2) in the sup norm is E=8.52 × 10−7. Comparison between the approximate analytical solution and the numerical solution is shown in Figure 5. The reciprocals of the two functions are plotted on the interval −(T/2) ≤ t ≤ (T/2).

Figure 5.

Figure 5

Comparison between the approximate analytical solution and the numerical solution for Example 5.

4. Analytical Solution to a Generalized Duffing Equation

Let us consider the i.v.p. [21]:

u¨+αu+βu3=F, (75)

given that

u0=u0 and u0=u˙0. (76)

We will say that (75) is a constantly forced Duffing equation. When F=0, that becomes an undamped and unforced Duffing equation, and we already know how to solve it for arbitrary initial conditions. Let

xt=λ+μ1+ρt+t0;g2,g3, (77)

where λ, μ, w, g2, g3, and t0 are some constants to be determined. Plugging ansatz (77) into (75) gives

u¨+αu+βu3F=121+32Fαλβλ32μρ223F3αλαμ3βλ33βλ2  μ+6μρ2+6F3g2μρ2+6αλ+4αμ+6βλ3+12βλ2μ+6βλμ22+2F+g2μρ24g3μρ2+2αλ+2αμ+2βλ3+6βλ2μ+6βλμ2+2βμ33, (78)

where =(ρt+t0; g2, g3). Equating to zero, the coefficients of j (j=0,1,2,3) in the right-hand side of (78) gives an algebraic system. A nontrivial solution to this system is

μ=6Fλα+βλ2α+3βλ2,ρ=12α3+βλ2,g2=12144βλF+αλ+βλ3α+3βλ22,g3=827F2β+9αβλβλ34F+α3+18α2βλ2α+3βλ23. (79)

Now, to find the values of t0 and λ, we make use of the addition formula:

w+z;g2,g3=14w;g2,g3z;g2,g3w;g2,g3z;g2,g32w;g2,g3z;g2,g3. (80)

We then find that

t0=1u0λμλu0;g2,g3. (81)

The number λ must be a solution to the quartic

4Fu0βu042u02α2u˙024Fλ+2αλ2+βλ4=0. (82)

Using (75), we also may obtain an approximate analytical solution in terms of the cosine function.

Remark 6 . —

The i.v.p.

x¨+n+px+qx2+rx3=0, x=xt, (83)

given the initial conditions

x0=x0 and x0=x˙0, (84)

is a particular case of (75) and (76). Indeed, let x(t)=u(t) − (q/3r). Then, problems (83) and (84) reduce to the problem

n+utpq23rpq3r+2q327r2+rut3+ut=0, (85)
u0=x0+q3r and u0=x˙0. (86)

Example 6 . —

Let

u¨+ut+u3t=1u0=1u0=1. (87)

The exact solution is

uexactt=0.296372.457921+0.3701920.709561t;0.657491,1.34218, (88)

with period

Texact=4.24726758. (89)

An approximate analytical solution is

uappt=1.296372.457920.474364+2.28411/13.64963  cos0.7717641.47927t/14.0.68022  cos20.7717641.47927t, (90)

with period

Tapp=4.24748881. (91)

The error is

maxT/2tT/2uexacttuappt=0.000105178. (92)

Comparison between the approximate analytical solution and the numerical solution is shown in Figure 6.

Figure 6.

Figure 6

Comparison between the approximate analytical solution and the numerical solution for Example 6.

5. Damped and Unforced Duffing Equation

Let us consider the i.v.p.

u¨+2εu˙+αu+βu3=0,ε>0, (93)

given that

u0=u0 and u0=u˙0. (94)

We will suppose that limtu(t)=0. Define the residual as

Rt=ut+2εut+put+qu3t. (95)

5.1. First Case: u0 ≠ 0

Assume the ansatz

ut=expρtu0cnft,mt+b1snft,mtdnft,mt1+b2sn2ft,mt. (96)

Then, from results in [22],

ft2=α2ερ+ρ2+βu02e2tρ and mt=βu02e2tρ2ft2, (97)

so that

ft=1ρβu02+μβu02e2tρ+μ+μtanh11+βu02e2tρμtanh11+βu02μ, (98)
mt=1/21+μe2tρ/βu02, (99)

being

μ=α2ερ+ρ2. (100)

The numbers b1, b2, and ρ are obtained from the following conditions:

u0=u˙0,R0=0,R0=0. (101)

Solving the two equations in (88) gives

b1=u0ρ+u˙0u02β+μ.b2=u03β3α4ερ3μ+u˙0u02β2ε3ρ+2ερα+ρρ2ε+2u0ρερα+ρρ2ε2u0u02β+μ2. (102)

The number ρ is a root to the septic

2εu02β+α2u02α+u04β+2u˙0u0ε+3u˙02+u02β+α2u02α2+5u04αβ+8u02αε24u˙0u0αε+6u˙02α+3u06β2+8u04βε2+2u˙0u03βε+9u˙02u02β+16u˙0u0ε3+24u˙02ε2z28u02α2ε4u˙0u0α2+15u04αβε9u˙0u03αβ+4u02αε34u˙0u0αε2+18u˙02αε+7u06β2ε3u˙0u05β2+4u04βε3+2u˙0u03βε2+21u˙02u02βε+8u˙0u0ε4+12u˙02ε3z2+8u02α2+17u04αβ+32u02αε240u˙0u0αε+12u˙02α+5u06β2+24u04βε238u˙0u03βε+15u˙02u02β+48u˙02ε2z3217u02αε8u˙0u0α+15u04βε9u˙0u03β+8u02ε322u˙0u0ε2+15u˙02εz4+25u02α+5u04β+16u02ε218u˙0u0ε+3u˙02z54u05u0ε2u˙0z6+4u02z7=0. (103)

R′(0)=0. To avoid solving this, the seventh-degree equation, we may set the default value ρ=ε. Taking this value for ρ, we get the following simplified expressions:

b1=u0ε+u˙0u02β+αε2,b2=u0βεu0ε+u˙02u02β+αε22. (104)

Remark 7 . —

In the integrable case, we have ρ=2ε/3 and then α=8/9ε2 From (99) and (100), μ=0 and m=1/2. Thus, our approach covers the only integrable case for the damped Duffing equation.

Example 7 . —

Let

u¨+0.4u˙+u+u3=0,u0=14 and u0=15. (105)

The error of the approximate analytical solution compared with numerical solution is

max0t20uapptuRuingeKuttat=0.00141579. (106)

Comparison between the approximate analytical solution and the numerical solution is shown in Figure 7.

Figure 7.

Figure 7

Comparison between the approximate analytical solution and the numerical solution for Example 7.

Example 8 . —

Let

u¨+0.02u˙+uu3=0,u0=0.1 and u0=0. (107)

The error of the approximate analytical solution compared with numerical solution is

max0t150uapptuRuingeKuttat=0.00135922. (108)

Comparison between the approximate analytical solution and the numerical solution is shown in Figure 8.

Figure 8.

Figure 8

Comparison between the approximate analytical solution and the numerical solution for Example 8.

Remark 8 . —

Let ρ=ε. An approximate analytical solution to the i.v.p.

u¨+2εu˙+αu+βu3=0,u0=u0  and u0=0, (109)

is given by

ut=u01u02βε2/2u02β+αε22snft|mt2cnft|mt+εu02β+αε2dnft|mtsnft|mtetε, (110)

where f(t) and m(t) are given by (98) and (99).

5.2. Second Case: u0=0

Let

u¨+2εu˙+αu+βu3=0,u0=0 and u0=u˙0. (111)

Assuming the ansatz [22],

ut=λ1m0texpρts  df0t,m0t, (112)

we will have

f0t2=12βλ2e2tρ+κ, (113)
m0t=βλ22f0t2e2tρ. (114)

Then,

ft=12ρ4κ+2βλ24κ+2βλ2e2tρ+2κtanh11+qλ22κe2tρ2κtanh11+qλ22κ, (115)
mt=11+2κ/βλ2e2tρ, κ=p2ρε+ρ2. (116)

The number λ is found form the initial condition u0=u˙0, and its value reads

λ=4x˙02β+α2ερ+ρ22α+2ερρ2/β2. (117)

The number ρ is a solution to some decic equation. Default value is ρ=ε.

Example 9 . —

Let

u¨+0.1u˙+u+u3=0,u0=0 and u0=0.1. (118)

The error of the approximate analytical solution compared with numerical solution is

max0t150uapptuRuingeKuttat=0.000303296. (119)

Comparison between the approximate analytical solution and the numerical solution is shown in Figure 9.

Figure 9.

Figure 9

Comparison between the approximate analytical solution and the numerical solution for Example 9.

6. Damped and Forced Duffing Equation

Let us consider the Duffing equation as originally was introduced by Georg Duffing:

x¨+rx˙+ω02x+βx3=F  cos  ωt, (120)

given the initial conditions

x0=x0 and x0=x˙0. (121)

Let

xt=ut+c1cos  ωt+c2sin  ωt. (122)

We will suppose that the function u=u(t) is a solution to the Duffing equation

u¨+ru˙+αu+βu3=0,u0=x0c1 and u0=x˙0c2ω, (123)

where

α=123c12β+3c22β+2ω02. (124)

The numbers c1 and c2 are chosen, so that

432F2β3c13+1152Fr2β2ω2c12192β3F2βω23F2βω024r4ω44r2ω6+8r2ω02ω44r2ω04ω2c1192Fβ3F2β4r2ω4+4r2ω02ω2=0 (125)
432F2β3c231152c22Frβ2ωω2ω02c22+768r2βω2r2ω2+ω42ω02ω2+ω04c2768Fr3βω3=0. (126)

Example 10 . —

Let

x¨+0.1x˙+x+x3=0.1  cos  0.4  t,x0=0 and x0=0. (127)

The error of the approximate analytical solution compared with numerical solution is

max0t150xapptxRuingeKuttat=0.00287382. (128)

The approximate solution is

xt=e0.05t0.117339cn0.00791022dnsn1+1.411×107sn2+0.00551957  sin0.4t+0.117339  cos0.4t, (129)

where

cn=cnft,mt,sn=snft,mt,dn=dnft,mt,ft=20.13431.0182+0.0137685e0.0993331t5.07916  log10.9910231.0182+0.0137685e0.0993331t2+10.1583  log0.9910231.0182+0.0137685e0.0993331t+137.4127,mt=1147.903e0.0993331t+2. (130)

Comparison between the approximate analytical solution and the numerical solution is shown in Figure 10.

Finally, let us compare the accuracy of the obtained results in comparation with the homotopy perturbation method (HPM). This method gives the approximate solution:

xHPMt=e1/2tr+κ2κ2r2ω2+ω2ω022, (131)
Fr2ω2ω02etκ+1rκω2+ω02etκ1+4ω02ω02ω2etκ+1+2Fκ2e12tr+κrω  sintω+ω02ω2costω+r2ω2+ω2ω022x0rr+κetκ+rκ4ω02etκ+1+2x˙0κetκ1, (132)
κ=r24ω02. (133)

The error of this approximation compared with numerical solution is

Max0t150xHPMtxRuingeKuttat=0.0136613. (134)

Comparison between the approximate analytical solution and the homotopy solution is shown in Figure 11.

Figure 10.

Figure 10

Comparison between the approximate analytical solution and the numerical solution for Example 10.

Figure 11.

Figure 11

Comparison between the approximate analytical solution and the homotopy solution for Example 10.

7. Analysis and Discussion

We have solved the undamped and constantly forced Duffing equation exactly. Trigonometric approximant was also provided. For the damped or forced case, we derived approximate analytical solution. As far as we know, the Duffing equation (1) has not been solved using the tools we employed in this work. For the damped unforced case, author in [8] obtained approximate analytical solution using generalized Jacobian elliptic functions. More exactly, author considered the following equation:

x¨+2βx˙+αxεx3=0, x0=x0  and x0=x˙0. (135)

The obtained solution in [8] has the form

xt=c0expβtsnωt+c1,mt, (136)

where

ωt=12β22α2β2c02ε2α2β2c02εe2βt+2c0εβ2α12αβ2/c02εcsch1c0ε/2β22α2α2β2c02ε+eβt2α2β2c02εe2βtcsch1c0εeβt/2β22αc02ε2β2αe2βt/c02ε+1, (137)
mt=c02εc02ε+2β2αe2βt. (138)

The constants c0 and c1 are determined from the initial conditions as follows:

c1=sn1x0/c0,m0, (139)
c0=±αεβ2ε±α22αβ2+β42αεx024βεx0x˙0+ε2x042εx˙02ε. (140)

This approach is different from the method we used in this work. Let us compare the solution (136) with the solution we obtained in Example 8:

u¨+0.02u˙+uu3=0,u0=0.1 and u0=0 for 0t150. (141)

Using formula gives the approximate analytical solution

xt=0.100005e0.01tsn50.21.417671.9998+0.010001e0.02t0.233.432999.9901e0.01t1.9998+0.010001e0.02tcsc  h10.0707177e0.01t1+199.96e0.02t+1.55892,0.0100010.0100011.9998e0.02t. (142)

The error of this solution compared with the Runge–Kutta numerical method equals 0.00142148. The error obtained in our method equals 0.00135922. We may try a simpler ansatz in the form

xt=c0expρtsinwt, (143)

with

wt=4α+4ρρ2β3c02ε+4α+4ρρ2β3c02εe2ρt+4α+4ρρ2β3c02ε+4α+4ρρ2β3c02εe2ρt+2α+ρρ2βcoth12α+ρρ2β/4α+4ρρ2β3c02εcoth12α+ρρ2β/4α+4ρρ2β3c02εe2ρt2ρ. (144)

The numbers c0 and ρ are determined from the system

8αβ+8αρ+16β2ρ24βρ2+6βc02ε9c02ερ+8ρ3=0,4αc02+8βc02ρ+3βc04ε4c02ρ23c02εx02+4αx02+8βρx02+8ρ2x02+8ρx0x˙o+4x˙02=0. (145)

Using this ansatz, we obtain the approximate analytical solution:

xtrigot=0.100005e0.00996291tsin1.56087+50.18613.9996+0.030003e0.0199258t+1.9999coth11.99993.9996+0.030003e0.0199258t+3.141341.5708i2.00739 (146)

The error of the trigonometric solution (146) compared with the numerical solution using the Runge–Kutta method equals 0.00195254, so that the trigonometric solution is good as well.

8. Conclusions and Future Work

The methods employed here may be useful to study other nonlinear oscillators of the form

x¨+2δx˙+fx=F  cos  ωt,x0=x0 and x0=x˙0, (147)

where the function f is odd: f(−x)=−f(x). To this end, we approximate this function on some interval [−A, A] by means of Chebyshev polynomials in the form

fxpx+qx3. (148)

Then, the i.v.p. is replaced with the i.v.p.

x¨+2δx˙+px+qx3=F  cos  ωt,x0=x0 and x0=x˙0. (149)

On the other hand, we may study the following cubic quintic Duffing oscillator:

x¨+2δx˙+px+qx3+rx5=F  cos  ωt,x0=x0 and x0=x˙0. (150)

For the unforced and damped cases, we may try the ansatz

xt=c0expρtsinft+arccosx0c0, (151)

where

ft=1220t8p16δρ+8ρ2+6c02e2τρq+5c04e4τρrdτ, (152)

and

8px022δρx02+2ρ2x02+2ρx˙0x0+x˙0228δρ+4p+4ρ23qx02c02+5rx026qc045rc06=0. (153)

The number ρ is a free parameter that is chosen in order to minimize the residual error

Data Availability

No data were used to support this study.

Conflicts of Interest

The authors declare that they have no conflicts of interest.

References

  • 1.Duffing G. Erzwungene Schwingung bei veränderlicher Eigenfrequenz und ihre technische Bedeutung . Braunschweig, Germany: Vieweg; 1918. [Google Scholar]
  • 2.Feng Z. A qualitative study of the damped duffing equation andApplications. Discrete and continuous dynamical systems-series B. Follow journal . 5(5) doi: 10.3934/dcdsb.2006.6.1097. [DOI] [Google Scholar]
  • 3.Loria A., Panteley E., Nijmeijer H. Control of the chaotic Duffing equation withuncertainty in all parameters. IEEE Transactions on Circuits and Systems I . 1998;45(12):1252–1255. doi: 10.1109/81.736558. [DOI] [Google Scholar]
  • 4.Thompson J. M. T., Stewart H. B. Nonlinear Dynamics and Chaos . New York, NY, USA: John Wiley & Sons; 1986. [Google Scholar]
  • 5.Moon F. C. Chaotic Vibrations: An Introduction for Applied Scientists and Engineers . New York, NY, USA: John Wiley & Sons; 1987. [Google Scholar]
  • 6.Dowell E. H., Pezeshki C. On the understanding of chaos in Duffing’s equation in-cluding a comparison with experiment. Journal of Applied Mechanics . 1986;53(1):5–9. doi: 10.1115/1.3171739. [DOI] [Google Scholar]
  • 7.Battelli F., Palmer K. J. Chaos in the duffing equation. Journal of Differential Equations . 1993;101(2):276–301. doi: 10.1006/jdeq.1993.1013. [DOI] [Google Scholar]
  • 8.Johannesen K. The duffing oscillator equation and its applications in physics. European Journal of Physics . 2015;36065020 [Google Scholar]
  • 9.Johannesen K. International Journal of Applied and Computational Mathematics . 2017;3:p. 3805. [Google Scholar]
  • 10.He Ji-H., Yusry O., El-Dib A tutorial introduction to the two-scale fractal calculus and its application to the fractal zhiber-shabat oscillator. Fractals . 2021;29 doi: 10.1142/S0218348X21502686. [DOI] [Google Scholar]
  • 11.He J. H., Nurakhmetov D., Skrzypacz P., Wei D. M. Dynamic pull-in for micro-electromechanical device with a current-carrying conductor. Journal of Low Frequency Noise, Vibration and Active Control . 2021;40(2):1059–1066. doi: 10.1177/1461348419847298. [DOI] [Google Scholar]
  • 12.He J.-H., Amer T. S., Elnaggar S., Galal A. A. Periodic property and instability of a rotating pendulum system. Axioms . 2021;10(3):p. 191. doi: 10.3390/axioms10030191. [DOI] [Google Scholar]
  • 13.He J.-H., Yang Q., He C.-H., Khan Y. A simple frequency formulation for the tangent oscillator. Axioms . 2021;10(4):p. 320. doi: 10.3390/axioms10040320. [DOI] [Google Scholar]
  • 14.Tian D., Ain Q. T., Anjum N., He C. H., Cheng B. Fractal N/MEMS: from pull-in instability to pull-in stability. Fractals . 2021;29(2) doi: 10.1142/s0218348x21500304.2150030 [DOI] [Google Scholar]
  • 15.Tian D., He C. H. A fractal micro-electromechanical system and its pull-in stability. Journal of Low Frequency Noise, Vibration and Active Control . 2021;40(3):1380–1386. doi: 10.1177/1461348420984041. [DOI] [Google Scholar]
  • 16.He C. H., Tian D., Moatimid G. M., Salman H. F., Zekry M. H. Hybrid Rayleigh–van der pol–duffing oscillator: stability analysis and controller. Journal of Low Frequency Noise, Vibration and Active Control . 2021;41(1):244–268. doi: 10.1177/14613484211026407. [DOI] [Google Scholar]
  • 17.He C.-H., El-Dib Y. O. A heuristic review on the homotopy perturbation method for non-conservative oscillators. Journal of Low Frequency Noise, Vibration and Active Control . 2021 doi: 10.1177/14613484211059264.146134842110592 [DOI] [Google Scholar]
  • 18.NaumanAhmed. Structure preserving numerical analysis of hiv and cd4+t-cells reaction diffusion model in two space dimensions, chaos. Solitons & Fractals . 2020;139 [Google Scholar]
  • 19.Malik M. R. Design and stability analysis of a nonlinear SEIQR infectious model and its efficient non-local computational implementation. Applied Mathematical Modelling . 2021;89(2):1835–1846. doi: 10.1016/j.apm.2020.08.082. [DOI] [PMC free article] [PubMed] [Google Scholar]
  • 20.Salas A. H. The duffing oscillator equation and its applications in physics. Mathematical Problems in Engineering . 2021;2021:13. doi: 10.1155/2021/9994967. https://www.hindawi.com/journals/mpe/2021/9994967/ 9994967 [DOI] [Google Scholar]
  • 21.Salas A. H. Analytic solution to the generalized complex Duffing equation and its application in soliton theory. Applicable Analysis . 100 doi: 10.1080/00036811.2019.1698729. [DOI] [Google Scholar]
  • 22.Salas A. H., El-Tantawy S. A. On the approximate solutions to a damped harmonic oscillator with higher-order nonlinearities and its application to plasma physics: semi-analytical solution and moving boundary method. European Physical Journal . 2020;135(10):833–917. doi: 10.1140/epjp/s13360-020-00829-3. [DOI] [Google Scholar]

Associated Data

This section collects any data citations, data availability statements, or supplementary materials included in this article.

Data Availability Statement

No data were used to support this study.


Articles from The Scientific World Journal are provided here courtesy of Wiley

RESOURCES