# A New Algorithm for Solving Terminal Value Problems ofq-Difference Equations

Authors: Yong-Hong Fan; Lin-Lin Wang
Journal: Discrete Dynamics in Nature and Society
 (2018)

---

## Abstract

We propose a new algorithm for solving the terminal value problems on aq-difference equations. Through some transformations, the terminal value problems which contain the first- and second-order delta-derivatives have been changed into the corresponding initial value problems; then with the help of the methods developed by Liu and H. Jafari, the numerical solution has been obtained and the error estimate has also been considered for the terminal value problems. Some examples are given to illustrate the accuracy of the numerical methods we proposed. By comparing the exact solution with the numerical solution, we find that the convergence speed of this numerical method is very fast.


---

## Body

## 1. Introduction

Theq-difference equations theory appeared already at the beginning of the 20th century. Intensive works have been made especially by Jackson [1], Carmichael [2], Mason [3], Adams [4], Trjitzinsky [5], and others. But from the 1930s to the beginning of the 1980s, only nonsignificant interest in the area appeared.The numerical solution of theq-difference equations plays an important role in many fields of science and engineering, mainly in physical science, as their solutions can provide more insight into the physical aspects of the problem.Recently, many authors focus on the study ofq-difference equations, especially on the numerical solution problems, such as [6, 7]. In [6], by using the differential transformation method, the authors studied the following strongly nonlinear q-difference equation:(1)xΔΔ+2γ+εγ1xtxΔ+Ω2x+x2=0onqN0¯with x(0)=a,xΔ(0)=b. The parameters γ,γ1 represent the linear damping parameters, ε is the nonlinearity parameter, Ω is the frequency of underdamped motion, and 0<q<1. They established a numerical method and obtained the numerical results of (1). Later, Jafari et al. [7] proposed a numerical algorithm to obtain the numerical solutions for the first- and second-order dynamic equations on qN¯. As an application, they investigated the numerical solution of (1) and, through the error analysis, they proved the effectiveness of the numerical algorithm they proposed.From the works of [6] and [7], one can easily see that when q>1, the methods they proposed are no longer effective, since for the formula (2)yqN0=y0+qN0yΔ0+Oq2N0,when N0→∞,q2N0→∞, so we cannot estimate yqN0 by y0+qN0yΔ0. In this paper, we want to give a new numerical method to gain the numerical solution of the general first- and second-order dynamic equations on qN0 with q>1. We assume that q>1 always hold in the following unless otherwise is stated.


## 2. Preliminary

Forq-difference equation, the theory of time scales plays an important role, which was initiated by Hilger [8] in his Ph.D. thesis to unify both difference and differential calculus in a consistent way. Since then many authors have investigated the dynamic equations on time scales (see [9–11], etc.). This theory is a powerful tool for mathematical analysis in economics, population models, quantum physics, and so on.Before giving our main result, first we list some basic properties about time scales which could be found in ([8, 12, 13]).Definition 1.
A time scale is an arbitrary nonempty closed subsetT of the real number R.Definition 2.
Fort∈T we define the forward jump operator σ:T→T and the backward jump operator ρ:T→T by (3)σt≔inf⁡s∈T:s>t,ρt≔sup⁡s∈T:s<t,respectively.Definition 3.
LetT be a time scale, for t∈T; if σt>t, we say that t is right-scattered, while if ρt<t, we say that t is left-scattered. Also, if t<sup⁡T and σt=t, then t is called right-dense, and if t>inf⁡T and ρt=t, then t is called left-dense.Definition 4.
A functionf:T→R is called rd-continuous provided it is continuous at right-dense points in T and its left-sided limits exist (finite) at left-dense points in T. The set of rd-continuous functions f:T→R is denoted by (4)Crd=CrdT=CrdT,R.Definition 5.
Assume thatf:T→R and let t∈Tk, where (5)Tk=T\ρsup⁡T,sup⁡T,ifsup⁡T<∞,T,ifsup⁡T=∞.Then we define fΔt to be the number (provided it exists) with property that given any ε>0, there is a neighborhood U of t such that (6)fσt-fs-fΔtσt-s≤εσt-s,for all s∈U. We call fΔt the delta (or Hilger) derivative of ft and it turns out that fΔ is the usual derivative if T=R and is the usual forward difference operator if T=Z.Lemma 6.
The delta derivative offt on right-scattered point t can be calculated by (7)fΔt=fσt-ftσt-t.In the following, we give two lemmas which will be useful to prove our main result.Lemma 7.
Assume thatf:qN0→R is delta differentiable at t∈qN0. Let s=1/t and denote ps=ft; then p:q-N0→R is delta differentiable at s/q∈q-N0 and(8)pΔsq=-qt2fΔt.Proof.
By the definition of delta derivative offt and Lemma 6, we know that, for t∈qN0, (9)fΔt=fqt-ftq-1t,pΔsq=ps-ps/q1-1/qs;notice that (10)fqt=p1qt=psq;then (11)pΔsq=qt2ft-fqtq-1t=-qt2fΔt.Lemma 8.
Assume thatf:qN0→R is twice delta differentiable at t∈qN0. Let s=1/t and denote ps=ft; then p:q-N0→R is twice delta differentiable at s/q2∈q-N0 and(12)pΔΔsq2=q3t4fΔΔt+q3q+1t3fΔqt.Proof.
Since(13)fΔΔt=fΔqt-fΔtq-1t=-1/q3t2pΔ1/q2t+1/qt2pΔ1/qtq-1tand on the other hand(14)pΔΔsq2=pΔs/q-pΔs/q2s/q-s/q2=q2t2pΔs/q-pΔs/q2q-1t=q2t2pΔ1/qt-pΔ1/q2tq-1t,thus (15)fΔΔt=1qt2pΔ1/qt-pΔ1/q2tq-1t-1/qt2-1/q3t2q3t2fΔqtq-1t=1q3t4pΔΔsq2-q+1fΔqtt;that is, (12) holds true.


## 3. Numerical Method

In this section we present a numerical method to solve the terminal value problems involving the first- and second-orderq-difference equations.


### 3.1. The First-Order

Consider the following TVP onqN0 with q>1:(16)ft,xt,xΔt=0,(17)x∞=a.Here f∈CrdqN0×R1×R1,R1,x(∞)=a means that limn→∞xqn=0,xΔ(t) represents delta derivative; in fact, we can easily see that when q>1,xΔt=Dqxt=x(qt)-x(t)/q-1t, where Dqx(t) is the q-difference operator. For the concept of q-difference operator, one can see [14]. We assume that (16) with (17) has an unique solution.First, we give a necessary condition for the existence of (16) with (17).Lemma 9.
Ifx(t) is the solution of (16) and (17), then (18)f+∞,a,0=0.Especially, if f(t,x(t),xΔ(t))≡F(x(t),xΔ(t)), then (19)Fa,0=0.Now we present a numerical method to solve (16) and (17).Algorithm 10.
Step 1. Make the transformation s=1/t and let ys=xt; by (8), (16) with (17) is transformed into(20)f1s,ys,-s2qyΔsq=0,s∈q-N0y0=a.
Step 2. Motivated by the work of Liu [6], let y(0)=a,t1=0,ti=q-N0+i-1(i=2,…,N0+1) and si=qti; then (20) will be changed into (21)f1qti,yti+1,-qti2yΔti=0;
notice that(22)yΔti=yti+1-ytiq-1ti;
then(23)f1qti,yti+1,-qq-1tiyti+1-yti=0.
Step 3. From the above equality, set yt1=a and solve yti+1, where obviously yti+1 only depends on yti, q, and ti; thus we can obtain all the values of y at each point ti.Example 11.
Consider the followingq-difference equation (q>1):(24)xΔt=-xt+qt2+t+1t+1qt+1,x∞=1.
It is easy to see thatx(t)=t/t+1 is the solution of (24); we now use Algorithm 10 to obtain the numerical solution of (24).
Lets=1/t and ys=xt; by (23), (24) can be transformed into(25)-qq-1tiyti+1-yti=-yti+1+qti2+ti+1ti+1qti+1,y0=1.
Solving the above equations, we can obtain(26)yti+1=-q/q-1ti1-q/q-1tiyti+qti2+ti+1ti+1qti+11-q/q-1ti.
Lety(t1)=1; by recurrence formula (26), we can obtain all values of y(ti); we calculate it in Table 1 for q=3 and N0=10.Table 1
The comparison of exact value and approximate value.
(a) Time domain 0.000050805263425 0.000152415790276 0.000457247370828 Exact value 0.999949197317618 0.999847607436757 0.999542961608775 Approximate value 0.999949196887419 0.999847607436790 0.999542961608775 Error (≤) - 0.43 × 1 0 - 9 0.327 × 1 0 - 13 - 0.111 × 1 0 - 15 Absolute error (≤) 0.44 × 1 0 - 9 0.328 × 1 0 - 13 0.112 × 1 0 - 15  (b) 0.001371742112483 0.004115226337449 0.012345679012346 0.037037037037037 0.998630136986301 0.995901639344262 0.987804878048780 0.964285714285714 0.998630136986301 0.995901639344262 0.987804878048780 0.964285714285714 0 0 0 0 0 0 0 0  (c) 0.111111111111111 0.333333333333333 1.000000000000000 0.900000000000000 0.750000000000000 0.500000000000000 0.900000000000000 0.750000000000000 0.500000000000000 0 0 0 0 0 0From Table1, we can see that the maximum error is 0.44×10-9 and the average error is 0.44×10-10.Figure1 shows the comparison of exact value and approximate value of Example 11 when q=1.1 and N0=50.Figure 1
Forq=1.1,N0=50.


### 3.2. The Second-Order

Consider the following TVP onqN0 with q>1:(27)ft,xt,xΔt,xΔΔt=0,(28)limn→∞xqn=a,limn→∞q2nxΔqn=b.Here f∈CrdqN0×R3→R,xΔt represents delta derivative. Also we assume that (27) with (28) has only one solution.First, we give a necessary condition for the existence of solution for (27) with (28).Lemma 12.
Ifx(t) is the solution of (27) and (28), then (29)f+∞,a,0,0=0.Especially, if ft,xt,xΔt,xΔΔt≡Fxt,xΔt,xΔΔt, then (30)Fa,0,0=0.Lett=1/s,xt=ys; then by (8), we know that yΔ0=-qb. On the other hand, notice that limn→∞⁡q-n=0; then (31)yΔ0=limn→∞yq-n-y0q-n.Let N0 be a nature number; then using the Taylor formula on time scales, we have(32)yq-N0=y0+q-N0yΔ0+q-2N02yΔ20+⋯;thus (33)yq-N0≈y0+q-N0yΔ0=a-bq1-N0;set t1=0, t2=q-N0, and ti=q-N0+i-2, i=3,4,…,N0+2; let yi=yti; then (34)y1=a,y2=yq-N0≈a-bq1-N0.Note that the delta derivative of yt at ti can be calculated as(35)yΔti=yqti-ytiq-1ti=yi+1-yiq-1ti,(36)yΔΔti=yΔqti-yΔtiq-1ti=yi+2-yi+1/q-1ti+1-yi+1-yi/q-1tiq-1ti=Aiyi+2-Biyi+1+Ciyi,where(37)Ai=1q-12titi+1,Bi=ti+ti+1q-12ti2ti+1,Ci=1q-12ti2.In the following, we give a method to solve the numerical solution of (27) with (28).Algorithm 13.
Step 1. Make the transformation s=1/t and let ys=xt; by (8) and (12), (27) with (28) is transformed into(38)f1s,ys,-s2qyΔsq,s4q3yΔΔsq2+q+1s3q3yΔsq2=0,s∈q-N0y0=a,yΔ0=-qb.
Step 2. Let y0=a,yq-N0=a-bq1-N0; set t1=0,t2=q-N0,ti=q-N0+i-2(i=3,4,…,N0+2) and si=q2ti; then (38) will be changed into (39)f1q2ti,yti+2,-q3ti2yΔti+1,q5ti4yΔΔti+q3q+1ti3yΔti=0;notice that (40)yΔti+1=yti+2-yti+1q-1ti+1;then(41)f1q2ti,yi+2,-q2tiyi+2-yi+1q-1,q5ti4Aiyi+2-Biyi+1+Ciyi+q3q+1ti2yi+1-yi=0,y1=a,y2=a-bq1-N0.
Step 3. From (41), we can solve yi+2 step by step.Now we consider an example to illustrate the efficiency of the numerical method.Example 14.
Consider the following second-order terminal value problem onqN0q>1(42)xΔΔt+q+1q2txΔt+xt=1+1t,(43)limn→∞xqn=1,limn→∞q2nxqn=-1q.It is easy to see that x(t)=1/t+1 is the solution of (42) with the terminal value condition (43).
Lett=1/s,ys=xt; then (42) can be transformed into(44)s4q3yΔΔsq2+q+1s3q3yΔsq2-q+1s3q3yΔsq+ys=1+s,(45)y0=1,yΔ0=1.
Setsi=q2ti; by (41), we have(46)q5ti4Aiyi+2-Biyi+1+Ciyi+q+1q3ti3yi+1-yiti+1-ti-q+1q3ti3yi+2-yi+1ti+2-ti+1+yi+2=1+ti+2.
Therefore(47)Diyi+2+Eiyi+1+Fiyi=1+ti+2,where (48)Di=1-q+1q2ti2q-1+q5ti4Ai,Ei=-q5ti4Bi+q+12q2ti2q-1,Fi=-q+1q3ti2q-1+q5ti4Ci.Notice thaty1=1,y2=1+q-N0; then by recurrence formula (47), we can obtain all values of yi; we calculate it in Table 2.Table 2
The comparison of exact value and approximate value forq=2 and N0=10.
(a) Time domain 0.001953125 0.00390625 0.0078125 Exact value 1.001953125 1.00390625 1.0078125 Approximate value 1.001953127793965 1.003906249999968 1.007812500000085  (b) 0.015625 0.03125 0.0625 0.125 0.25 0.5 1 1.015625 1.03125 1.0625 1.125 1.25 1.5 2 1.015625 1.03125 1.0625 1.125 1.25 1.5 2From Table2, we can see that the maximum error is 1×10-8 and the average error is 1×10-9.Figure2 shows the comparison of exact value and approximate value of Example 14 when q=1.1 and N0=50.Figure 2
Forq=1.1,N0=50.


## 3.1. The First-Order

Consider the following TVP onqN0 with q>1:(16)ft,xt,xΔt=0,(17)x∞=a.Here f∈CrdqN0×R1×R1,R1,x(∞)=a means that limn→∞xqn=0,xΔ(t) represents delta derivative; in fact, we can easily see that when q>1,xΔt=Dqxt=x(qt)-x(t)/q-1t, where Dqx(t) is the q-difference operator. For the concept of q-difference operator, one can see [14]. We assume that (16) with (17) has an unique solution.First, we give a necessary condition for the existence of (16) with (17).Lemma 9.
Ifx(t) is the solution of (16) and (17), then (18)f+∞,a,0=0.Especially, if f(t,x(t),xΔ(t))≡F(x(t),xΔ(t)), then (19)Fa,0=0.Now we present a numerical method to solve (16) and (17).Algorithm 10.
Step 1. Make the transformation s=1/t and let ys=xt; by (8), (16) with (17) is transformed into(20)f1s,ys,-s2qyΔsq=0,s∈q-N0y0=a.
Step 2. Motivated by the work of Liu [6], let y(0)=a,t1=0,ti=q-N0+i-1(i=2,…,N0+1) and si=qti; then (20) will be changed into (21)f1qti,yti+1,-qti2yΔti=0;
notice that(22)yΔti=yti+1-ytiq-1ti;
then(23)f1qti,yti+1,-qq-1tiyti+1-yti=0.
Step 3. From the above equality, set yt1=a and solve yti+1, where obviously yti+1 only depends on yti, q, and ti; thus we can obtain all the values of y at each point ti.Example 11.
Consider the followingq-difference equation (q>1):(24)xΔt=-xt+qt2+t+1t+1qt+1,x∞=1.
It is easy to see thatx(t)=t/t+1 is the solution of (24); we now use Algorithm 10 to obtain the numerical solution of (24).
Lets=1/t and ys=xt; by (23), (24) can be transformed into(25)-qq-1tiyti+1-yti=-yti+1+qti2+ti+1ti+1qti+1,y0=1.
Solving the above equations, we can obtain(26)yti+1=-q/q-1ti1-q/q-1tiyti+qti2+ti+1ti+1qti+11-q/q-1ti.
Lety(t1)=1; by recurrence formula (26), we can obtain all values of y(ti); we calculate it in Table 1 for q=3 and N0=10.Table 1
The comparison of exact value and approximate value.
(a) Time domain 0.000050805263425 0.000152415790276 0.000457247370828 Exact value 0.999949197317618 0.999847607436757 0.999542961608775 Approximate value 0.999949196887419 0.999847607436790 0.999542961608775 Error (≤) - 0.43 × 1 0 - 9 0.327 × 1 0 - 13 - 0.111 × 1 0 - 15 Absolute error (≤) 0.44 × 1 0 - 9 0.328 × 1 0 - 13 0.112 × 1 0 - 15  (b) 0.001371742112483 0.004115226337449 0.012345679012346 0.037037037037037 0.998630136986301 0.995901639344262 0.987804878048780 0.964285714285714 0.998630136986301 0.995901639344262 0.987804878048780 0.964285714285714 0 0 0 0 0 0 0 0  (c) 0.111111111111111 0.333333333333333 1.000000000000000 0.900000000000000 0.750000000000000 0.500000000000000 0.900000000000000 0.750000000000000 0.500000000000000 0 0 0 0 0 0From Table1, we can see that the maximum error is 0.44×10-9 and the average error is 0.44×10-10.Figure1 shows the comparison of exact value and approximate value of Example 11 when q=1.1 and N0=50.Figure 1
Forq=1.1,N0=50.


## 3.2. The Second-Order

Consider the following TVP onqN0 with q>1:(27)ft,xt,xΔt,xΔΔt=0,(28)limn→∞xqn=a,limn→∞q2nxΔqn=b.Here f∈CrdqN0×R3→R,xΔt represents delta derivative. Also we assume that (27) with (28) has only one solution.First, we give a necessary condition for the existence of solution for (27) with (28).Lemma 12.
Ifx(t) is the solution of (27) and (28), then (29)f+∞,a,0,0=0.Especially, if ft,xt,xΔt,xΔΔt≡Fxt,xΔt,xΔΔt, then (30)Fa,0,0=0.Lett=1/s,xt=ys; then by (8), we know that yΔ0=-qb. On the other hand, notice that limn→∞⁡q-n=0; then (31)yΔ0=limn→∞yq-n-y0q-n.Let N0 be a nature number; then using the Taylor formula on time scales, we have(32)yq-N0=y0+q-N0yΔ0+q-2N02yΔ20+⋯;thus (33)yq-N0≈y0+q-N0yΔ0=a-bq1-N0;set t1=0, t2=q-N0, and ti=q-N0+i-2, i=3,4,…,N0+2; let yi=yti; then (34)y1=a,y2=yq-N0≈a-bq1-N0.Note that the delta derivative of yt at ti can be calculated as(35)yΔti=yqti-ytiq-1ti=yi+1-yiq-1ti,(36)yΔΔti=yΔqti-yΔtiq-1ti=yi+2-yi+1/q-1ti+1-yi+1-yi/q-1tiq-1ti=Aiyi+2-Biyi+1+Ciyi,where(37)Ai=1q-12titi+1,Bi=ti+ti+1q-12ti2ti+1,Ci=1q-12ti2.In the following, we give a method to solve the numerical solution of (27) with (28).Algorithm 13.
Step 1. Make the transformation s=1/t and let ys=xt; by (8) and (12), (27) with (28) is transformed into(38)f1s,ys,-s2qyΔsq,s4q3yΔΔsq2+q+1s3q3yΔsq2=0,s∈q-N0y0=a,yΔ0=-qb.
Step 2. Let y0=a,yq-N0=a-bq1-N0; set t1=0,t2=q-N0,ti=q-N0+i-2(i=3,4,…,N0+2) and si=q2ti; then (38) will be changed into (39)f1q2ti,yti+2,-q3ti2yΔti+1,q5ti4yΔΔti+q3q+1ti3yΔti=0;notice that (40)yΔti+1=yti+2-yti+1q-1ti+1;then(41)f1q2ti,yi+2,-q2tiyi+2-yi+1q-1,q5ti4Aiyi+2-Biyi+1+Ciyi+q3q+1ti2yi+1-yi=0,y1=a,y2=a-bq1-N0.
Step 3. From (41), we can solve yi+2 step by step.Now we consider an example to illustrate the efficiency of the numerical method.Example 14.
Consider the following second-order terminal value problem onqN0q>1(42)xΔΔt+q+1q2txΔt+xt=1+1t,(43)limn→∞xqn=1,limn→∞q2nxqn=-1q.It is easy to see that x(t)=1/t+1 is the solution of (42) with the terminal value condition (43).
Lett=1/s,ys=xt; then (42) can be transformed into(44)s4q3yΔΔsq2+q+1s3q3yΔsq2-q+1s3q3yΔsq+ys=1+s,(45)y0=1,yΔ0=1.
Setsi=q2ti; by (41), we have(46)q5ti4Aiyi+2-Biyi+1+Ciyi+q+1q3ti3yi+1-yiti+1-ti-q+1q3ti3yi+2-yi+1ti+2-ti+1+yi+2=1+ti+2.
Therefore(47)Diyi+2+Eiyi+1+Fiyi=1+ti+2,where (48)Di=1-q+1q2ti2q-1+q5ti4Ai,Ei=-q5ti4Bi+q+12q2ti2q-1,Fi=-q+1q3ti2q-1+q5ti4Ci.Notice thaty1=1,y2=1+q-N0; then by recurrence formula (47), we can obtain all values of yi; we calculate it in Table 2.Table 2
The comparison of exact value and approximate value forq=2 and N0=10.
(a) Time domain 0.001953125 0.00390625 0.0078125 Exact value 1.001953125 1.00390625 1.0078125 Approximate value 1.001953127793965 1.003906249999968 1.007812500000085  (b) 0.015625 0.03125 0.0625 0.125 0.25 0.5 1 1.015625 1.03125 1.0625 1.125 1.25 1.5 2 1.015625 1.03125 1.0625 1.125 1.25 1.5 2From Table2, we can see that the maximum error is 1×10-8 and the average error is 1×10-9.Figure2 shows the comparison of exact value and approximate value of Example 14 when q=1.1 and N0=50.Figure 2
Forq=1.1,N0=50.


## 4. Discussion and Conclusion

In this paper we have presented a new algorithm for solving the terminal value problems on aq-difference equations. It makes a considering improvement: this establishing method is easy to program implementation, since the numerical calculation formula we established is a relatively simple iteration formula; on the other hand, this establishing method could be generalized to the third-order case, the fourth order case, and so on.For problem (20) or (37)-(38), suppose that y∗t is the exact solution and yt is the numerical solution; from Algorithms 10 and 13, we can see that y0=y∗0; that is, y0 is the exact value. However, yq-N0-y∗q-N0=Oq-2N0; notice that q>1; the error of yq-N0 converges to zero exponentially. In this sense, we may say that the convergence speed of this numerical method is very fast. In fact, the calculation precision can be further improved. By (32), the computational accuracy depends on the number of terms on the right-hand side. The more a higher-order derivative of y∗(t) at zero is obtained, the smaller the error would be.As far as we know, there are very few mathematicians involved in the terminal values problems ofq-difference equations. In [15], the authors examine “terminal" value problems for dynamic equations on time scales; that is, a dynamic equation whose solutions are asymptotic at infinity. They present a number of new theorems that guarantee the existence and uniqueness of solutions, as well as some comparison-type results. And in [16], the authors propose a nonpolynomial collocation method for solving a class of terminal (or boundary) value problems for differential equations of fractional order, and they study the order of convergence of the proposed algorithm. But for the numerical algorithm on the terminal values problems of q-difference equations, we have not found the relevant conclusion.



---

*Source: 8509860-2018-05-14.xml*