home *** CD-ROM | disk | FTP | other *** search
-
- (*:Version: Mathematica 2.0 *)
-
- (*:Context: Calculus`Support` *)
-
- (*:Title: Support *)
-
- (*:Author: Eran Yehudai *)
-
- (*:Summary: Implements functions used in both Laplace and Fourier transforms.
- *)
-
- (*:Keywords: Laplace, Fourier, transform, differential equations
- *)
-
- (*:Requirements: None *)
-
- (*:Sources:
- Fritz Oberhettinger and Larry Badii (1973), "Tables of Laplace
- Transforms", New-York: Springer-Verlag.
- *)
-
- (*:History:
- Version 1.1 by Eran Yehudai, November 1990.
- Modified by ECM (Wolfram Research), December 1990.
- Delta support modified by ECM (Wolfram Research), February 1992.
- *)
-
- (*:Warning: Expands definition of Sign. *)
-
- BeginPackage["Calculus`Common`Support`"]
-
- ZeroLimit::usage =
- "ZeroLimit is an option of Laplace transform. It determines how the limit t
- -> 0, Direction -> 1 is treated in the transform definition. ZeroLimit ->
- All uses the Limit function only. ZeroLimit -> Automatic (default) is the
- same as ZeroLimit -> All unless the Limit fails to evaluate. In this case,
- the result is the expression evaluated at 0."
-
- ComposedFunctionQ::usage =
- "ComposedFunctionQ[expr, x] returns a list of the smallest subexpressions
- containing x in expr."
-
- ThomsonBei::usage =
- "ThomsonBei[nu, z] is the Thomson bei function."
-
- ThomsonBer::usage =
- "ThomsonBer[nu, z] is the Thomson ber function."
-
- ParabolicCylinderD::usage =
- "ParabolicCylinderD[nu, z] is the D parabolic cylinder function."
-
- NumericPart::usage =
- "NumericPart[expr] is the numeric coefficient of N[expr]."
-
- SimplifyErf::usage =
- "SimplifyErf[expr] attempts to simplify Erf in expr."
-
- (************************************************************************)
- Begin["`Private`"]
- (************************************************************************)
-
- (* =========================== Thomson Functions ========================= *)
-
- ThomsonBei[n_, z_] :=
- (BesselJ[n, z Exp[3 Pi I/4]] - BesselJ[n, z Exp[-3 Pi I/4]]) / (2I)
-
- ThomsonBei[z_] := ThomsonBei[0, z]
-
- ThomsonBer[n_, z_] :=
- (BesselJ[n, z Exp[3 Pi I/4]] + BesselJ[n, z Exp[-3 Pi I/4]]) / 2
-
- ThomsonBer[z_] := ThomsonBer[0, z]
-
- (* ============================ SimplifyErf =============================== *)
-
- SimplifyErf[expr_] := expr //. {
- Erf[a_] :> Module[{aa = Expand[a]}, Erf[aa] /; aa =!= a],
- Erf[a_] :> -Erf[Expand[-a]] /; OrderedQ[{Expand[-a], Expand[a]}]
- }
-
- (* ================================ Sign =================================== *)
-
- Unprotect[Sign]
- Sign/: Abs[x_]Sign[x_] := x
- Sign/: Abs[x_] Sign[xx_] := -x /; Expand[x+xx]==0
- Protect[Sign]
-
- (* ========================== ParabolicCylinderD ========================== *)
-
- ParabolicCylinderD[-1,z_] := Sqrt[Pi/2]Exp[z^2/4](1-Erf[z/Sqrt[2]])
-
- ParabolicCylinderD[-1/2,z_] := Sqrt[z/(2Pi)] BesselK[1/4,z^2/4]
-
- ParabolicCylinderD[n_Integer, z_] :=
- 2^(-n/2) Exp[-z^2/4] HermiteH[n,z/Sqrt[2]] /; n >= 0
-
- ParabolicCylinderD[p_, z_] := 2^(p/2)Exp[-z^2/4] (
- Sqrt[Pi]Hypergeometric1F1[-p/2,1/2,z^2/2]/Gamma[(1-p)/2] -
- Sqrt[2Pi] z Hypergeometric1F1[(1-p)/2,3/2,z^2/2]/Gamma[-p/2])
-
-
- (* ============================== NumericPart ============================= *)
-
- NumericPart[expr_] := NN[N[expr]]
- NN[n_Integer x_.] := n
- NN[n_Real x_.] := n
- NN[n_Rational x_.] := n
- NN[n_Complex x_.] := n
- NN[n_DirectedInfinity x_.] := n
- NN[_] = 1
-
-
- (* =========================== ComposedFunctionQ ========================== *)
-
- ComposedFunctionQ[f_, s_Symbol] :=
- If[FreeQ[f, s] || f===s,
- False,
- (Drop[#,-1]& /@ Position[f, s]) /. {a___Integer} :> f[[a]]
- ]
-
- (************************************************************************)
- End[] (* end `Private` Context *)
- (************************************************************************)
-
-
-
- (************************************************************************)
- EndPackage[] (* end package Context *)
- (************************************************************************)
-