1 Introduction

Fractional calculus is one of the prominent branches of mathematics widely used in modeling various physical phenomena. Since fractional derivatives effectively describe the memory and the hereditary properties of different materials and processes, fractional derivative models have become pivotal over traditional integer order models as they neglected these minute effects. Hence, there has been rigorous research in fractional calculus over the last few decades. Fractional derivatives spread their applications in modeling various physical phenomena such as mechanical and electrical properties of natural materials, description of rheological properties of rocks, control of dynamical systems, cryptography, signal processing, continuum mechanics, Threshold nerve propagation, biosciences, electrochemistry, fluid flow in fractal porous media, optimal mobile sensing, turbulence diffusion problems, image denoising, Brownian motion of particles, and many other engineering aspects [1]. Based on the descriptions of their properties in fractional derivatives, the mathematical modeling and simulation of systems and processes naturally leads to differential equations of fractional order and the necessity to solve such equations. However, general methods for solving them are yet to be optimized. Several noninteger order fractional derivatives, such as Gr¨unwald-Letnikov, Riemann–Liouville, Caputo, Weyl, ψ-Hilfer, Erd'elyi-Kober, Hadamard, Chen, Davidson-Essex, Canavati, Jumarie, Erd'elyi-Kober, Riesz/Feller, Hilfer-Katugampola, Caputo-Fabrizio, Atangana-Baleanu Caputo type, Atangana-Baleanu Riemann–Liouville type, Sun-Hao-Zhang-Baleanu, etc. can be seen in the literature [2]. Riemann–Liouville and Caputo's derivatives are widely used in the literature. Analysis of FDEs involving Riemann–Liouville and Caputo derivatives has been studied extensively in the literature [3]. Various analytical methods have been developed for solving nonlinear fractional differential equations [4,5,6]. These decomposition techniques yield solutions without discretizing the equations or estimating the operators. One must turn to numerical approaches to analyze the long-term behavior of the solutions to FDEs because these decomposition methods only produce local solutions near the initial conditions. Studying fractional-ordered dynamical systems and associated phenomena like bifurcations and chaos is a crucial goal for creating new numerical approaches. Precise and swift numerical techniques are necessary for simulation work in fractionally ordered dynamical systems. FDEs are challenging to solve computationally because fractional derivatives are nonlocal. Therefore, a recent research topic is creating numerical methods for FDEs that are quick, accurate, and stable. While FDEs accurately modeled many physical processes, some models still required more precise mathematical methods. Researchers' attention has recently been drawn to distributed-order fractional differential equations. Distributed order fractional derivatives have a long history. Podlubny conducted a comprehensive study of fractional differential equations, which composed fractional order derivative sums. In 1967 and 1995, Caputo explored and used fractional differential equations to depict events in which the order of differentiation fluctuates within a fixed range. Since the differentiation order in these equations is integrated over a specific range, there isn't just one differentiation order. These Distributed Order Differential Equations were thoroughly analyzed by Bagley and Torvik in 2000, who also generated an interesting mathematical framework and solutions for series expansion [7,8,9]. DFDEs modeled several physical phenomena such as Permanent Magnet Synchronous motors [10], time-fractional Black–Scholes model [11], Bioimpedance for human skin [12], Optimal control problems [8], Diffusion–Wave Equation of Groundwater Flow [13], etc. When resolving fractional differential equations of dispersed order, time scales play a crucial role. Since they provide a consistent framework for handling fractional and differential equations, they support accurately modeling various physical events and processes in physics, chemistry, and engineering [39,40,41,42]. The need for numerical solutions to handle these equations increases as the domain of DFDEs depicting the actual behavior of physical systems expands to get around the mathematical complexity of analytical solutions. Consequently, interest in creating efficient and user-friendly numerical techniques for solving such problems has grown. The recent numerical methods for DFDEs in the literature are Petrov Galerkin method [14], Finite difference schemes [15], Chebyshev wavelets method [16], Hybrid block functions, and Taylor polynomials [17], Müntz–Legendre polynomials method  [18], Legendre polynomial method [19], composite collocation method based on Chelyshkov wavelets [20], Haar wavelet method [21], combination of Legendre and Chebyshev wavelets numerical method [22], Legendre Gauss collocation method [23], Legendre operational matrix method [24], hybrid functions consisting of block-pulse functions and Bernoulli polynomial [25], etc.

While dealing with diversified concepts of applied mathematics, graphing is one of the powerful tools for representing and understanding objects and their relationships. Research in the area of graph theory is abundantly expanding. The popularity is due to the mathematical challenges of graph theory and its wide range of applications [26]. For applying theoretical principles of graph theory to practical fields, graph invariants are determined and mapped to real-time problems [27]. Graph invariants are properties like vertices, edges, diameter, and degree. Graph invariants act like a bridge between science and engineering as supporting tools or computational techniques, especially in chemical, electrical, computer, and telecommunication engineering. Usually, graph invariants are studied in algebraic graph theory. Graph invariants whose values are polynomials are known as Graph polynomials. Graph polynomials were first introduced by J.J. Sylvester in 1978 and further studied by J. Petersen [28]. Until now, there have been plenty of graph polynomials such as Chromatic, Characteristic, Dichromatic, Flow polynomials, and various other graph polynomials that have been proven useful in discrete mathematics, engineering, mathematical chemistry, and related disciplines. Polynomials, such as Martin polynomials, Matching polynomials, Tutte polynomials, Rank polynomials, Jones polynomials, Wiener polynomials, Distance polynomials, Edge-difference polynomials, Independence polynomials, Adjacency polynomial, Knot polynomial, Topological transition polynomial, Homomorphism polynomial, Interlace polynomial, Permanent polynomial, etc. [29]. In recent years, some graph polynomials have been proven helpful in developing effective numerical methods for some differential equations [30,31,32]. Recent years have demonstrated that a particular class of graph polynomials has only real roots, which has attracted the attention of many researchers working in various areas of mathematics. Hajiabolhassan and Mehrabadi [33] showed that Clique polynomials always have a real root. Hence, the Clique polynomials, widely used in the numerical approximations of several mathematical models such as Boundary layer natural convection flow problems [34], Nonlinear Klein–Gordon equation [35], Schrodinger equation [36], Brusselator chemical model [37], etc. In all the available research articles based on numerical approximation by clique polynomials, the authors used the clique polynomial of the complete graph. The numerical approximation for distributed order fractional differential equations by clique polynomials is nowhere found in the literature; the author intends to develop a new computational algorithm for DFDE using Clique polynomials as trial functions. In the current work, we want to investigate the approximate solution of nonlinear fractional ordinary differential equations of distributed order with initial and boundary conditions of the form.

$$\mathop {\mathop \int \limits^{\mu } }\limits_{\vartheta } \psi \left( {\varrho } \right)_{0}^{C} D_{x}^{{\varrho }} {\text{E}}\left( Z \right)d{\varrho } = \Upsilon \left( {{\text{E}}\left( Z \right),Z} \right).$$
(1)

where \({Z} \in \left(\left.0, {\mathcal{J}}\right]\right.,\) with the physical conditions \({\mathrm{E}}\left(0\right)= {{\mathrm{E}}}_{0}.\) where \(\psi \left(\varrho \right)\) is non-negative weight function satisfies the condition \(\int\nolimits_{0}^{1} {\psi \left( {\varrho } \right)d{\varrho } = k_{0} }\), \({}_{0}^{C} D_{Z}^{{\varrho }} {\text{E}}\left( Z \right)\) denotes the \({\varrho }^{\rm th}\) order Caputo fractional derivative of \({\text{E}}\left({Z}\right)\). We are using clique polynomials of a new graph known as the cocktail party graph.

2 Preliminaries

Some definitions of fractional calculus [1]:

Let \({\mathrm{E}}\left(x\right)\) Be a continuous function on interval \(\mathtt{I}\subset {\mathbb{R}}\), D be a differential operator, and \(\Gamma \left(\varrho \right)\) be an Euler Gamma function of \(\varrho\),

Definition 1:

for \(\varrho >0\) and \({Z}>\mathcalligra{s}\), for all \(\varrho , {Z}\in {\mathbb{R}}\),

The fractional integral operator of f \(\left({Z}\right)\) is defined by,

$${{\text{I}}}_{\mathcalligra{s}}^{\varrho }{\mathrm{E}}\left({Z}\right)= \frac{1}{\Gamma \left(\varrho \right)}\underset{\mathcalligra{s}}{\overset{x}{\int }}{\left({Z}-x\right)}^{\varrho -1 } \hspace{0.2cm} {\mathrm{E}} \left(x\right)\mathrm{ d}x$$

Definition 2:

for \(\varrho >\mathcalligra{s}\), for all \(\varrho ,{Z}\in {\mathbb{R}}\). The fractional derivative of order \(\varrho\) in Caputo sense is defined by,

$${}_{{Z}}{}^{{\text{c}}}{{\text{D}}}_{\mathcalligra{s}}^{\varrho }{\mathrm{E}}\left({Z}\right)= \left\{\begin{array}{c}\frac{1}{\Gamma \left(\left\lceil n \right\rceil-\varrho \right)} \underset{\mathcalligra{s}}{\overset{{Z}}{\int }}{\left({Z}-x\right)}^{\left(\left\lceil n \right\rceil-\varrho -1\right)}{{\mathrm{E}}}^{ \left(\lceil{\text{n}}\rceil\right)} \left(x\right) dx \hspace{0.8cm} \left\lceil n \right\rceil-1<\varrho <\left\lceil n \right\rceil. \\ \\ {{\mathrm{E}}}^{\left(n\right)}\left({Z}\right) \hspace{4cm} n\in N.\end{array}\right.$$

Properties:

1. \({}_{{Z}}{}^{{\text{c}}}{{\text{D}}}_{\mathcalligra{s}}^{\varrho }\) constant = 0.

2. \({}_{{Z}}{}^{{\text{c}}}{{\text{D}}}_{0}^{\varrho }{{Z}}^{n}= \left\{\begin{array}{ll} 0&\quad for\ n< \lceil\varrho \rceil\ and\ n \in W. \\ \frac{\Gamma \left(1 + n\right)}{\Gamma \left(1 + n - \varrho \right)}{ {Z}}^{n - \varrho }&\quad for\ n \ge \lceil\varrho \rceil\ and\ n \in W.\end{array}\right.\)

Here W = {0,1,2, 3,…} and \(\left\lceil n \right\rceil\) Denotes ceiling of \(n\).

Clique polynomial of a graph

Let S be a simple graph with nonempty sets of vertices X(S) and edges Y(S). A Clique is a complete subgraph of graph S. The maximal clique is the complete subgraph of graph S that contains the maximum number of vertices. The ordinary generating function of the number of complete subgraphs of graph S is called a Clique polynomial of graph S. and is denoted by [37],

$$Q\left(S;{Z}\right)= \sum_{p=0}^{\lambda \left(S\right)}{\mathcalligra{e}}_{p}\hspace{0.2cm} { {Z}}^{p}.$$
(2)

Here, \(\lambda \left(S\right)\) denotes the maximum number of cliques in graph S. The coefficient \({\mathcalligra{e}}_{p}\) of \(\hspace{0.1cm}{{Z}}^{p}\), \(p>0\) indicates the number of cliques of graph S with \(p\) vertices. The constant term \({\mathcalligra{e}}_{0}=1.\) Hajiabolhassan and Mehrabadi showed that \(Q\left(S;{Z}\right)\), it always has a real root in the interval [– 1,0). Also, the class of triangle-free graphs has only clique roots (roots of the clique polynomial).

Cocktail Party Graph The cocktail party graph evolved when solving the shake problem [42]. The Cocktail party graphs are also known as distance regular graphs. Generally, the \({n}^{\rm th}\) order cocktail party graph contains \(n\) number of rows of paired vertices, and all the vertices are connected with edges except the paired ones. The cocktail party graph can also be denoted with various notations, such as \({{\text{K}}}_{n\times 2}\) and \({{\text{K}}}_{n(2)}\).

The fourth-order cocktail party graph is generally illustrated as follows,

figure a

The clique polynomial of the above fourth-order cocktail party graph is as follows,

$$Q\left(S;{Z}\right)= \sum_{p=0}^{\lambda \left(S\right)}{\mathcalligra{e}}_{p}\hspace{0.1cm}{ {Z}}^{p}=\sum_{p=0}^{4}{\mathcalligra{e}}_{p}\hspace{0.1cm}{ {Z}}^{p}.$$
$$Q\left(S;{Z}\right)={\mathcalligra{e}}_{0}{ {Z}}^{0}+{\mathcalligra{e}}_{1}{ {Z}}^{1}+{\mathcalligra{e}}_{2}{ {Z}}^{2}+{\mathcalligra{e}}_{3}{ {Z}}^{3}+{\mathcalligra{e}}_{4}{ {Z}}^{4}.$$
(3)

where the coefficients of \({\mathcalligra{e}}_{0},{\mathcalligra{e}}_{1},{\mathcalligra{e}}_{2},{\mathcalligra{e}}_{3},{\mathcalligra{e}}_{4}\) \({{Z}}^{p},\) denotes the number of zero, one, two, three, and four cliques of S, respectively. In a simple explanation, \({\mathcalligra{e}}_{1}\) denotes the vertex count, \({\mathcalligra{e}}_{2}\) is the edge count, \({\mathcalligra{e}}_{3}\) is the complete triangle subgraph count, \({\mathcalligra{e}}_{4}\) is the complete quadrilaterals count. In the above graph, we can see, \({\mathcalligra{e}}_{0}=1, {\mathcalligra{e}}_{1}=8, {\mathcalligra{e}}_{2}=24, {\mathcalligra{e}}_{3}=32, {\mathcalligra{e}}_{4}=16.\)

Substituting these coefficients in Eq. (2.3.1), we get,

$$Q\left(S;{Z}\right)= 1{ {Z}}^{0}+8{ {Z}}^{1}+24{ {Z}}^{2}+32{ {Z}}^{3}+16{ {Z}}^{4}.$$
$$=1+8{Z}+24{ {Z}}^{2}+32{ {Z}}^{3}+16{ {Z}}^{4.}$$
$$= {\left(1+2{Z}\right)}^{4}.$$

Similarly, the clique polynomials of \({0}^{\rm th}\), \({1}^{st}, {2}^{nd}, {3}^{rd}, {4}^{\rm th},{5}^{\rm th}, {6}^{\rm th},{7}^{\rm th},\dots etc.\) The ordered cocktail party graph is, obtained as follows:

$${\text{C}}({{\text{K}}}_{0\left(2\right)}; {Z})=1.$$
$${\text{C}}\left({{\text{K}}}_{1\left(2\right)}; {Z}\right)=1+2{Z}.$$
$${\text{C}}\left({{\text{K}}}_{2\left(2\right)}; {Z}\right)=1+4{Z}+4{{Z}}^{2.}$$
$${\text{C}}\left({{\text{K}}}_{3\left(2\right)}; {Z}\right)=1+6{Z}+12{{Z}}^{2}+8{{Z}}^{3}.$$
$${\text{C}}\left({{\text{K}}}_{4\left(2\right)}; {Z}\right)=1+8{Z}+24{{Z}}^{2}+{Z}32{{Z}}^{3}+16{{Z}}^{4}.$$
$${\text{C}}\left({{\text{K}}}_{5\left(2\right)}; {Z}\right)=1+10{Z}+40{{Z}}^{2}+80{{Z}}^{3}+80{x}^{4}+32{{Z}}^{5}.$$
$${\text{C}}\left({{\text{K}}}_{6\left(2\right)}; {Z}\right)=1+12{Z}+60{{Z}}^{2}+160{{Z}}^{3}+240{{Z}}^{4}+192{{Z}}^{5}+64{{Z}}^{6}.$$

\({\text{C}}\left({{\text{K}}}_{7\left(2\right)}; {Z}\right)=1+14{Z}+84{{Z}}^{2}+280{{Z}}^{3}+560{{Z}}^{4}+672{{Z}}^{5}+448{{Z}}^{6}+128{{Z}}^{7},\) etc.

With the above observation, The Clique polynomial of the \(n\) th—order Cocktail party graph generalized as below,

$${{\text{C}}({{\text{K}}}_{n\left(2\right)};{Z})=(1+2{Z})}^{n}$$

Convergence analysis:

Theorem 1:

Let \({\mathbb{R}}^{n}\), be the polynomial Space of degree \(n+1\) over the field\({\mathbb{R}}\). and \(\left({Z}\right):\left [a,b\right]\to\) \({\mathbb{R}}^{n}\), be the solution of the linear ordinary differential Eq. (1). The solution of such equations by the present technique will be exact [34].

Proof:

Let \({\mathbb{R}}^{{\text{n}}}\) be the polynomial Space of degree \(n+1\) over the field \({\mathbb{R}}\), and \({\mathbb{T}}\left({Z}\right):\left [{\text{a}},{\text{b}}\right]\to\) \({\mathbb{R}}^{{\text{n}}}\) be a solution of Eq. (1) of degree at most \({\text{n}}.\) then, there is a basis

\({\text{L}}= \left\{{\text{C}}\left({{\text{K}}}_{1\left(2\right)}; {Z}\right),\mathrm{ C}\left({{\text{K}}}_{2\left(2\right)}; {Z}\right), \dots ,\mathrm{ C}\left({{\text{K}}}_{n\left(2\right)}; {Z}\right),\mathrm{ C}\left({{\text{K}}}_{n+1\left(2\right)}; {Z}\right)\right\}\), containing orthogonal polynomials of clique cocktail party graph (CPG) polynomials.

Where \({\text{C}}\left({{\text{K}}}_{1\left(2\right)}; {Z}\right),\mathrm{ C}\left({{\text{K}}}_{2\left(2\right)}; {Z}\right), \dots ,\mathrm{ C}\left({{\text{K}}}_{n\left(2\right)}; {Z}\right),\mathrm{ C}\left({{\text{K}}}_{n+1\left(2\right)}; {Z}\right)\) are CPG polynomials of degree \(\mathrm{0,1},2,\dots ,n\) respectively.

Consider,

$${\mathbb{T}}\left({Z}\right)=\sum_{p=0}^{n+1}{\mathcalligra{e}}_{p}{\text{C}}\left({\mathrm{ K}}_{p(2)} ; {Z}\right),$$

for fixed \(n\) is a linear combination of elements of L. By equating the coefficients of the same degree \({\text{x}}\) on both sides, we get the values of \({{\text{a}}}_{{\text{m}}}\). Hence \({\mathbb{T}}\left({Z}\right)\), is approximated precisely as a linear combination of CPG polynomials.

Theorem 2:

Let \({\mathbb{T}}\left({Z}\right),\) be the solution of Eq. (1), which is a smooth real-valued bounded function on \(\left [a,b\right]\). \({L}^{2}\left [a,b\right]\) Be the Space generated by L, then the orthogonal CPG polynomials expansion of \({\mathbb{T}}\left({Z}\right)\) Converge to it. [34].

Proof:

Let's assume,

$${\mathbb{T}}\left({Z}\right)=\sum_{p=1}^{\infty }{\mathcalligra{e}}_{p}{\text{C}}\left({\mathrm{ K}}_{p(2)} ; {Z}\right)$$
(4)

truncating the above equation, we get,

$${\mathbb{T}}\left({Z}\right)=\sum_{p=1}^{n+1}{\mathcalligra{e}}_{p}{\text{C}}\left({{\text{K}}}_{p(2)};{Z}\right),$$
(5)

where, \({\mathcalligra{e}}_{p}= \langle {\mathbb{T}}\left({Z}\right),\mathrm{ C}\left({{\text{K}}}_{p(2)};{Z}\right) \rangle .\) \(\langle .\rangle\) Represent the inner product operator. Then,

$${\mathcalligra{e}}_{p}= \underset{{\text{a}}}{\overset{{\text{b}}}{\int }}{\mathbb{T}}\left({Z}\right)\mathrm{ C}\left({{\text{K}}}_{p(2)};{Z}\right)d{Z}.$$

By generalized mean value theorem,

$${\mathcalligra{e}}_{p}= {\mathbb{T}}\left({Z}\right)\underset{{\text{a}}}{\overset{{\text{b}}}{\int }}\mathrm{ C}\left({{\text{K}}}_{p(2)};{Z}\right)d{Z} \mathrm{For some t}.$$

Choose, \(\underset{{\text{a}}}{\overset{{\text{b}}}{\int }}\mathrm{ C}\left({{\text{K}}}_{p(2)};{Z}\right)d{Z}= \mu\) and \({\mathbb{T}}\) is bounded by some real constant \(k\), then we get,

$$\left|{\mathcalligra{e}}_{p}\right|= \left|\mu k\right|.$$

Therefore \(\sum {\mathcalligra{e}}_{{\text{i}}}\), is convergent. Hence, a linear combination of \({\mathbb{T}}\left({Z}\right)\), through the basis element of L, converges to it.

3 Clique polynomial collocation method for NDFDE

Let us assume the polynomial approximation,

$$\frac{{d}^{2}{\mathrm{E}}\left({Z}\right)}{d{{Z}}^{2}}=\sum_{p=0}^{n}{\mathcalligra{e}}_{p}{\text{C}}\left({{\text{K}}}_{p(2)};{Z}\right).$$
(6)

On integrating Eq. (6) concerning '\({Z}\)' between the limits' 0' and '\({Z}\),' we get,

$$\frac{d{\mathrm{E}}\left({Z}\right)}{d{Z}}= \frac{d{\mathrm{E}}\left(0\right)}{d{Z}} + \underset{0}{\overset{{Z}}{\int }}\sum_{p=0}^{n}{\mathcalligra{e}}_{p}{\text{C}}\left({{\text{K}}}_{p(2)};{Z}\right) d{Z}.$$
(7)

Applying initial condition \(\frac{d{\mathrm{E}}\left(0\right)}{d{Z}}={Q}_{1}\) (some real number) in Eq. (7), we get,

$$\frac{d{\mathrm{E}}\left({Z}\right)}{d{Z}}= {Q}_{1}+ \underset{0}{\overset{{Z}}{\int }}\sum_{p=0}^{n}{\mathcalligra{e}}_{p}{\text{C}}\left({{\text{K}}}_{p(2)};{Z}\right) d{Z}.$$
(8)

On integrating Eq. (8) concerning '\({Z}\)' between the limits' 0' and '\({Z}\)', we get,

$${\mathrm{E}}\left({Z}\right)= {\mathrm{E}}\left(0\right)+{Q}_{1}{Z}+ \underset{0}{\overset{{Z}}{\int }}\underset{0}{\overset{{Z}}{\int }}\sum_{p=0}^{n}{\mathcalligra{e}}_{p}{\text{C}}\left({{\text{K}}}_{p(2)};{Z}\right) d{Z}d{Z}.$$
(9)

Applying initial condition \({\mathrm{E}}\left(0\right)={Q}_{2}\)(some actual number) in Eq. (9), we get,

$${\mathrm{E}}\left({Z}\right)= {Q}_{2}+{Q}_{1}{Z}+ \underset{0}{\overset{{Z}}{\int }}\underset{0}{\overset{{Z}}{\int }}\sum_{p=0}^{n}{\mathcalligra{e}}_{p}{\text{C}}\left({{\text{K}}}_{p(2)};{Z}\right) d{Z}d{Z}.$$
(10)

Applying Caputo fractional derivative on Eq. (10), we get,

$${}_{0}{}^{c}{D}_{{Z}}^{\varrho }{\mathrm{E}}\left({Z}\right)= {}_{0}{}^{c}{D}_{{Z}}^{\varrho } {Q}_{2}+ {}_{0}{}^{c}{D}_{{Z}}^{\varrho } \left({Q}_{1}{Z}\right)+ {}_{0}{}^{c}{D}_{{Z}}^{\varrho }\left(\underset{0}{\overset{{Z}}{\int }}\underset{0}{\overset{{Z}}{\int }}\sum_{p=0}^{n}{\mathcalligra{e}}_{p}{\text{C}}\left({{\text{K}}}_{p(2)};{Z}\right) d{Z}d{Z}\right).$$
(11)

Since \({Q}_{2}\) is constant and \({}_{0}{}^{c}{D}_{{Z}}^{\varrho } \left(constant\right)=0, {}_{0}{}^{c}{D}_{{Z}}^{\varrho }\left({{Z}}^{n}\right)=\frac{\Gamma \left(1+n\right)}{\Gamma \left(1+n-\varrho \right)}{{Z}}^{n-\varrho }\), the above Eq. (11) takes the form,

$${}_{0}{}^{c}{D}_{{Z}}^{\varrho }{\mathrm{E}}\left({Z}\right)= {Q}_{1}\frac{2}{\Gamma \left(2-\varrho \right)}{{Z}}^{1-\varrho }+ {}_{0}{}^{c}{D}_{{Z}}^{\varrho }\left(\underset{0}{\overset{{Z}}{\int }}\underset{0}{\overset{{Z}}{\int }}\sum_{p=0}^{n}{\mathcalligra{e}}_{p}{\text{C}}\left({{\text{K}}}_{p(2)};{Z}\right) d{Z}d{Z}\right).$$
(12)

Consider the distributed order time fractional differential equation of the form (1)

$$\underset{\vartheta }{\overset{\mu }{\int }}\psi \left(\varrho \right){}_{0}{}^{C}{D}_{x}^{\varrho }{\mathrm{E}}\left({Z}\right) d\varrho =\Upsilon \left({\mathrm{E}}\left({Z}\right),{Z}\right)$$

Substituting Eq. (12) in the above DFODE, we get,

$$\underset{0}{\overset{1}{\int }}\psi \left(\varrho \right)\left({Q}_{1}\frac{\Gamma \left(2\right)}{\Gamma \left(2-\varrho \right)}{{Z}}^{1-\varrho }+ {}_{0}{}^{c}{D}_{{Z}}^{\varrho }\left(\underset{0}{\overset{{Z}}{\int }}\underset{0}{\overset{{Z}}{\int }}\sum_{p=0}^{n}{\mathcalligra{e}}_{p}{\text{C}}\left({{\text{K}}}_{p(2)};{Z}\right) d{Z}d{Z} \right)\right)d\varrho =\Upsilon \left(\left({Q}_{2}+{Q}_{1}{Z}+ \underset{0}{\overset{{Z}}{\int }}\underset{0}{\overset{{Z}}{\int }}\sum_{p=0}^{n}{\mathcalligra{e}}_{p}{\text{C}}\left({{\text{K}}}_{p(2)};{Z}\right) d{Z}d{Z} \right),{Z}\right).$$
(13)

Solving the above Eq. (13) and discretizing the resultant equation with the collocation points \({{Z}}_{i}= \frac{\left(\mu - \vartheta \right)}{2i}\), \(i=\mathrm{1,2},\dots ,\) etc., the NDFODE is transformed into a system of algebraic equations. The resultant system of algebraic equations is then solved by Newton–Raphson's method to obtain the proposed CCM solution for NDFODE.

4 Numerical simulation

Example 1:

Consider the nonlinear distributed order time-fractional differential equation [38],

$$\underset{0}{\overset{1}{\int }} {\left(\Gamma \left(4-\varrho \right){}_{0}{}^{c}{D}_{{Z}}^{\varrho } {\mathrm{E}}\left({Z}\right)\right)}^{2} d\varrho =\frac{18 {{Z}}^{4}\left({{Z}}^{2}-1\right)}{{\text{ln}}{Z}}.$$
(14)

With the initial conditions \({\mathrm{E}}\left(0\right)=\) \({{\mathrm{E}}}{\prime}\left(0\right)=0\).and the exact solution \({\mathrm{E}}\left({Z}\right)= {{Z}}^{3}.\)

Implementation of CCM: for N = 2, we have,

$${{\text{E}}}^{\left(2\right)}\left({Z}\right)={a}_{0}\left(1\right)+{a}_{1}\left(1+2{Z}\right).$$
(15)

On integrating Eq. (16) twice concerning \({Z}\) from 0 to \({Z}\), we get,

$${{\text{E}}}^{\left({\prime}\right)}\left({Z}\right)= {Z}a\left [0\right]+{Z}a\left [1\right]+{{Z}}^{2}a\left [1\right].$$
(16)
$${\mathrm{E}}\left({Z}\right)=\frac{1}{2}{{Z}}^{2}a\left [0\right]+\frac{1}{2}{{Z}}^{2}a\left [1\right]+\frac{1}{3}{{Z}}^{3}a\left [1\right].$$
(17)

Caputo fractional derivative of \({\mathrm{E}}\left({Z}\right)\) is obtained as follows,

$${}_{0}{}^{c}{D}_{{Z}}^{\varrho } {\mathrm{E}}\left({Z}\right)=\frac{1}{2}\frac{\Gamma \left(3\right)}{\Gamma \left(3-\varrho \right)}{{Z}}^{2-\varrho }a\left [0\right]+\frac{1}{2}\frac{\Gamma \left(3\right)}{\Gamma \left(3-\varrho \right)}{{Z}}^{2-\varrho }a\left [1\right]+\frac{1}{3}\frac{\Gamma \left(4\right)}{\Gamma \left(4-\varrho \right)}{{Z}}^{3-\varrho }a\left [1\right.]$$
$$\begin{aligned} \Gamma \left( {4 - {\varrho }} \right)_{0}^{c} D_{Z}^{{\varrho }} {\text{E}}\left( Z \right) = \frac{1}{2}\frac{{\Gamma \left( 3 \right)\Gamma \left( {4 - {\varrho }} \right)}}{{\Gamma \left( {3 - {\varrho }} \right)}}Z^{{2 - {\varrho }}} a\left[ 0 \right] \hfill \\ + \frac{1}{2}\frac{{\Gamma \left( 3 \right)\Gamma \left( {4 - {\varrho }} \right)}}{{\Gamma \left( {3 - {\varrho }} \right)}}Z^{{2 - {\varrho }}} a\left[ 1 \right] + \frac{1}{3}\frac{{\Gamma \left( 4 \right)\Gamma \left( {4 - {\varrho }} \right)}}{{\Gamma \left( {4 - {\varrho }} \right)}}Z^{{3 - {\varrho }}} a\left[ 1 \right] \hfill \\ \end{aligned}$$

Simplifying the above equation, we get,

$$\Gamma \left(4-\varrho \right){}_{0}{}^{c}{D}_{{Z}}^{\varrho }{\mathrm{E}}\left({Z}\right)=\left(a\left [0\right]+a\left [1\right]\right)\left(3-\varrho \right){{Z}}^{2-\varrho }+2{ a\left [1\right] {Z}}^{3-\varrho }.$$

Now, the LHS of Eq. (15) becomes

$$\underset{0}{\overset{1}{\int }} {\left(\Gamma \left(4-\varrho \right){}_{0}{}^{c}{D}_{{Z}}^{\varrho } {\mathrm{E}}\left({Z}\right)\right)}^{2} d\varrho = \frac{1}{4{{\text{Log}} [{Z}]}^{3}}{{Z}}^{2}(-{(a [0]+a [1])}^{2}+4(a [0]+(1+t)a [1]){\text{Log}} [{Z}](a [0]+a [1]-2(a [0]+(1+{Z})a [1]){\text{Log}} [{Z}])+{{Z}}^{2}({(a [0]+a [1])}^{2}+2(-3a [0]-(3+2{Z})a [1]){\text{Log}} [{Z}](a [0]+a [1]-(3a [0]+(3+2{Z})a [1]){\text{Log}} [{Z}]))).$$

On solving Eq. (15) with the collocation points \({Z}=0.4\) and \({Z}=0.8\), we get the following system of equations,

$$-0.4224+0.4120{a [0]}^{2}+1.1004a [1]a [1]+0.7353{a [1]}^{2}.$$
$$-11.8946+3.1742{a [0]}^{2}+10.4173a [1]a [1]+8.5647{a [1]}^{2.}$$

Solving the above system of equations, we get the roots as,\({a}_{0}=-3\),\({a}_{1}=3\). Substituting these coefficients in Eq. (17), we get the clique polynomial approximation solution as \({{Z}}^{3}\).Which is the same as our exact solution. Table 1 presents the comparative results of the exact solution and the CCM results with the absolute errors (AE) at \({Z}\in \left [\mathrm{0,1}\right], h=0.1.\) In Table 2, we compared the relative errors of CCM with the composite collocation method based on Chelyshkov wavelets at\({Z}\in \left(\mathrm{0,1}\right) , h=0.1\). In Table 3, we can see the AE comparison between the CCM and the Trapezoidal rule presented in the Ref [38] at various step lengths\(h\in \left(\mathrm{0,0.12}\right)\). From all the tabulated results in tables [1,2,3], it is clear that the CCM results of the proposed method are accurate and well-matched with the analytical result. In Ref [16], the least \({L}_{2}\) error by the Chebyshev wavelet method is \(2.53\times {10}^{-11}\) and the \({L}_{2}\) error by the CCM is zero, showing the proposed method's efficiency. The computational time for this example 1 in MATHEMATICA(13.2) was 0.12 s, proving the CCM's productivity. A graphical representation of the correlation of CCM results with the analytical results presented in Fig. 1.

Table 1 Numerical comparison of Clique polynomial solution with analytical solution of Example 1
Table 2 Relative error analysis of composite collocation method based on Chelyshkov wavelets (CW) and the proposed CCM for Example 1
Table 3 Absolute error comparison of the Trapezoidal rule [38] with the proposed CCM at \(x=0.9\), and various step lengths, for Example 1
Fig. 1
figure 1

Geometrical correlation of CCM solution with the exact solution of Example 1 for \({Z} \in \left [\mathrm{0,1}\right], h=0.1, N=2.\)

Example 2:

Consider the nonlinear distributed order time-fractional differential equation [17],

$$\underset{0}{\overset{2}{\int }} {\left(\Gamma \left(3-\varrho \right){}_{0}{}^{c}{D}_{{Z}}^{\varrho } {\mathrm{E}}\left({Z}\right)\right)}^{2}d\varrho =\frac{2 {{Z}}^{4}-2}{{\text{ln}}{Z}.}$$
(18)

With the physical conditions \({\mathrm{E}}\left(0.1\right)=\) 4.01, \({{\mathrm{E}}}{\prime}\left(0.1\right)=0\).2, and the exact solution \({\mathrm{E}}\left({Z}\right)= {{Z}}^{2}+4.\)

Implementation of CCM for N = 1, we have,

$${{\mathrm{E}}}^{\left(2\right)}\left({Z}\right)={a}_{0}\left(1\right).$$
(19)

On integrating Eq. (19) twice concerning \({Z}\) between the limits 0.1 to \({Z}\), we get,\({{\mathrm{E}}}^{\left({\prime}\right)}\left({Z}\right)= 0.2+\left({Z}-0.1\right){a}_{0}\).

$${\mathrm{E}}\left({Z}\right)=3.99+0.2 {Z}+\left(0.005-0.1 {Z}+0.5 {{Z}}^{2}\right) {a}_{0}.$$
(20)
$${}_{0}{}^{c}{D}_{{Z}}^{\varrho } {\mathrm{E}}\left({Z}\right)= \left(0.2-0.1{a}_{0}\right)\frac{{{Z}}^{1-\varrho }}{\Gamma (2-q)}+\frac{{{Z}}^{2-\varrho }}{\Gamma (3-q)}{a}_{0}.$$
$$\Gamma \left(3-\varrho \right) {}_{0}{}^{c}{D}_{{Z}}^{\varrho } {\mathrm{E}}\left({Z}\right)= \left(2-\varrho \right){{Z}}^{\left(1-\varrho \right)}\left(0.2-0.1{a}_{0}\right)+{{Z}}^{\left(2-\varrho \right)}{a}_{0}.$$
(21)

Substituting Eq. (21) in Eq. (18) and solving Eq. (18) at \({Z}=0.5\) we get,

$$-2.6421+0.2551{a}_{0}+0.5329{{a}_{0}}^{2}.$$
(22)

Solving Eq. (22), we obtained the unknown coefficient of the initial clique polynomial approximation as \({a}_{0}=2.\) Replacing this root value in Eq. (20), we get the approximate solution as, \(4+{{Z}}^{2}\). Which is simply the exact solution \({\mathrm{E}}\left({Z}\right)= {{Z}}^{2}+4\) of example 1.

The CCM findings at \({Z} \in \left [\mathrm{0,2}\right], h=0.2\) are compared with the results of the analytical solution in Table 4. The compatibility of CCM with the exact solution is depicted in Fig. 2. In Ref [17], the authors used the Reimann-Liouville fractional integral operator of hybrid of the Block pulse functions and Taylor polynomials to obtain relatively accurate results with the help of the Legendre–Gauss quadrature rule for numerical integration. In contrast, in our CCM, we attained the exact solution directly by the classical Reimann sum of the Caputo fractional derivative of clique polynomials.

Table 4 Numerical comparison of Clique polynomial solution with Analytical solution of Example 2
Fig. 2
figure 2

Geometrical correlation of CCM solution with the Exact solution of Example 1 at \({Z} \in \left [\mathrm{0,2}\right], h=0.1, N=1.\)

Example 3:

Consider the nonlinear distributed order time-fractional differential equation [23],

$$\underset{0}{\overset{1}{\int }} \Gamma \left(7-\varrho \right){}_{0}{}^{c}{D}_{{Z}}^{\varrho } {\mathrm{E}}\left({Z}\right) d\varrho =-{{\mathrm{E}}}^{3}\left({Z}\right)-{\mathrm{E}}\left({Z}\right)+720\frac{{{Z}}^{5}\left({Z}-1\right)}{{\text{ln}}{Z}}+{{Z}}^{18}+{{Z}}^{6}.$$
(23)

\({Z}\in \left(\mathrm{0,1}\right]\) with the initial conditions \({\mathrm{E}}\left(0\right)=0\), and the exact solution is \({\mathrm{E}}\left({Z}\right)= {{Z}}^{6}.\)

Implementation of CCM for N = 5, we have,

$${{\mathrm{E}}}^{\left(2\right)}\left({Z}\right)= {a}_{0}\left(1\right)+{a}_{1}\left(1+2{Z}\right)+\left(1+4{Z}+4{{Z}}^{2}\right){a}_{2}+\left(1+6{Z}+12{{Z}}^{2}+8{{Z}}^{3}\right){a}_{3}+ \left(1+8{Z}+24{{Z}}^{2}+32{{Z}}^{3}+16{{Z}}^{4}\right){a}_{4}.$$
(24)

On integrating Eq. (24) twice concerning \({Z}\) between the limits 0 to \({Z}\), we get,

$${{\mathrm{E}}}^{\left({\prime}\right)}\left({Z}\right)= \left({a}_{0}+{a}_{1}+{a}_{2}+{a}_{3}+{a}_{4}\right){Z}+\left({a}_{1}+2{a}_{2}+3{a}_{3}+4{a}_{4}\right){{Z}}^{2}+\left(\frac{4}{3}{a}_{2}+4{a}_{3}+8{a}_{4}\right){{Z}}^{3}+\left(2{a}_{3}+8{a}_{4}\right){{Z}}^{4}+\frac{16}{5}{a}_{4}{{Z}}^{5}.$$
$${\mathrm{E}}\left({Z}\right)=\frac{1}{2}\left({a}_{0}+{a}_{1}+{a}_{2}+{a}_{3}+{a}_{4}\right){{Z}}^{2}+\frac{1}{3}\left({a}_{1}+2{a}_{2}+3{a}_{3}+4{a}_{4}\right){{Z}}^{3}+\frac{1}{4}\left(\frac{4}{3}{a}_{2}+4{a}_{3}+8{a}_{4}\right){{Z}}^{4}+\frac{1}{5}\left(2{a}_{3}+8{a}_{4}\right){{Z}}^{5}+\frac{8}{15}{a}_{4}{{Z}}^{6}.$$
(25)
$${}_{0}{}^{c}{D}_{{Z}}^{\varrho } {\mathrm{E}}\left({Z}\right)= \frac{1}{2}\left({a}_{0}+{a}_{1}+{a}_{2}+{a}_{3}+{a}_{4}\right)\frac{\Gamma \left(3\right)}{\Gamma \left(3-\varrho \right)}{{Z}}^{\left(2-\varrho \right)}+\frac{1}{3}\left({a}_{1}+2{a}_{2}+3{a}_{3}+4{a}_{4}\right)\frac{\Gamma \left(4\right)}{\Gamma \left(4-\varrho \right)}{{Z}}^{\left(3-\varrho \right)}+\frac{1}{4}\left(\frac{4}{3}{a}_{2}+4{a}_{3}+8{a}_{4}\right)\frac{\Gamma \left(5\right)}{\Gamma \left(5-\varrho \right)}{{Z}}^{\left(4-\varrho \right)}+\frac{1}{5}\left(2{a}_{3}+8{a}_{4}\right)\frac{\Gamma \left(6\right)}{\Gamma \left(6-\varrho \right)}{{Z}}^{\left(5-\varrho \right)}+\frac{8}{15}{a}_{4}\frac{\Gamma \left(7\right)}{\Gamma \left(7-\varrho \right)}{{Z}}^{\left(6-\varrho \right)}.$$
$$\Gamma \left(7-\varrho \right){}_{0}{}^{c}{D}_{{Z}}^{\varrho } {\mathrm{E}}\left({Z}\right)= \left({a}_{0}+{a}_{1}+{a}_{2}+{a}_{3}+{a}_{4}\right) \left( {\varrho }^{4}-18{\varrho }^{3}+119{\varrho }^{2}-342\varrho +360\right){{Z}}^{\left(2-\varrho \right)}+2\left({a}_{1}+2{a}_{2}+3{a}_{3}+4{a}_{4}\right)\left( 120-{\varrho }^{3}+15{\varrho }^{2}-74\varrho \right){{Z}}^{\left(3-\varrho \right)}+6\left(\frac{4}{3}{a}_{2}+4{a}_{3}+8{a}_{4}\right)\left({\varrho }^{2}-11\varrho +30\right){{Z}}^{\left(4-\varrho \right)}+24\left(2{a}_{3}+8{a}_{4}\right)\left(6-\varrho \right){{Z}}^{\left(5-\varrho \right)}+384{a}_{4}{{Z}}^{\left(6-\varrho \right)}.$$
(26)

Substituting Eq. (26) in Eq. (23) and discretizing Eq. (23) with the collocation points 0.1, 0.3, 0.5, 0.7, 0.9, we get the system having five algebraic equations. Solving the above system using Newton-Raphson's method in MATHEMATICA, we obtained the unknown coefficients as,

$${a}_{0}=1.875, {a}_{1}=-7.5, {a}_{2}=11.25, {a}_{3}=-7.5, {a}_{4}=1.875$$

Substituting these unknowns in Eq. (25), The resultant Clique polynomial solution was \({{Z}}^{6}\). The exactness of the CCM results is presented in Table 5 and Fig. 3. In Table 5, we compared the CCM findings with the analytical results at \({Z} \in \left [\mathrm{0,1}\right], h=0.1\), and its AE. In Table 6, the \({L}_{2}\) CCM errors compared with the Legendre -Gauss collocation method. From the results of Table 6, the least \({L}_{2}\)-error by LGCM is \(3.7206\times {10}^{-16}\) at N = 13 confirms the exactness of the suggested computational algorithm CCM with zero \({L}_{2}\) Error at N = 5.

Table 5 Numerical comparison of Clique polynomial collocation method (CCM) solution with Analytical solution of Example 3
Fig. 3
figure 3

Geometrical correlation of CCM solution with the Exact solution of Example 1 for \({Z} \in \left [\mathrm{0,1}\right], h=0.1, N=5\)

Table 6 Comparison of \({L}_{2}\)-Errors of Clique polynomial collocation method with Legendre Gauss collocation method (LGCM) for Example 3

Example 4:

Consider the nonlinear distributed order time-fractional differential equation [23],

$$\underset{0}{\overset{1}{\int }} \Gamma \left(5-\varrho \right){}_{0}{}^{c}{D}_{{Z}}^{\varrho } {\mathrm{E}}\left({Z}\right) d\varrho =\mathrm{sin{\rm E}}\left({Z}\right)+24 \frac{{{Z}}^{4}-{{Z}}^{3}}{{\text{ln}}{Z}}-sin\left({{Z}}^{4}\right).$$
(27)

\({Z}\in (\mathrm{0,1}]\) With the initial conditions \({\mathrm{E}}\left(0\right)=0\).and the exact solution \({\mathrm{E}}\left({Z}\right)= {{Z}}^{4}.\)

Implementation of CCM: for N = 3, we have,

$${{\mathrm{E}}}^{\left(2\right)}\left({Z}\right)= {a}_{0}\left(1\right)+{a}_{1}\left(1+2{Z}\right)+\left(1+4{Z}+4{{Z}}^{2}\right){a}_{2}.$$
(28)

On integrating Eq. (28) twice concerning '\({Z}\)' between the limits' 0' and '\({Z}\),' we get,

$${\mathrm{E}}\left({Z}\right)=\frac{1}{2}\left({a}_{0}+{a}_{1}+2{a}_{2}\right){{Z}}^{2}+\frac{1}{3}\left({a}_{1}+2{a}_{2}\right){{Z}}^{3}+\frac{1}{3}2{a}_{2}{{Z}}^{4}.$$
(29)

The Caputo derivative of Eq. (29) is,

$${}_{0}{}^{c}{D}_{{Z}}^{\varrho } {\mathrm{E}}\left({Z}\right)=\frac{1}{2} \left({a}_{0}+{a}_{1}+2{a}_{2}\right)\frac{\Gamma \left(3\right)}{\Gamma \left(3-\varrho \right)}{{Z}}^{\left(2-\varrho \right)}+\frac{1}{3}\left({a}_{1}+2{a}_{2}\right)\frac{\Gamma \left(4\right)}{\Gamma \left(4-\varrho \right)}{{Z}}^{\left(3-\varrho \right)}+ 2{a}_{2}\frac{1 }{3}\frac{\Gamma \left(5\right)}{\Gamma \left(5-\varrho \right)}{{Z}}^{\left(4-\varrho \right)}$$
(30)

Substituting the value of Eq. (30) in Eq. (27) and solving Eq. (27), we get the following system of equations,

$$-0.00928+{\left\{0.30431-Sin(0.005)\right\}a}_{0}+\left\{0.330287-Sin\left(0.005\right)-Sin(0.0003)\right\}{a}_{1}+\left\{0.35939-Sin(0.00003)-Sin(0.005)-Sin(0.0006)\right\}{a}_{2}.$$
$$-2.10158+{\left\{0.30624-Sin(0.125)\right\}a}_{0}+\left\{4.30411-Sin\left(0.125\right)-Sin(0.041667)\right\}{a}_{1}+\left\{6.26714-Sin(0.02083)-Sin(0.125)-Sin(0.08334)\right\}{a}_{2}.$$
$$-15.9958+{\left\{7.50056-Sin(0.405)\right\}a}_{0}+\left\{12.8686-Sin\left(0.405\right)-Sin(0.243)\right\}{a}_{1}+\left\{23.7719-Sin(0.2187)-Sin(0.405)-Sin(0.486)\right\}{a}_{2}.$$

Solving the above system of solution, we get the roots of the equations as, \({a}_{0}=3,{a}_{1}=-6,{a}_{2}=3\). Replacing the unknown coefficients in Eq. (29) with these roots, we get the clique polynomial solution as \({{Z}}^{4}\).which is simply the exact solution of example 4. The correlation of CCM results and the results of the Exact solution at \({Z} \in (\mathrm{0,1}), h=0.2, N=3\) through absolute errors are illustrated in Table 7. Results in Table 8 provide the significance of the CCM by comparing the \({L}_{2}\)-Errors with the Legendre–Gauss collocation method at various sets of collocation points. Figure 4 confirms the CCM result's stability compared to the concrete results.

Table 7 Numerical comparison of Clique polynomial solution with Analytical solution of Example 4
Table 8 Comparison of \({L}_{2}\) Errors of the Clique polynomial collocation method with the Legendre Gauss collocation method are for Example 4
Fig. 4
figure 4

Geometrical correlation of CCM solution with the Exact solution of Example 4 at \({Z} \in \left [\mathrm{0,1}\right], h=0.1, N=3\)

5 Conclusion

This paper introduces an efficient analytical method for a class of nonlinear distributed order fractional ordinary differential equations using a particular class of graph theoretic polynomials, the clique polynomials of cocktail party graphs. Most of the authors in the literature implemented the quadrature rule of numerical integration to solve the distributed order fractional differential equations. In the suggested algorithm, we focused on and developed an alternate computational technique that requires no transformations to change the range of the distribution of fractional orders and can directly solve the DFDEs with simple procedures like operational integration and classical Reimann sum of Caputo fractional derivatives of polynomial approximation. The proficiency of the presented CCM is verified with four illustrative examples, and the numerical findings are compared with the recent numerical methods in the literature. Convergence analysis, graphical representations, and error analysis support the method's accuracy. The goals of solving the considered class of NDFODEs without linearizing the terms in the equations, low computation cost (Less than 0.15s in MATHEMATICA 13.2 for overall computation), accuracy, and stability even for more considerable step lengths achieved. Due to its excellent compatibility with analytical solutions, we intend to address other classes of nonlinear mathematical models governed by the distributed order fractional differential equations, such as the multidimensional time fractional transport equations, financial models like the Black-Scholes equation, etc., as future work.