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:
(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
(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 [3–5].
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, 5–7]. 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) [10–17], 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:
(3) |
and given the initial conditions,
(4) |
The general solution to equation (3) may be written in terms of any of the twelve Jacobian elliptic functions [20]. Let, for example,
(5) |
Then,
(6) |
Equating to zero, the coefficients of cnj to zero gives an algebraic system whose solution is
(7) |
Thus, the general solution to the Duffing equation is
(8) |
The values for the constants c1 and c2 are determined from the initial conditions.
Definition 1 . —
The number 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
(9) |
Making use of the addition formula,
(10) |
The solution (9) may be expressed as
(11) |
where
(12) |
Solution (11) is a periodic solution with period
(13) |
Example 1 . —
Let us consider the i.v.p.
(14) Using formula (9), the exact solution to (14) is given by
(15) According to the relations (11) and (12), the exact solution to the i.v.p. (14) may also be written as
(16) The period is given by
(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.
Comparison between the exact solution and the numerical solution for Example 1.
2.2. Second Case: Δ < 0
In this case, q < 0. Define
(18) |
Observe that
(19) |
Let
(20) |
where y=y(t) is a solution to Duffing equation
(21) |
with initial conditions
(22) |
Inserting ansatz (21) into the ode x′′(t)+px(t)+qx3(t)=0 and taking into account the relation,
(23) |
we get
(24) |
Equating to zero, the coefficients of yj(t) give an algebraic system. A solution to this system is
(25) |
Observe that the Duffing equations (21) and (22) have a positive discriminant given by
(26) |
Then, the problem reduces to the first case.
Example 2 . —
Let us assume the following i.v.p.:
(27) The solution of i.v.p. (27) according to the relation (??) reads
(28) The period of solution (28) is given by
(29) Comparison between the exact solution and numerical solution is shown in 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
(30) |
reads
(31) |
which may be verified by direct computation.
2.4. Fourth Case: Δ=0 and p=0
The solution is given by
(32) |
Remark 1 . —
The solution to the i.v.p.
(33) is
(34)
Remark 2 . —
Let . Then, the solution to the i.v.p.
(35) is
(36)
Remark 3 . —
Using the identity
(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
(38) where
(39)
(40) The solution (38) is periodic with period
(41) where ρ is the greatest real root to the cubic 4x3 − g2x − g3=0 and
(42) On the other hand,
(43) where m is a root to the sextic
(44) Thus,
(45)
3. Approximate Analytical Solution Using Elementary Functions
We define the generalized sine and cosine functions as follows:
(46) |
(47) |
(48) |
These functions are good approximations to the Jacobian elliptic functions sn and cn for −1 ≤ m ≤ 1/2. For example, let
(49) |
Then,
(50) |
(51) |
Table 1 provides the errors for different values of m.
Table 1.
m | Max−T≤t≤T|sn(t, m) − sinm(t)| | Max−T≤t≤T|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
(52) |
(53) |
(54) |
(55) |
(56) |
For these new approximations, we will have
(57) |
(58) |
Table 2 provides the errors for different values of m.
Table 2.
m | Max−T≤t≤T|sn(t, m) − sinm(t)| | Max−T≤t≤T|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
(59) |
We may write approximate elementary solution to Duffing equations (3) and (4) as follows:
(60) |
where
(61) |
(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:
(63)
(64)
(65) Then, formula (60) takes the following form when p < 0 and m > 1:
(66) Similar formula for (62) when Δ < 0.
In the case when 0.9 < m ≤ 1.1, we may use the following approximations:
(67)
Example 3 . —
Let us return to Example 1.
(68) The approximate elementary analytical solution is
(69) The exact period is given by T=4.37417. The approximate period is that of (59), and it is given by
(70) This value differs from the exact value by 0.00278457. The error of the approximate solution comparted with exact solution is
(71) Comparison between the exact solution and the approximate analytical solution is shown in 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)
(72)
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:
(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
(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.
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]:
(75) |
given that
(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
(77) |
where λ, μ, w, g2, g3, and t0 are some constants to be determined. Plugging ansatz (77) into (75) gives
(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
(79) |
Now, to find the values of t0 and λ, we make use of the addition formula:
(80) |
We then find that
(81) |
The number λ must be a solution to the quartic
(82) |
Using (75), we also may obtain an approximate analytical solution in terms of the cosine function.
Remark 6 . —
The i.v.p.
(83) given the initial conditions
(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
(85)
(86)
Example 6 . —
Let
(87) The exact solution is
(88) with period
(89) An approximate analytical solution is
(90) with period
(91) The error is
(92) Comparison between the approximate analytical solution and the numerical solution is shown in 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.
(93) |
given that
(94) |
We will suppose that limt⟶∞u(t)=0. Define the residual as
(95) |
5.1. First Case: u0 ≠ 0
Assume the ansatz
(96) |
Then, from results in [22],
(97) |
so that
(98) |
(99) |
being
(100) |
The numbers b1, b2, and ρ are obtained from the following conditions:
(101) |
Solving the two equations in (88) gives
(102) |
The number ρ is a root to the septic
(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:
(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
(105) The error of the approximate analytical solution compared with numerical solution is
(106) Comparison between the approximate analytical solution and the numerical solution is shown in Figure 7.
Figure 7.
Comparison between the approximate analytical solution and the numerical solution for Example 7.
Example 8 . —
Let
(107) The error of the approximate analytical solution compared with numerical solution is
(108) Comparison between the approximate analytical solution and the numerical solution is shown in 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.
(109) is given by
(110)
5.2. Second Case: u0=0
Let
(111) |
Assuming the ansatz [22],
(112) |
we will have
(113) |
(114) |
Then,
(115) |
(116) |
The number λ is found form the initial condition , and its value reads
(117) |
The number ρ is a solution to some decic equation. Default value is ρ=ε.
Example 9 . —
Let
(118) The error of the approximate analytical solution compared with numerical solution is
(119) Comparison between the approximate analytical solution and the numerical solution is shown in 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:
(120) |
given the initial conditions
(121) |
Let
(122) |
We will suppose that the function u=u(t) is a solution to the Duffing equation
(123) |
where
(124) |
The numbers c1 and c2 are chosen, so that
(125) |
(126) |
Example 10 . —
Let
(127) The error of the approximate analytical solution compared with numerical solution is
(128) The approximate solution is
(129) where
(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:
(131)
(132)
(133) The error of this approximation compared with numerical solution is
(134) Comparison between the approximate analytical solution and the homotopy solution is shown in Figure 11.
Figure 10.
Comparison between the approximate analytical solution and the numerical solution for Example 10.
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:
(135) |
The obtained solution in [8] has the form
(136) |
where
(137) |
(138) |
The constants c0 and c1 are determined from the initial conditions as follows:
(139) |
(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:
(141) |
Using formula gives the approximate analytical solution
(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
(143) |
with
(144) |
The numbers c0 and ρ are determined from the system
(145) |
Using this ansatz, we obtain the approximate analytical solution:
(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
(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
(148) |
Then, the i.v.p. is replaced with the i.v.p.
(149) |
On the other hand, we may study the following cubic quintic Duffing oscillator:
(150) |
For the unforced and damped cases, we may try the ansatz
(151) |
where
(152) |
and
(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.