Ramp[x]
gives x if x≥0 and 0 otherwise.
Ramp
Ramp[x]
gives x if x≥0 and 0 otherwise.
Examples
open all close allBasic Examples (3)
Ramp[-1]Ramp[3.7]Plot over a subset of the reals:
Plot[Ramp[x], {x, -2, 2}]Ramp is a piecewise function:
PiecewiseExpand[Ramp[x]]Scope (32)
Numerical Evaluation (6)
Ramp[1 / 2]Ramp[-E]Ramp[-1.55]N[Ramp[1 / 19], 50]N[Ramp[2 / 7], 50]The precision of the output tracks the precision of the input:
Ramp[0.21111111111115551111]Evaluate efficiently at high precision:
N[Ramp[1 / 19`100]]//TimingN[Ramp[1 / 17`10000]];//TimingRamp threads over lists:
Ramp[{-5, -1.5, 0, 1 / 3, Pi}]Compute average-case statistical intervals using Around:
Ramp[ Around[2 / 3, 0.001]]Compute the elementwise values of an array using automatic threading:
Ramp[{{1 / 2, -1}, {-5 / 3, 1 / 2}}]Or compute the matrix Ramp function using MatrixFunction:
MatrixFunction[Ramp, {{1 / 2, -1}, {-5 / 3, 1 / 2}}]//FullSimplifySpecific Values (5)
Values of Ramp at fixed points:
Table[Ramp[n ], {n, {1, 7 / 3, -7 / 5}}]Ramp[0]Underscript[, x -> ∞]Ramp[x]Underscript[, x -> -∞]Ramp[x]PiecewiseExpand[x Ramp[x]]Find a value of x for which Ramp[x]1:
xval = x /. FindRoot[Ramp[x] == 1, {x, 2}]Plot[Ramp[x], {x, -2, 2}, Epilog -> Style[Point[{xval, Ramp[xval]}], PointSize[Large], Red]]Visualization (4)
Plot the Ramp function:
Plot[Ramp[x], {x, -5, 5}]Visualize shifted Ramp functions:
Plot[{Ramp[x + 1], Ramp[x], Ramp[x - 1]}, {x, -2, 2}, PlotLegends -> "Expressions"]Visualize the composition of Ramp with a periodic function:
Plot[Ramp[Sin[x]], {x, -2Pi, 2Pi}]Plot Ramp in three dimensions:
Plot3D[Ramp[x + y], {x, -4, 4}, {y, -4, 4}, ColorFunction -> "BlueGreenYellow"]Function Properties (9)
Ramp is defined for all real numbers:
FunctionDomain[Ramp[x], x]It is restricted to real inputs:
FunctionDomain[Ramp[x], x, Complexes]Function range of Ramp:
FunctionRange[Ramp[x], x, y]Ramp is equivalent to the average of a number with its RealAbs:
Simplify[Ramp[x] == (x + RealAbs[x]/2)]Ramp is not an analytic function:
FunctionAnalytic[Ramp[x], x]It has singularities, but no discontinuities:
FunctionSingularities[Ramp[x], x]FunctionDiscontinuities[Ramp[x], x]Ramp is nondecreasing:
FunctionMonotonicity[Ramp[x], x]Ramp is not injective:
FunctionInjective[Ramp[x], x]Plot[{Ramp[x], 0}, {x, -7, 7}, PlotStyle -> {Thick}]Ramp is not surjective:
FunctionSurjective[Ramp[x], x]Plot[{Ramp[x], -1}, {x, -5, 5}, PlotStyle -> {Thick}]Ramp is non-negative:
FunctionSign[Ramp[x], x]Ramp is convex:
FunctionConvexity[Ramp[x], x]Differentiation and Integration (4)
First derivative with respect to x:
der = D[Ramp[x], x]Except for the singular point
, this derivative is UnitStep:
Simplify[der == UnitStep[x], x ≠ 0]Plot[der, {x, -2, 3}]Second derivative with respect to x:
D[Ramp[x], {x, 2}]Compute the indefinite integral using Integrate:
Integrate[Ramp[x], x]FullSimplify[D[%, x] == Ramp[x]]Integrate[Ramp[x], {x, 0, 4}]Integral Transforms (4)
FourierTransform of Ramp:
FourierTransform[Ramp[x], x, t]FourierSeries[Ramp[x], x, 4]// FullSimplifyPlot[{%, Ramp[x]}, {x, -2, 2}, Exclusions -> None]LaplaceTransform of Ramp:
LaplaceTransform[Ramp[x], x, t]The convolution of UnitStep with itself is equal to Ramp:
Simplify[Ramp[y] == Convolve[UnitStep[x], UnitStep[x], x, y]]The convolution of Ramp and UnitStep gives a quadratic on the non-negative reals:
Convolve[Ramp[x], UnitStep[x], x, y]The convolution of Ramp with itself gives a cubic on the non-negative reals:
Convolve[Ramp[x], Ramp[x], x, y]Applications (3)
Integrate a piecewise function involving Ramp symbolically and numerically:
Plot[Sin[x] Ramp[3x - 1], {x, -2, 3π}, Filling -> Axis]Integrate[Sin[x] Ramp[3x - 1], {x, -2, 3π}]N[%]NIntegrate[Sin[x] Ramp[3x - 1], {x, -2, 3π}]Solve a differential equation involving Ramp:
sol = DSolve[{x''[t] + a ^ 2 x[t] == Ramp[t - a], x[0] == 0, x'[0] == 0}, x[t], t, Assumptions -> a > 0]//FullSimplifyPlot the solution for different values of a:
Plot[Table[x[t] /. sol[[1]], {a, 1, 2, 0.3}]//Evaluate, {t, -1, 15}, Filling -> Axis]Create a convolutional classification net to use the subimage extracted by the localization net:
classifier = NetChain[{
ConvolutionLayer[16, 4], BatchNormalizationLayer[], Ramp, PoolingLayer[4], ConvolutionLayer[32, 4], BatchNormalizationLayer[], Ramp, PoolingLayer[4], LinearLayer[10], SoftmaxLayer[]},
"Output" -> NetDecoder[{"Class", Range[0, 9]}],
"Input" -> {1, 16, 16}]Related Guides
Related Links
History
Text
Wolfram Research (2016), Ramp, Wolfram Language function, https://reference.wolfram.com/language/ref/Ramp.html.
CMS
Wolfram Language. 2016. "Ramp." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Ramp.html.
APA
Wolfram Language. (2016). Ramp. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Ramp.html
BibTeX
@misc{reference.wolfram_2026_ramp, author="Wolfram Research", title="{Ramp}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/Ramp.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_ramp, organization={Wolfram Research}, title={Ramp}, year={2016}, url={https://reference.wolfram.com/language/ref/Ramp.html}, note=[Accessed: 13-June-2026]}