Next Article in Journal
Hierarchical Deep Feature Fusion and Ensemble Learning for Enhanced Brain Tumor MRI Classification
Previous Article in Journal
Generalized (τ,σ)-L-Derivations in Rings
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Theory of Functional Connections Applied to Linear Discontinuous Differential Equations

1
DEVCOM Army Research Laboratory South, College Station, TX 77840, USA
2
Aerospace Engineering, Texas A&M University, College Station, TX 77840, USA
*
Author to whom correspondence should be addressed.
These authors contributed equally to this work.
Mathematics 2025, 13(17), 2785; https://doi.org/10.3390/math13172785
Submission received: 11 July 2025 / Revised: 9 August 2025 / Accepted: 25 August 2025 / Published: 29 August 2025
(This article belongs to the Section E6: Functional Interpolation)

Abstract

This article introduces two numerical methods based on the Theory of Functional Connections (TFC) for solving linear ordinary differential equations that involve step discontinuities in the forcing term. The novelty of the first proposed approach lies in the direct incorporation of discontinuities into the free function of the TFC framework, while the second proposed method resolves discontinuities through piecewise constrained expressions comprising particular weighted support functions systematically chosen to enforce continuity conditions. The accuracy of the proposed methods is validated for both a second-order initial value and boundary value problem. As a final demonstration, the methods are applied to a third-order differential equation with non-constant coefficients and multiple discontinuities, for which an analytical solution is known. The methods achieve error levels approaching machine precision, even in the case of equations involving functions whose Laplace transforms are not available.

1. Introduction

Discontinuous differential equations (DDEs) commonly appear in many areas of science and engineering. Some illustrative examples are as follows:
  • A mass–spring system subjected to a step load, m y ( t ) + k y ( t ) = F 0 H ( t t 0 ) , where H ( t ) is the Heaviside step function modeling a sudden applied force. This model describes shock responses in structures, such as vehicle collisions or switching mechanisms.
  • An RL circuit with a switched voltage source, L d i d t + R i = V 0 H ( t t 0 ) , that is used in transient circuit analysis, power electronics, and digital devices.
  • A rod with piecewise thermal conductivity, d d x k ( x ) d u d x = 0 , where k ( x ) = k 1 if x < x 1 and k ( x ) = k 2 if x > x 1 . This model is common in layered insulation or material systems with abrupt changes in conductivity.
  • Wave propagation through layered media, ρ ( x ) 2 u t 2 = x μ ( x ) u x , where ρ ( x ) and μ ( x ) in the wave equation are piecewise functions that model subsurface layers.
  • Bang–bang control, v ( t ) = k v ( t ) + u ( t ) , where u ( t ) switches between + U and U according to the control law. This is used in guidance laws for optimal control and rapid switching maneuvers.
  • Coulomb friction, m x + μ N sgn ( x ) = 0 , which appears in braking systems, robotics, and dry contact problems.
In general, discontinuities may occur in the forcing term or the coefficients of the differential equation. In the case of discontinuous coefficients, the order of continuity is governed by the structure of the differential equation and its coefficients, which poses significant analytical challenges [1,2]. For second-order linear differential equations, the solution field typically remains continuous across the discontinuity, while the first derivative may be discontinuous depending on the specific expression of the coefficients. Furthermore, the second derivative may contain singular components such as a Dirac delta function, particularly when the discontinuity occurs in the highest-order coefficient. These issues are especially critical in the study of Sturm–Liouville and boundary value problems, where precise matching conditions at points of discontinuity are essential to ensure the mathematical and physical consistency of the solution. Zettl’s work [3] develops a rigorous framework for handling such problems. In the case of the forcing term containing step discontinuities, it has been proven that the solution field of an nth-order differential equation is C n 1 continuous [4,5,6], so the order of continuity is independent of the associated homogeneous equation. For simplicity and brevity, this article only considers linear nonhomogeneous ordinary differential equations (ODEs) of n-order subject to n linear constraints with simple discontinuities in the forcing function.
Green’s functions [7,8] and Laplace transforms [9,10,11] are the most common analytical methods used to solve such discontinuous ODEs, but these techniques are typically limited to linear problems with known Green’s functions or Laplace transforms, which may be mathematically complex, and simple boundary conditions. Alternatively, within engineering analysis and scientific computing, approximation methods such as the finite difference method (FDM) [12], the finite volume method (FVM) [13], the finite element method (FEM) [14], and spectral methods [15] are frequently employed for modeling a variety of physical systems with varying degrees of complexity. Of particular relevance to this work are spectral methods and FEM.
In spectral methods, the solution field is represented as a weighted sum of smooth global basis functions whose coefficients are chosen to satisfy the differential equation and constraints. Spectral methods are often implemented using a collocation approach, where the function approximation is substituted into the strong form of the differential equation and the residual is forced to zero at select points in the domain. This yields an algebraic system of equations where the unknowns are the coefficients of the basis functions, which can be solved using several numerical techniques, while boundary conditions can be satisfied analytically with a keen choice in basis functions for certain problems; spectral methods commonly employ iterative techniques (i.e., shooting methods) to only approximately satisfy boundary conditions [15]. Since spectral methods typically assume a globally smooth functional form, they do not apply to problems involving discontinuities.
In contrast, the finite element method involves discretizing the global domain into a set of subdomains (i.e., elements) and representing the solution field over each element as a weighted sum of basis functions (i.e., shape functions). Consequently, this piecewise representation of the solution field allows discontinuities to be more easily resolved, while many variations of FEM exist [14]; one of the most common implementations is the Galerkin weighted residual method. This traditional FEM approach involves substituting the function approximation over each element into the differential equation and setting the integral of the corresponding weighted residual to zero with the weighting functions chosen to be identical to the shape functions. Integration by parts is then employed to weaken the differentiability requirements on the shape functions, which simplifies the evaluation of the integral equations that form a set of element equations. Continuity conditions on the field are then directly enforced between elements through an assembly process that forms a global algebraic system of equations, which are then modified to impose boundary conditions via the direct or penalty method. While the finite element method applies to a wider class of problems involving arbitrarily shaped domains and discontinuities, spectral methods are often easier to implement and exhibit better computational efficiency for 1-D and 2-D problems that are smooth, especially over rectilinear domains [16].
In this article, two numerical methods based on the Theory of Functional Connections (TFC) are developed for solving linear nonhomogeneous ODEs with discontinuities in the forcing function that combine principles from spectral and finite element methods. The approaches are similar to spectral methods in that high-order function approximations of the solution field are used to form an algebraic system of equations directly from the strong form of the differential equation; however, the basis functions are defined over subdomains similar to FEM to allow for the resolution of discontinuities. Additionally, all constraints—initial value, boundary value, and continuity—are satisfied analytically. This exploration of TFC addressing discontinuous ordinary differential equations (DDEs) begins with simple, linear DDEs characterized by smooth solution fields and regular constraints, representing an initial and necessary step toward more complex problems. The goal is not to propose a method superior to existing approaches, but rather to demonstrate the potential application of TFC to solving problems involving discontinuities. In particular, the aim is to highlight a novel and significant feature introduced in this study: the ability to encode information (here about discontinuities) directly into the free function of the TFC framework. This capability, presented here for the first time, is general and not limited to the DDEs, which opens new directions for the application of TFC, both theoretically and practically.

Summary of the Theory of Functional Connections

The Theory of Functional Connections was initially introduced in [17], further refined in [18,19], and comprehensively summarized in [20]. It extends the classical interpolation problem—where n constraints are satisfied using n linearly independent support functions—into the broader concept of functional interpolation. TFC provides a systematic approach for constructing functionals representing the entire family of interpolation functions meeting a prescribed set of n linear constraints. These functionals characterize the subspace of functions that inherently satisfy the constraints, effectively reducing the whole solution space to just the subspace where solutions fully comply with all linear constraints. By leveraging these functionals, TFC reformulates constrained optimization problems into unconstrained ones, allowing for more efficient, accurate, and reliable computational techniques. The foundational work in [17] details the application of TFC to univariate constraints involving fixed values, derivatives, and linear combinations thereof. Subsequent developments have expanded TFC to handle integral, infinite, and multivariate constraints, as well as solve ordinary, partial, and integrodifferential equations [21].
In the univariate case, TFC can be expressed by either one of the two equivalent formulations:
f x , g ( x ) = g ( x ) + i = 1 n η i x , g ( x ) s i ( x ) ( η - formulation ) f x , g ( x ) = g ( x ) + i = 1 n ϕ i x , s ( x ) ρ i x , g ( x ) ( switching - projection formulation ) ,
where f x , g ( x ) is a functional that satisfies the given n constraints, and g ( x ) is a freely chosen function. Additionally, s i ( x ) are user-defined support functions that are linearly independent over the domain, while η i ( x , g ( x ) ) are the associated coefficient functionals. The functions ϕ i ( x ) serve as switching functions that take a value of 1 at their corresponding constraint and 0 at all others, while ρ i x , g ( x ) represent projection functionals that express constraints in terms of the free function. The theoretical foundations and properties of these components are detailed in [18,19,20] and utilized throughout this article without further derivation.
Since the original work in [17], TFC has been widely applied and extended across multiple domains. TFC has enhanced continuation methods [22] and contributed to areas such as indirect optimal control [23], representations of fractional operators [24,25], stiff chemical kinetics modeling [26], epidemiological modeling [27], and aerospace engineering [28,29,30,31,32]. Moreover, TFC has shown promising applications in nonlinear programming [33] and structural mechanics [34,35]. One of its most impactful implementations has been in neural networks [36], where it significantly improves accuracy and enables efficient solutions to high-dimensional problems. In particular, its integration with Physics-Informed Neural Networks (PINNs) [37] enhances computational efficiency by removing constraints from the optimization process, overcoming a key challenge in traditional neural networks [38].
Thus far, however, the development and application of TFC has progressed under the fundamental assumption that the function subject to constraints is C continuous. This assumption breaks down when discontinuities appear, so the efficacy of TFC deteriorates, as observed in [39]. Thus, a reconsideration of the theoretical framework is required to extend the application of TFC to discontinuous systems. Admittedly, such considerations were partially explored in [40], which demonstrates how TFC can solve boundary value problems (BVPs) in hybrid systems consisting of a sequence of linear or nonlinear ODEs that are of different orders or contain varying parameters. In contrast, the present study aims to tackle a different class of problems, which arise from physical and engineering applications where discontinuities originate from abrupt changes in terms within the differential equation that represent external stimuli or internal system parameters. The proposed method in [40] illustrates how an ODE can be effectively solved by partitioning the integration domain into multiple subdomains, provided the continuity conditions at the interfaces between successive subdomains are known a priori. This approach has proven to be particularly efficient in addressing stiff equations. While the hybrid TFC approach in [40] was not specifically applied to DDEs, such problems belong to the class of hybrid systems and can be readily achieved by introducing continuity variables as additional unknowns that are solved simultaneously with the unknown coefficients defining the free functions.
In contrast, the two methods presented in this work for solving discontinuous ODEs do not introduce any additional variables, constituting the primary distinction from the approach in [40]. This is accomplished either by coupling free functions associated with successive domains through the imposition of continuity constraints or by modifying the expressions of subsequent free functions such that continuity conditions are directly satisfied. To provide a simple exposition, this article focuses specifically on solving linear nonhomogeneous discontinuous ODEs with simple (i.e., step) discontinuities in the forcing function. The following presentation will first focus on the theoretical development of the proposed methods. Section 2.1 outlines the g-embedded hybrid system approach where continuity is directly embedded within the free function. Section 2.2 outlines the S-embedded hybrid system approach where continuity constraints are imposed by introducing additional support functions. The proposed methods are then implemented numerically in Section 3 for three case studies with known solutions, and this section is then followed by Section 4, which summarizes this present work and outlines future work.

2. Methods

2.1. g-Embedded Hybrid System Approach

As allowed within the TFC framework, the theoretical basis of this work emphasizes that the free function g ( x ) can be any function. Consequently, the proposed method constructs the free functional  g x , g 1 ( x ) , , g N ( x ) through a sequence of piecewise local free functions specifically formulated such that continuity constraints across the global domain are intrinsically satisfied. Unlike the hybrid method developed in [40], the proposed g-embedded approach in this section eliminates the need for introducing additional support or switching-projection functions to satisfy local continuity constraints and therefore does not introduce additional unknowns. Thus, the application of TFC to continuous and discontinuous systems is effectively identical.
To illustrate intrinsically satisfying continuity constraints, consider a field y ( x ) defined over the global domain Ω [ x 0 , x 2 ] , which is known to contain a simple C 2 discontinuity at the coordinate x 1 where x 0 < x 1 < x 2 . Assuming two boundary conditions are imposed on y ( x ) , the constrained functional is
y ^ x , g ( x ) = g ( x ) + ϕ 1 ( x ) κ 1 C 1 [ g ( x ) ] + ϕ 2 ( x ) κ 2 C 2 [ g ( x ) ] ,
where ϕ 1 ( x ) and ϕ 2 ( x ) are two globally continuous switching functions. Thus, the C 2 discontinuity in the constrained functional must be resolved within g ( x ) . This work proposes that two local free functions can be introduced such that g 1 : Ω 1 R and g 2 : Ω 2 R , where Ω 1 [ x 0 , x 1 ] and Ω 2 [ x 1 , x 2 ] . Thus, the free function g ( x ) is replaced by the free functional g x , g 1 ( x ) , g 2 ( x ) , in which the second derivative of the free functional, which includes a discontinuity at x = x 1 , can be expressed piecewise as
g x , g 1 ( x ) , g 2 ( x ) = g 1 ( x ) + H ( Δ x 1 ) g 2 ( x ) g 1 ( x ) ,
where Δ x 1 : = x x 1 and H ( · ) is the Heaviside function. As derived in Appendix C, integrating Equation (2) over the global domain Ω yields
g x , g 1 ( x ) , g 2 ( x ) = g 1 ( x ) g 1 ( x 0 ) + H ( Δ x 1 ) Δ g ( x ) Δ g ( x 1 ) ,
where Δ g ( x ) : = g 2 ( x ) g 1 ( x ) , and Δ g ( x 1 ) : = Δ g ( x ) | x = x 1 . Notice that lim ε 0 g ( x 1 ε ) = g 1 ( x 1 ) g 1 ( x 0 ) and lim ε 0 g ( x 1 + ε ) = g 1 ( x 1 ) g 1 ( x 0 ) , so global C 1 -continuity is directly embedded into the free functional as shown in Figure 1. Integrating Equation (3) yields the following free functional:
g x , g 1 ( x ) , g 2 ( x ) = g 1 ( x ) g 1 ( x 0 ) x x 0 g 1 ( x 0 ) + + H ( Δ x 1 ) Δ g ( x ) Δ g ( x 1 ) Δ x 1 Δ g ( x 1 ) ,
which is necessarily continuous according to the first fundamental theorem of calculus.
As outlined for general cases in Appendix C, Equations (2)–(4) can be conveniently split into two terms such that,
D i g ( x , g 1 ( x ) , g 2 ( x ) ) = D i p 1 ( x , g 1 ( x ) ) + D i p 2 ( x , g 2 ( x ) ) ,
where D i : = d i / d x i is the differential operator and the functionals p 1 x , g 1 ( x ) and p 2 x , g 2 ( x ) depend only on g 1 ( x ) and g 2 ( x ) , respectively. In this case, D i [ p j ( x , g j ( x ) ) ] i = 0 , 1 , 2 can be expressed as
p 1 ( x , g 1 ( x ) ) = g 1 ( x ) H ( x x 0 ) H ( x x 1 ) , p 2 ( x , g 2 ( x ) ) = g 2 ( x ) H ( x x 1 ) H ( x x 2 ) , p 1 ( x , g 1 ( x ) ) = g 1 ( x ) g 1 ( x 0 ) H ( x x 0 ) g 1 ( x ) g 1 ( x 1 ) H ( x x 1 ) , p 2 ( x , g 2 ( x ) ) = g 2 ( x ) g 2 ( x 1 ) H ( x x 1 ) g 2 ( x ) g 2 ( x 2 ) H ( x x 2 ) , p 1 ( x , g 1 ( x ) ) = g 1 ( x ) g 1 ( x 0 ) ( x x 0 ) g 1 ( x 0 ) H ( x x 0 ) g 1 ( x ) g 1 ( x 1 ) ( x x 1 ) g 1 ( x 1 ) H ( x x 1 ) , p 2 ( x , g 2 ( x ) ) = g 2 ( x ) g 2 ( x 1 ) ( x x 1 ) g 2 ( x 1 ) H ( x x 1 ) g 2 ( x ) g 2 ( x 2 ) ( x x 2 ) g 2 ( x 2 ) H ( x x 2 ) ,
which reveals a clear algebraic structure that is generalized for N 1 simple C r discontinuities in Equation (A11). Note that this work uses the convention H ( 0 ) = 1 . As demonstrated in Equation (6), the p j x , g j ( x ) functional describes the contribution of the jth local free function g j ( x ) to the global free functional.

Application to Univariate Linear Discontinuous ODEs

Consider the linear differential operator L ,
L [ y ( x ) ] : = i = 0 n α i ( x ) D i [ y ( x ) ] ,
where the α i ( x ) are known functions on the 1-dimensional domain x Ω . The response of the field y ( x ) subject to a forcing field f ( x ) is governed by the linear differential equation
L [ y ( x ) ] = f ( x ) ,
and satisfies n linear constraints,
C i [ y ( x ) ] = κ i ; i = 1 , , n .
In the case of a step-change in f ( x ) at x j j = 1 , , N 1 , the field y ( x ) also satisfies the continuity constraints,
lim ε 0 D r [ y ( x ε ) ] | x = x j = lim ε 0 D r [ y ( x + ε ) ] | x = x j ; 0 r < n 1 .
Using the switching-projection formulation [20], the unknown field y ( x ) can be expressed as the constrained functional
y ^ ( x , g 1 ( x ) , , g N ( x ) ) = g ( x , g 1 ( x ) , , g N ( x ) ) + i = 1 n ϕ i ( x ) κ i C i [ g ( x , g 1 ( x ) , , g N ( x ) ) ] ,
where all ϕ i ( x ) are formulated to directly satisfy the n linear constraints in Equation (9). As previously demonstrated, the free functional can be expressed as the sum of p j ( x , g j ( x ) ) -functionals,
g x , g 1 ( x ) , , g N ( x ) = j = 1 N p j x , g j ( x ) ,
where g j ( x ) : Ω j R is the local free function that is C continuous in the subdomain Ω j : = x j 1 , x j and Ω = Ω 1 Ω 2 Ω N . Since the p j x , g j ( x ) -functionals are defined such that their summation intrinsically satisfies the n ( N 1 ) continuity constraints in Equation (10), the constrained ODE in Equations (8)–(10) can be rewritten as an unconstrained ODE in terms of the constrained functional as
j = 1 N L p j x , g j ( x ) + i = 1 n L ϕ i ( x ) κ i C i g x , g 1 ( x ) , , g N ( x ) = f ( x ) .
Without loss of generality, let each local free function be chosen as a linear combination of m n + 1 Legendre orthogonal polynomials such that,
g j ( x ) = k = n m + 1 ζ j , k L k z ( x ) ; x Ω j ,
where m is the maximum polynomial degree, and each subdomain is mapped to the interval z [ 1 , 1 ] by the transformation
z ( x ) = 2 x x j 1 x j x j 1 1 .
Thus, the final linear system of equations is of the form
A ( x ) B ( x ) ζ = f ( x ) R ( x ) ,
where ζ T = ζ 1 T , ζ 2 T , , ζ N T , A ( x ) comes from the functional (i.e., p j ) terms, B ( x ) comes from the constraint operator (i.e., C i ) terms, and R ( x ) comes from the constraint value (i.e., κ i ) terms. Note that according to the TFC framework as applied to optimization problems, the basis functions used to construct the switching functions must be linearly independent of the functions employed to represent the free function [20]. Consequently, when adopting a polynomial basis for the free function, such as the Legendre orthogonal polynomials, and selecting { 1 , x } as the basis for the switching functions, the first two Legendre polynomials must be excluded from the expansion of the free function to ensure the required linear independence. Additionally, the A matrix is structured as a lower block triangular matrix because the integration scheme that enforces continuity couples the local free function of a particular subdomain to the local free functions of the preceding subdomains. At this point, the unknown field y ( x ) has been represented by the constrained functional y ^ x , g 1 ( x ) , , g N ( x ) , where the function space of g ( x , g 1 ( x ) , , g N ( x ) ) has been constrained to a sequence of piecewise Legendre polynomials that directly embed continuity constraints. With this form, a constrained linear DDE is approximated as an algebraic linear system of equations where the unknown coefficients ζ can be solved numerically via linear least squares.

2.2. S-Embedded Hybrid System Approach

In this section, the proposed S-embedded method modifies the original hybrid approach in [40] to avoid introducing additional unknown variables that enforce continuity and is applied to linear DDEs. Unlike the g-embedded approach developed in Section 2.1, the S-embedded method models a univariate field by a piecewise sequence of constrained functionals and all constraints—both boundary and continuity—are satisfied analytically in a classical TFC fashion using the η -formulation. Thus, continuity is satisfied within a set of weighted support functions, as opposed to the free function. The advantage of this approach over the g-embedded method is that continuity conditions involving weighted field values and derivatives are more easily resolved.
To facilitate the development of the S-embedded method, consider the second-order BVP, as follows:
y ( 1 ) = y 0 and y ( 8 ) = y f ,
with a domain x [ 1 , 8 ] containing three simple discontinuities occurring at x 1 = 2 , x 2 = 3 , and x 3 = 5 . The field y ( x ) is modeled using four piecewise constrained functionals with s 1 ( x ) = 1 and s 2 ( x ) = x selected as the support functions such that
y ^ x , g 1 ( x ) , , g 4 ( x ) = y ^ 1 x , g ( x ) = g 1 ( x ) + η 1 , 1 + η 1 , 2 x ; 1 x 2 , y ^ 2 x , g ( x ) = g 2 ( x ) + η 2 , 1 + η 2 , 2 x ; 2 x 3 , y ^ 3 x , g ( x ) = g 3 ( x ) + η 3 , 1 + η 3 , 2 x ; 3 x 5 , y ^ 4 x , g ( x ) = g 4 ( x ) + η 4 , 1 + η 4 , 2 x ; 5 x 8 ,
where the free functional g x , g 1 ( x ) , , g N ( x ) is now denoted as g ( x ) for brevity of notation in the remainder of this manuscript. Assuming global continuity of the field and its derivative, the continuity conditions are satisfied by enforcing
D r y ^ j x , g j ( x ) y ^ j + 1 x , g j + 1 ( x ) | x = x j = 0 ; j = 1 , 2 , 3 r = 0 , 1 .
From Equations (17)–(19), the following linear system of 8 equations and 8 unknowns (i.e., η j , i ) can be constructed, as follows:
[ 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 8 1 2 1 2 0 0 0 0 0 1 0 1 0 0 0 0 0 0 1 3 1 3 0 0 0 0 1 0 1 0 0 0 0 0 0 1 5 1 5 0 0 0 0 0 0 1 0 1 ] { η 11 η 12 η 21 η 22 η 31 η 32 η 41 η 42 } = { y 0 g 1 ( x 0 ) y f g 4 ( x 4 ) g 2 ( x 1 ) g 1 ( x 1 ) g 2 ( x 1 ) g 1 ( x 1 ) g 3 ( x 2 ) g 2 ( x 2 ) g 3 ( x 2 ) g 2 ( x 2 ) g 4 ( x 3 ) g 3 ( x 3 ) g 4 ( x 3 ) g 3 ( x 3 ) } ,
where the first two equations correspond to the boundary constraints, and the latter correspond to the continuity constraints.
Thus, the coefficient functionals η j , i ( x , g ( x ) ) can be resolved as a linear combination of the local free functions such that Equation (18) satisfies the boundary and continuity constraints for any g j ( x ) , as shown in Figure 2.
Leveraging the notation developed in Section 2.1, this approach can be generalized for nth-order systems with N 1 simple C r discontinuities. Let the constrained functional be expressed as a piecewise sequence of local constrained functionals using the following η -formulation:
y ^ ( x , g ( x ) ) = y ^ 1 ( x , g ( x ) ) = g 1 ( x ) + i = 1 n η 1 , i x , g ( x ) s 1 , i ( x ) ; x Ω 1 , y ^ N ( x , g ( x ) ) = g N ( x ) + i = 1 n η N , i x , g ( x ) s N , i ( x ) ; x Ω N ,
where, unlike Equation (12), the free functional g ( x , g 1 ( x ) , , g N ( x ) ) bears a simple piecewise form of
g x , g 1 ( x ) , , g N ( x ) = g 1 ( x ) ; x Ω 1 , g N ( x ) ; x Ω N .
To distinguish between continuity and boundary value constraints, continuity constraints are denoted as
R j , r y ( x ) = 0 ; j = 1 , , N 1 r = 0 , , n 1 ,
where the continuity constraint operator is defined as
R j , r [ y ( x ) ] : = lim ε 0 ω ( x ε ) D r [ y ( x ε ) ] | x = x j lim ε 0 ω ( x + ε ) D r [ y ( x + ε ) ] | x = x j .
Without loss of generality, the weighting field is assumed to have a piecewise form ω ( x ) = ω x , ω 1 ( x ) , , ω N ( x ) , similar to the free functional in Equation (22). Thus, the proposed S-embedded approach implements the n ( N 1 ) continuity constraints as follows:
R j , r [ y ^ ( x , g ( x ) ) ] = ω j ( x j ) D r [ y ^ j ( x j ) ] ω j + 1 ( x j ) D r [ y ^ j + 1 ( x j ) ] = ω j ( x j ) D r [ g j ( x j ) ] ω j + 1 ( x j ) D r [ g j + 1 ( x j ) ] + i = 1 n ω j ( x j ) η j , i D r [ s j , i ( x j ) ] ω j + 1 ( x j ) η j + 1 , i D r [ s j + 1 , i ( x j ) ] ,
where D r [ f ( x j ) ] : = D r [ f ( x ) ] | x = x j . The linear system of equations from which the coefficient functionals are resolved in terms of the local free functions is expressed as follows:
C [ s 1 T ( x ) ] , , C [ s N T ( x ) ] R [ s 1 T ( x ) ] , , R [ s N T ( x ) ] η 1 η N = κ 0 C [ g ( x ) ] R [ g ( x ) ] ,
where the first n equations correspond to the boundary constraints, and the remainder correspond to the n ( N 1 ) continuity constraints. Note that s j T ( x ) = { s j , 1 ( x ) , , s j , n ( x ) } denotes the set of n linearly independent support functions in the jth constrained functional, η j T = { η j , 1 , , η j , n } , and κ T = { κ 1 , , κ n } (cf. Equation (9)). Additionally, the vectorized constraint operators are of the form
C T = { C 1 , , C n } , R T = { R 1 , 1 , , R 1 , n , , R N 1 , 1 , , R N 1 , n } .
The coefficient functionals can be expressed in terms of the local free functions as
η ( x , g ( x ) ) = S 1 κ C [ g ( x ) ] 0 R [ g ( x ) ] ,
where S (i.e., the support matrix) is the coefficient matrix in Equation (26). Using Equation (28), the local constrained functionals in Equation (21) can be rewritten as
y ^ j ( x , g ( x ) ) = g j ( x ) + s j T ( x ) S j 1 κ C [ g ( x ) ] 0 R [ g ( x ) ] ; x Ω j ,
where S j 1 is the submatrix of S 1 corresponding to η j ( x , g ( x ) ) . As previously demonstrated, Equation (29) intrinsically satisfies the n boundary and n ( N 1 ) continuity constraints for any g j ( x ) .

Application to Univariate Linear Discontinuous ODEs

Similar to Section Application to Univariate Linear Discontinuous ODEs, consider again the linear DDE in Equation (8) subject to n linear boundary constraints and n ( N 1 ) continuity constraints enforced due to a step-change in f ( x )  or the coefficients α i ( x ) (cf. Equation (7)) at x j j = 1 , , N 1 . Note that only simple discontinuities in the forcing term f ( x ) will be considered in the subsequent numerical case studies. Over the subdomain Ω j , the constrained ODE in Equations (8), (9) and (23) can be rewritten as an unconstrained ODE in terms of the jth local constrained functional as
L [ g j ( x ) ] L [ s j T ( x ) ] S j 1 C [ g ( x ) ] R [ g ( x ) ] = f ( x ) L [ s j T ( x ) ] S j 1 κ 0 ; x Ω j .
Assuming the local free functions are a weighted sum of Legendre polynomials as in Section Application to Univariate Linear Discontinuous ODEs, the final system of equations is
A 1 ( x ) B 1 ( x ) A j ( x ) B j ( x ) A N ( x ) B N ( x ) ζ 1 ζ j ζ N = f ( x ) R 1 ( x ) R j ( x ) R N ( x ) ,
where
A j ( x ) = L [ L j T ( x ) ] , B j ( x ) = L [ s j T ( x ) ] S j 1 C [ L 1 T ( x ) ] , , C [ L N T ( x ) ] R [ L 1 T ( x ) ] , , R [ L N T ( x ) ] , R j ( x ) = L [ s j T ( x ) ] S j 1 κ 0 ; x Ω j .
Additionally, the A matrix here is structured as a block diagonal matrix (as opposed to a lower block triangular matrix) because the local free functions are decoupled. At this point, the unknown field y ( x ) has been represented by a piecewise sequence of constrained functionals y ^ j ( x , g ( x ) ) , each defined over the subdomain Ω j to allow for the introduction of additional support functions to enforce continuity. Again, a constrained linear DDE is approximated as an algebraic system of equations where the unknown coefficients ζ can be solved numerically via linear least squares.

3. Results

The proposed g-embedded and S-embedded hybrid system approaches derived in Section 2.1 and Section 2.2, respectively, will now be applied numerically to solve linear DDEs with known solutions and regular constraints. Note that irregular constraints (e.g., integral and linear combinations) are easily incorporated within the TFC framework as studied in prior work [20,21], so they are omitted from the simple studies presented. The first case study is a second-order IVP with a single simple discontinuity, and the second case study converts this problem to an equivalent BVP. The third and final case study is a generic third-order BVP with two simple discontinuities whose solution cannot be obtained using traditional Laplace transform techniques. Since the S-embedded method employs the same classical TFC process applied over a partitioned domain and a simple example derivation is provided in Section 2.2, only the system of equations for the g-embedded method are derived in the first two case studies, and the S-embedded results are only shown for the more complex third-order BVP for conciseness. Finally, the local free functions in each case study are restricted to the same set of m n + 1 Legendre orthogonal polynomials, where m is the maximum degree polynomial (see Equation (14)), and the global domain is discretized using a total of 100   N Chebyshev–Gauss–Lobatto (CGL) points that are distributed proportionally to the relative size of each subdomain (see Appendix B).

3.1. Case 1: Second-Order IVP with a Single Discontinuity

The second-order ODE with constant coefficients is
y + 3 y + 2 y = H ( 1 x ) ; x [ 0 , 2 ] ,
subject to the initial conditions
C 1 [ y ( x ) ] : = y ( 0 ) = 0 , C 2 [ y ( x ) ] : = y ( 0 ) = 0 ,
and the continuity constraints
lim ε 0 y ( 1 ε ) = lim ε 0 y ( 1 + ε ) and lim ε 0 y ( 1 ε ) = lim ε 0 y ( 1 + ε ) .
The analytical solution of this linear IVP, obtained using the Laplace transform and reported in Appendix A, is
y ( x ) = 1 2 ( 1 + e 2 x ) e x 1 2 e ( x 1 ) + 1 2 e 2 ( x 1 ) H ( x 1 ) , y ( x ) = e 2 x + e x e ( x 1 ) e 2 ( x 1 ) H ( x 1 ) , y ( x ) = 2 e 2 x e x e ( x 1 ) + 2 e 2 ( x 1 ) H ( x 1 ) .
and is shown in Figure 3.
Using Equation (11), the generic TFC-constrained functional for a second-order IVP is
y ^ x , g ( x ) = g ( x ) + κ 1 g ( x 0 ) + ( x x 0 ) κ 2 g ( x 0 ) , y ^ x , g ( x ) = g ( x ) + κ 2 g ( x 0 ) , y ^ x , g ( x ) = g ( x ) .
where ϕ 1 ( x ) = 1 , and ϕ 2 ( x ) = x x 0 . Using these expressions with Equation (13) and substituting the constraint values in Equation (34) in addition to x 0 = 0 , the constrained differential equation in Equations (33)–(35) is converted to the unconstrained differential equation,
g + 3 g + 2 g 3 g ( 0 ) + 2 g ( 0 ) + x g ( 0 ) = H ( 1 x ) ,
where the expressions of g ( x ) , g ( x ) , and g ( x ) are provided by Equations (2), (3) and (4), respectively. The system of equations in Equation (16) can be expressed as
A 1 ( x ) , A 2 ( x ) ζ 1 , ζ 2 B 1 ( x ) , B 2 ( x ) ζ 1 ζ 2 = H ( 1 x ) ,
where A j T ( x ) = p j ( x , L ( x ) ) + 3 p j ( x , L ( x ) ) + 2 p j ( x , L ( x ) ) and,
p 1 ( x , L ( x ) ) = L ( x ) L ( 0 ) x L ( 0 ) + H ( x 1 ) L ( x ) + L ( 1 ) + ( x 1 ) L ( 1 ) , p 2 ( x , L ( x ) ) = H ( x 1 ) L ( x ) L ( 1 ) ( x 1 ) L ( 1 ) .
In this case, the B ( x ) matrix terms are zero. After discretizing each subdomain into the set of CGL points x 1 = { x : 0 x 1 } and x 2 = { x : 1 x 2 } , the resulting algebraic system of equations with 2 ( m 1 ) unknowns is
A 1 ( x 1 ) , A 2 ( x 1 ) A 1 ( x 2 ) , A 2 ( x 2 ) ζ 1 ζ 2 = 1 0 ,
where
A 1 T ( x 1 ) = L ( x 1 ) + 3 L ( x 1 ) + 2 L ( x 1 ) , A 2 T ( x 1 ) = 0 , A 1 T ( x 2 ) = 3 L ( 1 ) + 2 L ( 1 ) + ( x 2 1 ) L ( 1 ) , A 2 T ( x 2 ) = L ( x 2 ) + 3 L ( x 2 ) L ( 1 ) + 2 L ( x 2 ) L ( 1 ) ( x 2 1 ) L ( 1 ) .
After removing equations corresponding to x = 1 , the least-squares problem of Equation (41) can be solved and, the constrained expression approximating the true field can be constructed using Equations (12), (37) and (40). The numerical results are presented in Figure 4 for m = 2 , , 15 , which consist of (a) the error distributions of y ( x ) y ^ ( x ) ), y ( x ) y ^ ( x ) ), and y ( x ) y ^ ( x ) ), (b) the L 2 -norm of the error vectors y ^ ( x ) y ( x ) , y ^ ( x ) y ( x ) , and y ^ ( x ) y ( x ) with respect to the number of basis functions, (c) the L 2 -norm of the residual obtained by substituting the solution estimate and derivatives into the differential equation with respect to the number of basis functions, and (d) the condition number of the matrix inverted within the QR algorithm, derived from the least-squares matrix A B , with respect to the number of basis functions. The results show that the error values approach machine precision as the number of basis functions increases and that the proposed method is numerically robust as demonstrated by the small condition numbers.

3.2. Case 2: Second-Order BVP with a Single Discontinuity

The differential equation presented in Equation (33) is now evaluated as a BVP using the same initial value adopted in the IVP test (i.e., y ( 0 ) = 0 ), while the analytical solution determines the final value,
C 2 [ y ( x ) ] : = y ( 2 ) κ 2 = 1 2 e 4 e 2 + e 1 1 2 e 2 0.174 .
The generic TFC-constrained functional and its derivatives that always satisfy this BVP are
y ^ x , g ( x ) = g ( x ) + ϕ 1 ( x ) κ 1 g ( x 0 ) + ϕ 2 ( x ) κ 2 g ( x f ) , y ^ x , g ( x ) = g ( x ) + ϕ 1 κ 1 g ( x 0 ) + ϕ 2 κ 2 g ( x f ) , y ^ x , g ( x ) = g ( x ) .
where
ϕ 1 ( x ) = x x f x 0 x f , ϕ 2 ( x ) = x x 0 x f x 0 , ϕ 1 = 1 x 0 x f , and ϕ 2 = 1 x f x 0 .
Using the expressions of Equation (43) and substituting x 0 = 0 and x f = 2 , the differential equation becomes
g + 3 g + 2 g 3 ϕ 1 g ( 0 ) + ϕ 2 g ( 2 ) 2 ϕ 1 g ( 0 ) + ϕ 2 g ( 2 ) = H ( 1 x ) 3 ϕ 2 + 2 ϕ 2 κ 2 .
Notice that the only differences between the IVP and BVP unconstrained ODEs in Equation (38) and Equation (45), respectively, exist in the constraint-related terms. Thus, the A ( x ) matrix for the BVP is identical to that of the IVP in Equation (42), while B ( x ) is modified to
B 1 T ( x ) = 3 ϕ 2 + 2 ϕ 2 L ( 1 ) + L ( 1 ) L ( 0 ) 2 L ( 0 ) , B 2 T ( x ) = 3 ϕ 2 + 2 ϕ 2 L ( 2 ) L ( 1 ) L ( 1 ) .
Furthermore, since κ 2 is non-zero there is an additional forcing term,
R ( x ) = 3 ϕ 2 + 2 ϕ 2 κ 2 ,
which must be accounted for (see Equation (16)). By combining Equations (42), (46) and (47) along with the same choice of basis functions and domain discretization in Section 3.1, the resulting algebraic system of equations with 2 ( m 1 ) unknowns is
A 1 ( x 1 ) B 1 ( x 1 ) , 0 A 1 ( x 2 ) B 1 ( x 2 ) , A 2 ( x 2 ) B 2 ( x 2 ) ζ 1 ζ 2 = 1 0 3 ϕ 2 + 2 ϕ 2 ( x 1 ) 3 ϕ 2 + 2 ϕ 2 ( x 2 ) κ 2 .
Again, after removing equations corresponding to x = 1 , the least-squares problem of Equation (48) can be solved, and the constrained expression approximating the true field can be constructed using Equations (12), (40) and (43). The numerical results are presented in Figure 5 and are nearly identical to the IVP results. Additionally, a comparison with a standard central difference method is provided in Appendix D.

3.3. Case 3: Third-Order BVP with Two Discontinuities

Finally, consider the generic third-order linear DDE with non-constant coefficients,
α 3 ( x ) y + α 2 ( x ) y + α 1 ( x ) y + α 0 ( x ) y = f 1 ( x ) + j = 1 N 1 H ( x x j ) f j + 1 ( x ) f j ( x ) ,
subject to the boundary constraints,
y ( x 0 ) = κ 1 , y ( x 0 ) = κ 2 , and y ( x f ) = κ 3 .
An ODE of this form can be constructed with a known solution by specifying a piecewise continuous y ( x ) such that
y ( x ) = v 1 ( x ) + j = 1 N 1 H ( x x j ) v j + 1 ( x ) v j ( x ) ,
where v j ( x ) are arbitrary functions that are continuous over their respective subdomains Ω j [ x j 1 , x j ] . By integrating y ( x ) to obtain D r [ y ] 0 r < 3 and specifying the coefficients α i ( x ) , the corresponding forcing field in Equation (49) and boundary conditions in Equation (50) are obtained. Consider the case shown in Figure 6 with two simple C 3 -discontinuities where the arbitrary v j ( x ) functions are chosen, such that
y ( x ) = x + cos ( 2 π x ) ; x [ 0 , 1 ] , e x ; x [ 1 , 2 ] , sin ( π x ) ; x [ 2 , 4 ] ,
and the coefficients α i ( x ) are chosen as
α 0 ( x ) = e 1 4 x 2 , α 1 ( x ) = sin ( x 2 ) , α 2 ( x ) = ln ( x + 1 ) , α 3 ( x ) = 1 .
The six continuity constraints are
lim ε 0 D r y ( 1 ε ) = lim ε 0 D r y ( 1 + ε ) and lim ε 0 D r y ( 2 ε ) = lim ε 0 D r y ( 2 + ε ) ,
for r = 0 , 1 , and 2 . Note that the choice of the coefficient functions in Equation (53) is not arbitrary. The Laplace transform of the function α 0 ( x ) and α 2 ( x ) is unknown, while the Laplace transform of sin ( x 2 ) is particularly complex and expressed in terms of the Gamma function. In other words, this differential equation is not well-suited to being solved using the Laplace transform.

3.3.1. g-Embedded Implementation

The constrained functional for this third-order ODE using the g-embedded method is
y ^ x , g ( x ) = g ( x ) + ϕ 1 ( x ) [ κ 1 g ( 0 ) ] + ϕ 2 ( x ) κ 2 g ( 0 ) + ϕ 3 ( x ) κ 3 g ( 4 ) ,
where
ϕ 1 ( x ) = 1 x 2 16 , ϕ 2 ( x ) = x x 2 4 , and ϕ 3 ( x ) = x 2 16 .
Following the same procedure outlined in the preceding sections, the algebraic system of equations with 3 ( m 2 ) unknowns is of the form
A 1 ( x 1 ) B 1 ( x 1 ) , B 2 ( x 1 ) , B 3 ( x 1 ) A 1 ( x 2 ) B 1 ( x 2 ) , A 2 ( x 2 ) B 2 ( x 2 ) , B 3 ( x 2 ) A 1 ( x 3 ) B 1 ( x 3 ) , A 2 ( x 3 ) B 2 ( x 3 ) , A 3 ( x 3 ) B 3 ( x 3 ) ζ 1 ζ 2 ζ 3 = f x 1 R x 1 f x 2 R x 2 f x 3 R x 3 ,
where x 1 = { x : 0 x 1 } , x 2 = { x : 1 x 2 } , and x 3 = { x : 2 x 4 } are the sets of discretized CGL points. The numerical results are presented in Figure 7 for m = 4 , , 21 .

3.3.2. S-Embedded Implementation

The constrained functional for this third-order ODE using the S-embedded method is
y ^ x , g 1 ( x ) , g 2 ( x ) , g 3 ( x ) = g 1 ( x ) + η 1 , 1 + η 1 , 2 x + η 1 , 3 x 2 ; 0 x 1 , g 2 ( x ) + η 2 , 1 + η 2 , 2 x + η 2 , 3 x 2 ; 1 x 2 , g 3 ( x ) + η 3 , 1 + η 3 , 2 x + η 3 , 3 x 2 ; 2 x 4 ,
where the support functions are selected as η j , 1 = 1 , η j , 1 = x , and η j , 1 = x 2 for all three local constrained functionals. By evaluating the three boundary constraints in Equation (50) and the six continuity constraints in Equation (54), the following system of equations can be formed:
[ 1 x 0 x 0 2 0 0 0 0 0 0 0 1 2 x 0 0 0 0 0 0 0 0 0 0 0 0 0 1 x 3 x 3 2 1 x 1 x 1 2 1 x 1 x 1 2 0 0 0 0 1 2 x 1 0 1 2 x 1 0 0 0 0 0 2 0 0 2 0 0 0 0 0 0 1 x 2 x 2 2 1 x 2 x 2 2 0 0 0 0 1 2 x 2 0 1 2 x 2 0 0 0 0 0 2 0 0 2 ] { η 1 , 1 η 1 , 2 η 1 , 3 η 2 , 1 η 2 , 2 η 2 , 3 η 3 , 1 η 3 , 2 η 3 , 3 } = { y 0 g 1 ( x 0 ) y 0 g 1 ( x 0 ) y f g 3 ( x 3 ) g 2 ( x 1 ) g 1 ( x 1 ) g 2 ( x 1 ) g 1 ( x 1 ) g 2 ( x 1 ) g 1 ( x 1 ) g 3 ( x 2 ) g 2 ( x 2 ) g 3 ( x 2 ) g 2 ( x 2 ) g 3 ( x 2 ) g 2 ( x 2 ) } ,
where x 0 = 0 , x 1 = 1 , x 2 = 2 , and x 3 = 4 . The coefficient functionals can then be obtained in terms of the boundary constraint values and the local free functions, which are then substituted into Equation (58). The typical TFC process of substituting Equation (58) into the differential equation can then be conducted over each subdomain to form the following system of equations:
A 1 ( x 1 ) B 1 ( x 1 ) , B 2 ( x 1 ) , B 3 ( x 1 ) B 1 ( x 2 ) , A 2 ( x 2 ) B 2 ( x 2 ) , B 3 ( x 2 ) B 1 ( x 3 ) , B 2 ( x 3 ) , A 3 ( x 3 ) B 3 ( x 3 ) ζ 1 ζ 2 ζ 3 = f x 1 R x 1 f x 2 R x 2 f x 3 R x 3 .
The numerical results are shown in Figure 8, and the error again approaches machine error as the number of basis functions increases.

4. Discussion

This study introduces two novel numerical methodologies for solving linear nonhomogeneous ODEs of arbitrary order that are subject to simple discontinuities in the forcing function. The approaches are based on the Theory of Functional Connections (TFC), a mathematical framework for embedding constraints into functional representations. The proposed techniques are distinguished by their ability to incorporate discontinuities directly into the structure of the constrained functional either through the free function (i.e., the g-embedded approach) or a set of weighted support functions (i.e., the S-embedded approach), thereby eliminating the need for auxiliary variables that are often employed in conventional methods. Additionally, linearity of the final algebraic system of equations is preserved, provided the original differential equation is linear. Both approaches preserve the fundamental advantage of TFC—transforming constrained differential problems into equivalent unconstrained representations, thereby simplifying the solution process while maintaining analytical precision.
The efficacy of the methods has been evaluated through their application to both initial and boundary value problems for which analytical solutions are known. Numerical experiments confirm that the methods achieve exceptionally high accuracy with error levels approaching machine precision, even in scenarios involving multiple discontinuities and variable coefficients for which no closed-form Laplace transform solutions are available. While the numerical performance of the g-embedded and S-embedded methods are effectively identical, these authors are of the opinion that the g-embedded method is easier to implement, particularly because of its reliance on the switching-projection formulation, and no additional support functions are introduced to resolve the continuity constraints. However, the S-embedded method is expected to more efficiently resolve continuity constraints involving fields and field derivatives that are weighted where, at least within mechanics, the weighting fields represent internal system parameters (e.g., material properties). Nevertheless, both proposed approaches to solving linear nonhomogeneous DDEs exhibit simplicity, robustness, and precision that position them as compelling alternatives to classical numerical techniques. Furthermore, their versatility and ease of implementation suggest promising potential for widespread adoption in various physical and engineering applications.
Beyond application to structural and thermal systems characterized by discontinuities, future research will focus on extending TFC to encompass stiff, nonlinear, and partial DDEs. Such extensions are of particular importance for modeling impact dynamics. These problems typically involve a jump discontinuity in velocity and can be easily resolved for 1-D problems using the present framework (i.e., r = 1 ), although higher-dimension problems (e.g., 1-D spatial and temporal discontinuities) present the difficult task of embedding discontinuities into higher-dimension functionals. Challenges also arise using the present framework in cases where the time(s) of one or more impact events is unknown, which necessitates an adaptive free functional whose discretization into piecewise local free functions can be updated. Additionally, the performance exhibited within the numerical studies requires support of formal convergence proofs, error estimations, and cost analysis. Though out of the scope of the present work, such investigations will be particularly important for comparing against current state-of-the-art methods and defining the mathematical boundaries of this emerging technique. Finally, the integration of this methodology with machine learning approaches, particularly within the scope of Physics-Informed Neural Networks (PINNs), will be explored. Such advancements are expected to substantially broaden the applicability of TFC-based techniques that enhance their role in addressing complex problems in modern computational science and engineering.

Author Contributions

Conceptualization, T.W. and D.M.; methodology, T.W. and D.M.; software, T.W.; validation, T.W.; writing—original draft preparation, T.W. and D.M.; writing—review and editing, T.W. and D.M.; visualization, T.W.; project administration, D.M. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Conflicts of Interest

The authors declare no conflicts of interest.

Abbreviations

The following abbreviations are used in this manuscript:
TFCTheory of Functional Connections
ODEOrdinary differential equation
DDEDiscontinuous differential equation

Appendix A

The IVP problem given in Equation (33), subject to y ( 0 ) = 0 and y ( 0 ) = 0 , is here solved in a closed form. The Laplace transform of Equation (33) gives
L { y } = s 2 Y ( s ) s y ( 0 ) y ( 0 ) , L { y } = s Y ( s ) y ( 0 ) , L { y } = Y ( s ) , L { H ( 1 x ) } = 1 s e s s .
Substituting y ( 0 ) = 0 and y ( 0 ) = 0 , the equation gives
Y ( s ) s 2 + 3 s + 2 = 1 s e s s .
Since s 2 + 3 s + 2 = ( s + 1 ) ( s + 2 ) ,
Y ( s ) = 1 s ( s + 1 ) ( s + 2 ) e s s ( s + 1 ) ( s + 2 ) .
The first term of Equation (A1) can be decomposed as
1 s ( s + 1 ) ( s + 2 ) = A s + B s + 1 + C s + 2 .
giving, A = 1 / 2 , B = 1 , and C = 1 / 2 . Thus,
1 s ( s + 1 ) ( s + 2 ) = 1 / 2 s 1 s + 1 + 1 / 2 s + 2 .
The second term of Equation (A1) can be written as
e s s ( s + 1 ) ( s + 2 ) = e s 1 / 2 s 1 s + 1 + 1 / 2 s + 2 .
The inverse Laplace Transform gives
L 1 1 s = 1 , L 1 1 s + a = e a t , and L 1 c e s s + a = c e a ( x 1 ) H ( x 1 ) .
Specifically, for Equation (A2),
L 1 1 s ( s + 1 ) ( s + 2 ) = 1 2 ( 1 + e 2 x ) e x .
and for Equation (A3),
L 1 e s s ( s + 1 ) ( s + 2 ) = 1 2 e ( x 1 ) + 1 2 e 2 ( x 1 ) H ( x 1 ) .
Combining these results, the solution of Equation (33) and its first and second derivatives are given in Equation (36).

Appendix B

The non-uniformly spaced Chebyshev–Gauss–Lobatto (CGL) point distribution is particularly useful for spectral methods and polynomial approximations because it achieves spectral accuracy, which means the error decreases exponentially for smooth problems due to spectral convergence and provides reduced computational effort compared to uniform grids for the same level of accuracy. CGL point distributions are applied to solve boundary value problems and approximate functions in spectral methods with reduced interpolation errors in polynomial approximations. CGL points are defined on the interval [ 1 , 1 ] , and the point sequence is given by
x k = cos k π M , k = 0 , 1 , , M .
These points cluster near the endpoints to minimize approximation errors (Runge’s phenomenon). In this work, a global domain is partitioned into subdomains according to the known locations of discontinuities, and the number of points assigned to each subdomain is proportional to its width. This ensures a balanced distribution of points within each interval. Figure A1 illustrates the point distribution using this technique for a Fibonacci sequence of the discontinuities in the [ 1 , 13 ] domain.
Figure A1. Histogram of 10,000 CGL points for the Fibonacci sequence.
Figure A1. Histogram of 10,000 CGL points for the Fibonacci sequence.
Mathematics 13 02785 g0a1

Appendix C

Consider a function g ( x ) defined over the global domain Ω [ x 0 , x N ] that contains a set of N 1   C r -discontinuities of the first kind at x = x j j = 1 , , N 1 . The ( r i ) th derivative of g ( x ) can be represented as
D r i [ g ( x ) ] = j = 1 N D r i [ p j ( x ) ] ; 0 i r ,
where
D r [ p j ( x ) ] = H ( x x j 1 ) H ( x x j ) D r [ g j ( x ) ] ,
and g j ( x ) : Ω j R is a local function defined over the subdomain Ω j = [ x j 1 , x j ] . The ( r 1 ) th derivative of p j ( x ) is
D r 1 [ p j ( x ) ] = x 0 x H ( μ x j 1 ) D r [ g j ( μ ) ] d μ x 0 x H ( μ x j ) D r [ g j ( μ ) ] d μ .
Since H ( x a ) | x a = 0 and H ( x a ) | x > a = 1 , the integrals in Equation (A7) can be rewritten by splitting the domains, assuming a > x 0 , such that
x 0 x H ( μ a ) D r [ g j ( μ ) ] d μ = H ( x a ) a x D r [ g j ( μ ) ] d μ = H ( x a ) D r 1 [ g j ( x ) g j ( a ) ] d μ .
Thus, the ( r 1 ) th derivative of p j ( x ) is
D r 1 [ p j ( x ) ] = H ( x x j 1 ) D r 1 [ g j ( x ) g j ( x j 1 ) ] H ( x x j ) D r 1 [ g j ( x ) g j ( x j ) ] .
Furthermore, Equation (A9) can be applied recursively for additional integrals where constants such as D r 1 [ g j ( x j 1 ) ] and D r 1 [ g j ( x j ) ] must be taken into account. It can be shown that
D i [ H ( x a ) c ] = x a i i ! H ( x a ) c i 0 ,
where c is a constant. Thus, the ( r i ) th derivative of p j ( x ) for 0 i r can be expressed as
D r i [ p j ( x ) ] = H ( x x j 1 ) D r i [ g j ( x ) ] k = 1 i x x j 1 i k ( i k ) ! D r k [ g j ( x j 1 ) ] H ( x x j ) D r i [ g j ( x ) ] k = 1 i x x j i k ( i k ) ! D r k [ g j ( x j ) ] ,
which can be substituted into Equation (A5). As discussed in Section 2.1, the purpose of the piecewise functional form in Equations (A5) and (A6) is that continuity constraints in all i < r derivatives of g ( x ) are intrinsically satisfied. To demonstrate this, assume a C 2 -discontinuity at x j . It can be shown that the limits of the first derivatives of p j ( x ) and p j + 1 ( x ) approaching the discontinuity from the left are
lim ε 0 D 1 [ p j ( x j ε ) ] = D 1 [ g j ( x j ) g j ( x j 1 ) ] , lim ε 0 D 1 [ p j + 1 ( x j ε ) ] = 0 ,
and from the right are
lim ε 0 D 1 [ p j ( x j + ε ) ] = D 1 [ g j ( x j ) g j ( x j 1 ) ] , lim ε 0 D 1 [ p j + 1 ( x j + ε ) ] = 0 .
Provided the local functions are continuous as implemented in this work, g ( x ) is C 1 -continuous over the domain [ x j 1 , x j + 1 ] .

Appendix D

For reference, the second-order BVP (see Section 3.2) is used to compare the g-embedded hybrid system approach against a standard finite difference (FD) solver using a central difference approximation of derivatives. To maintain consistency in this comparison, the root mean squared error (RMSE) of the solution field y is plotted in Figure A2 against the number of nodes used to discretize the global domain. Note that the g-embedded approach uses the CGL point distribution from Appendix B, while the finite difference solver uses a uniform grid, and four different sets of Legendre orthogonal polynomials are used with maximum degrees m of 2, 6, 10, and 14. Additionally, it is important to recognize that the size of the matrix inverted for the g-embedded method is dependent upon the number of basis functions and not the number of nodes. These results indicate this second-order BVP requires approximately 30 nodes (i.e., 15 nodes per subdomain) to achieve machine level precision with 13 basis functions up to degree 14 per subdomain. The finite difference solver, on the other hand, achieves an RSME of only O ( 10 5 ) with 200 nodes.
Figure A2. Convergence comparison of the g-embedded approach with respect to a finite difference solver for the second-order BVP in Section 3.2.
Figure A2. Convergence comparison of the g-embedded approach with respect to a finite difference solver for the second-order BVP in Section 3.2.
Mathematics 13 02785 g0a2

References

  1. Coddington, E.A.; Levinson, N. Theory of Ordinary Differential Equations; McGraw-Hill: New York, NY, USA, 1955. [Google Scholar]
  2. Smirnov, V. On the solutions of linear differential equations with discontinuous coefficients. Russ. Math. Surv. 1970, 25, 221–258. [Google Scholar]
  3. Zettl, A. Sturm-Liouville Theory; American Mathematical Society: Providence, RI, USA, 2005. [Google Scholar]
  4. Boyce, W.E.; DiPrima, R.C. Elementary Differential Equations and Boundary Value Problems, 11th ed.; John Wiley & Sons: Hoboken, NJ, USA, 2017. [Google Scholar]
  5. Zill, D.G. A First Course in Differential Equations with Modeling Applications, 11th ed.; Cengage Learning: Boston, MA, USA, 2017. [Google Scholar]
  6. Arfken, G.B.; Weber, H.J.; Harris, F.E. Mathematical Methods for Physicists, 7th ed.; Academic Press: Cambridge, MA, USA, 2013. [Google Scholar]
  7. Stakgold, I.; Holst, M. Green’s Functions and Boundary Value Problems, 3rd ed.; Wiley: Oxford, UK, 2011. [Google Scholar]
  8. Herman, R.L. A Second Course in Ordinary Differential Equations: Dynamical Systems and Boundary Value Problems; Green’s Function Construction with Jump Discontinuity Conditions; R.L. Herman: Brooklyn, NY, USA, 2024. [Google Scholar]
  9. Kreyszig, E. Advanced Engineering Mathematics, 10th ed.; Wiley: Hoboken, NJ, USA, 2011. [Google Scholar]
  10. McLachlan, N.W. Laplace Transforms and Their Applications to Differential Equations; Courier Corporation: North Chelmsford, MA, USA, 2014. [Google Scholar]
  11. Zill, D.G.; Cullen, M.R. Differential Equations with Boundary-Value Problems, 8th ed.; Cengage Learning: Boston, MA, USA, 2012. [Google Scholar]
  12. Smith, G.D. Numerical Solution of Partial Differential Equations: Finite Difference Methods; Oxford University Press: Oxford, UK, 1985. [Google Scholar]
  13. Versteeg, H.K. An Introduction to Computational Fluid Dynamics the Finite Volume Method, 2nd ed.; Pearson Education India: Noida, India, 2007. [Google Scholar]
  14. Zienkiewicz, O.C.; Taylor, R.L.; Zhu, J.Z. The Finite Element Method: Its Basis and Fundamentals; Elsevier: Amsterdam, The Netherlands, 2005. [Google Scholar]
  15. Boyd, J.P. Chebyshev and Fourier Spectral Methods; Courier Corporation: North Chelmsford, MA, USA, 2001. [Google Scholar]
  16. Canuto, C.; Hussaini, M.Y.; Quarteroni, A.; Zang, T.A. Spectral Methods; Springer: Berlin/Heidelberg, Germany, 2006; Volume 285. [Google Scholar]
  17. Mortari, D. The Theory of Connections: Connecting Points. Mathematics 2017, 5, 57. [Google Scholar] [CrossRef]
  18. Johnston, H.R. The Theory of Functional Connections: A Journey from Theory to Application. Ph.D. Thesis, Texas A&M University, College Station, TX, USA, 2021. [Google Scholar]
  19. Leake, C.D. The Multivariate Theory of Functional Connections: An n-Dimensional Constraint Embedding Technique Applied to Partial Differential Equations. Ph.D. Thesis, Texas A&M University, College Station, TX, USA, 2021. [Google Scholar]
  20. Leake, C.; Johnston, H.; Mortari, D. The Theory of Functional Connections: A Functional Interpolation. Framework with Applications; Lulu: Morrisville, NC, USA, 2022; Available online: https://www.lulu.com/shop/daniele-mortari-and-hunter-johnston-and-carl-leake/the-theory-of-functional-connections/hardcover/product-ve2ren.html?srsltid=AfmBOop9--_QJtbbqYjermg1U2KRFmXSedPxUSOJNQqhylEZ_0dSjwk6 (accessed on 26 October 2024).
  21. Florio, M.D.; Schiassi, E.; D’Ambrosio, A.; Mortari, D.; Furfaro, R. Theory of Functional Connections applied to Linear ODEs subject to Integral Constraints and Linear Ordinary Integro-Differential Equations. Math. Comput. Appl. 2021, 26, 65. [Google Scholar] [CrossRef]
  22. Wang, Y.; Topputo, F. A TFC-based homotopy continuation algorithm with application to dynamics and control problems. J. Comput. Appl. Math. 2022, 401, 113777. [Google Scholar] [CrossRef]
  23. Johnston, H.; Schiassi, E.; Furfaro, R.; Mortari, D. Fuel-efficient powered descent guidance on large planetary bodies via theory of functional connections. J. Astronaut. Sci. 2020, 67, 1521–1552. [Google Scholar] [CrossRef]
  24. Sivalingam, S.; Govindaraj, V. A novel numerical approach for time-varying impulsive fractional differential equations using theory of functional connections and neural network. Expert Syst. Appl. 2024, 238, 121750. [Google Scholar]
  25. Sivalingam, S.; Kumar, P.; Govindaraj, V. A novel method to approximate fractional differential equations based on the theory of functional connections. Numer. Algorithms 2024, 95, 527–549. [Google Scholar]
  26. De Florio, M.; Schiassi, E.; Furfaro, R. Physics-informed neural networks and functional interpolation for stiff chemical kinetics. Chaos 2022, 32. [Google Scholar] [CrossRef]
  27. Schiassi, E.; Florio, M.D.; D’Ambrosio, A.; Mortari, D.; Furfaro, R. Physics-Informed Neural Networks and Functional Interpolation for Data-Driven Parameters Discovery of Epidemiological Compartmental Models. Mathematics 2021, 9, 2069. [Google Scholar] [CrossRef]
  28. Zhang, H.; Zhou, S.; Zhang, G. Shaping low-thrust multi-target visit trajectories via theory of functional connections. Adv. Space Res. 2023, 72, 257–269. [Google Scholar] [CrossRef]
  29. Campana, C.; Merisio, G.; Topputo, F. Low-energy Earth–Moon transfers via Theory of Functional Connections and homotopy. Celest. Mech. Dyn. Astron. 2024, 136, 21. [Google Scholar] [CrossRef]
  30. Li, S.; Yan, Y.; Zhang, K.; Li, X. Fuel-Optimal Ascent Trajectory Problem for Launch Vehicle via Theory of Functional Connections. Int. J. Aerosp. Eng. 2021, 2021, 2734230. [Google Scholar] [CrossRef]
  31. de Almeida, A.K., Jr.; Aljbaae, S.; Vaillant, T.; Piñeros, J.M.; Coelho, B.; Barbosa, D.; Bergano, M.; Pandeirada, J.; Carvalho, F.C.; Santos, L.B.; et al. Theory of Functional Connections and Nelder–Mead optimization methods applied in satellite characterization. Acta Astronaut. 2024, 215, 548–559. [Google Scholar] [CrossRef]
  32. Zhang, C.; Zhu, Y.; Yang, L. A theory of functional connections-based method for orbital pursuit-evasion games with analytic satisfaction of rendezvous constraints. Aerosp. Sci. Technol. 2025, 161, 110142. [Google Scholar] [CrossRef]
  33. Mai, T.; Mortari, D. Theory of Functional Connections Applied to Quadratic and Nonlinear Programming under Equality Constraints. J. Comput. Appl. Math. 2022, 406, 113912. [Google Scholar] [CrossRef]
  34. Lombardi, C.; Bevilacqua, R. State space modeling and estimation of flexible structure using the theory of functional connections. Acta Astronaut. 2024, 219, 693–709. [Google Scholar] [CrossRef]
  35. Yassopoulos, C.; Reddy, J.; Mortari, D. Analysis of nonlinear Timoshenko–Ehrenfest beam problems with von Kármán nonlinearity using the Theory of Functional Connections. Math. Comput. Simul. 2023, 205, 709–744. [Google Scholar] [CrossRef]
  36. Leake, C.D.; Mortari, D. Deep Theory of Functional Connections: A New Method for Estimating the Solutions of Partial Differential Equations. Mach. Learn. Knowl. Extr. 2020, 2, 37–55. [Google Scholar] [CrossRef]
  37. Raissi, M.; Perdikaris, P.; Karniadakis, G.E. Physics-informed neural networks: A deep learning framework for solving forward and inverse problems involving nonlinear partial differential equations. J. Comput. Phys. 2019, 378, 686–707. [Google Scholar] [CrossRef]
  38. Min, Y.; Sonar, A.; Azizan, N. Hard-Constrained Neural Networks with Universal Approximation Guarantees. arXiv 2024, arXiv:2410.10807. [Google Scholar] [CrossRef]
  39. Yassopoulos, C.; Leake, C.; Reddy, J.; Mortari, D. Analysis of Timoshenko-Ehrenfest Beam Problems using the Theory of Functional Connections. J. Eng. Anal. Bound. Elem. 2021, 132, 271–280. [Google Scholar] [CrossRef]
  40. Johnston, H.R.; Mortari, D. Least-squares Solutions of Boundary-value Problems in Hybrid Systems. J. Comput. Appl. Math. 2021, 393, 113524. [Google Scholar] [CrossRef]
Figure 1. An example free function g x , g 1 ( x ) , g 2 ( x ) (Right) and its first (Center) and second (Left) derivatives as derived in Equations (4), (3) and (2), respectively. Notice that the local free function g 2 ( x ) and its first derivative are different than the global free function g ( x ) and its first derivative, respectively, over the subdomain Ω 2 because C 1 continuity is enforced.
Figure 1. An example free function g x , g 1 ( x ) , g 2 ( x ) (Right) and its first (Center) and second (Left) derivatives as derived in Equations (4), (3) and (2), respectively. Notice that the local free function g 2 ( x ) and its first derivative are different than the global free function g ( x ) and its first derivative, respectively, over the subdomain Ω 2 because C 1 continuity is enforced.
Mathematics 13 02785 g001
Figure 2. The field y ^ ( x , g ( x ) ) (Right) and its first (Center) and second (Left) derivatives of Equation (18) produced by substituting g j ( x ) j = 1 , , 4 with randomly weighted second-order Legendre polynomials. The constrained expression satisfies the two boundary constraints in Equation (17), arbitrarily chosen as y 0 = 1 and y f = 2 , and the six continuity conditions in Equation (19).
Figure 2. The field y ^ ( x , g ( x ) ) (Right) and its first (Center) and second (Left) derivatives of Equation (18) produced by substituting g j ( x ) j = 1 , , 4 with randomly weighted second-order Legendre polynomials. The constrained expression satisfies the two boundary constraints in Equation (17), arbitrarily chosen as y 0 = 1 and y f = 2 , and the six continuity conditions in Equation (19).
Mathematics 13 02785 g002
Figure 3. Thesolution field y ( x ) (Left) and its first (Center) and second (Right) derivatives of the DDE in Equations (33) and (34).
Figure 3. Thesolution field y ( x ) (Left) and its first (Center) and second (Right) derivatives of the DDE in Equations (33) and (34).
Mathematics 13 02785 g003
Figure 4. The numerical results of the g-embedded method applied to the second-order IVP. (Left) The error distributions for 14 basis functions. (Center) The L 2 -norm of the error vectors with respect to the number of basis functions. (Right) The L 2 -norm of the residual and condition number of the least-squares matrix with respect to the number of basis functions.
Figure 4. The numerical results of the g-embedded method applied to the second-order IVP. (Left) The error distributions for 14 basis functions. (Center) The L 2 -norm of the error vectors with respect to the number of basis functions. (Right) The L 2 -norm of the residual and condition number of the least-squares matrix with respect to the number of basis functions.
Mathematics 13 02785 g004
Figure 5. The numerical results of the g-embedded method applied to the second-order BVP. (Left) The error distributions for 14 basis functions. (Center) The L 2 -norm of the error vectors with respect to the number of basis functions. (Right) The L 2 -norm of the residual and condition number of the least-squares matrix with respect to the number of basis functions.
Figure 5. The numerical results of the g-embedded method applied to the second-order BVP. (Left) The error distributions for 14 basis functions. (Center) The L 2 -norm of the error vectors with respect to the number of basis functions. (Right) The L 2 -norm of the residual and condition number of the least-squares matrix with respect to the number of basis functions.
Mathematics 13 02785 g005
Figure 6. The solution field y ( x ) (Top left) and its first (Top right), second (Bottom left), and third (Bottom right) derivatives of the DDE in Equations (49) and (50) where y ( x ) is defined piecewise continuously in Equations (51) and (52).
Figure 6. The solution field y ( x ) (Top left) and its first (Top right), second (Bottom left), and third (Bottom right) derivatives of the DDE in Equations (49) and (50) where y ( x ) is defined piecewise continuously in Equations (51) and (52).
Mathematics 13 02785 g006
Figure 7. The numerical results of the g-embedded method applied to the third-order BVP. (Left) The error distributions for 17 basis functions. (Center) The L 2 -norm of the error vectors with respect to the number of basis functions. (Right) The L 2 -norm of the residual and condition number of the least-squares matrix with respect to the number of basis functions.
Figure 7. The numerical results of the g-embedded method applied to the third-order BVP. (Left) The error distributions for 17 basis functions. (Center) The L 2 -norm of the error vectors with respect to the number of basis functions. (Right) The L 2 -norm of the residual and condition number of the least-squares matrix with respect to the number of basis functions.
Mathematics 13 02785 g007
Figure 8. The numerical results of the S-embedded method applied to the third-order BVP. (Left) The error distributions for 17 basis functions. (Center) The L 2 -norm of the error vectors with respect to the number of basis functions. (Right) The L 2 -norm of the residual and condition number of the least-squares matrix with respect to the number of basis functions.
Figure 8. The numerical results of the S-embedded method applied to the third-order BVP. (Left) The error distributions for 17 basis functions. (Center) The L 2 -norm of the error vectors with respect to the number of basis functions. (Right) The L 2 -norm of the residual and condition number of the least-squares matrix with respect to the number of basis functions.
Mathematics 13 02785 g008
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

White, T.; Mortari, D. Theory of Functional Connections Applied to Linear Discontinuous Differential Equations. Mathematics 2025, 13, 2785. https://doi.org/10.3390/math13172785

AMA Style

White T, Mortari D. Theory of Functional Connections Applied to Linear Discontinuous Differential Equations. Mathematics. 2025; 13(17):2785. https://doi.org/10.3390/math13172785

Chicago/Turabian Style

White, Trent, and Daniele Mortari. 2025. "Theory of Functional Connections Applied to Linear Discontinuous Differential Equations" Mathematics 13, no. 17: 2785. https://doi.org/10.3390/math13172785

APA Style

White, T., & Mortari, D. (2025). Theory of Functional Connections Applied to Linear Discontinuous Differential Equations. Mathematics, 13(17), 2785. https://doi.org/10.3390/math13172785

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop