The type of equations that one can solve include all first-order methods using integration, Riccati, and higher-order methods including linear, Bernoulli, and Euler. We can solve differential equations with piecewise functions in the coefficients. Solving Differential Equations with Piecewise
H := convert min x 2 − 2, x − 1, ' piecewise ' Thus, it can be converted to a new function g ( x ).
Matlab piecewise function plot series#
However, series can do better when using piecewise. This produces an answer with a superfluous order term. The straightforward calculation of the series of f around x =0 can be computed by using the series command. To determine the highest order of continuity and the problem points, enter:ĭerivatives can be found, and piecewise functions are returned. Isdifferentiable newcubic, x, 3, ' badpoints ' This must be true for splines! However, when we check to see if it is C 3, we obtain For example, in the case of our previous spline function, newcubic, we have We can also determine the differentiability class of a piecewise continuous function. It turns out to be a well-behaved, non-piecewise function. For example,Ĭonvert 1 − x, ' piecewise 'Ĭonvert − signum x 1 − x, ' piecewise ' Other piecewise functions can also be converted to piecewise and be properly manipulated. Newcubic ≔ CurveFitting Spline 0, 1, 2, 3, 0, 1, 4, 3, x Normal convert heavyf, ' piecewise ' Heavyf := x Heaviside 1 + x − x − x 2 Heaviside x − 1 + x 2 Heaviside 1 + x + sin x − 1 Heaviside x − 1 x − 1ĭistributions can be converted back to piecewise functions. Note: This works because discont is able to determine the potential discontinuities of piecewise functions. Where Si(x) is the Sine integral function. Using the same function, f ( x ), find its piecewise derivative.įprime ≔ &DifferentialD &DifferentialD x f Examples of solving DEs will be illustrated later. Such functions can be plotted to determine their behavior.īesides evaluating limits, you can do operations such as computing derivatives, integrating, and solving differential equations with piecewise functions. The next several Maple command lines make use of the following piecewise function:į := piecewise x ≤ − 1, − x, x ≤ 1, x 2, 1 īecause of the division by zero, points such as x = 1 cannot be substituted. Every piece is specified by a Boolean condition followed by an expression. The piecewise function has a straightforward syntax. This worksheet contains a number of examples of the use of the piecewise function.