Skip to content

Ramp ​

The ramp function: x for x >= 0, 0 for x < 0.

✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram LanguageRamp✓
Ramp(x)max(x, 0).
Typed signatures
TypePackageApplies
(real) -> numberanalyticalways

Domain: Elementary functions

Details
  • Ramp(x) = x * UnitStep(x) -- continuous, so Ramp(0) = 0 needs no special case.
  • D(Ramp(x), x) = Piecewise({{0, x < 0}, {1, x > 0}}, Indeterminate) -- NOT UnitStep(x), which would be defined (as 1) at x = 0; Ramp's own slope there is undefined.

Plot

Examples

Basic #
live ↗
InRamp(−2)\mathrm{Ramp}(-2)Out00
live ↗
InRamp(3)\mathrm{Ramp}(3)Out33
live ↗
InRamp(0)\mathrm{Ramp}(0)Out00
Scope #

An exact irrational input at or above 0 is handed back untouched

live ↗
InRamp(π)\mathrm{Ramp}(π)Outππ

Known value · Ramp(v) = v for v ≥ 0, exactly -- π is never rounded

An exact irrational input below 0

live ↗
InRamp(−π)\mathrm{Ramp}(-π)Out00

Known value · Ramp(v) = 0 for v < 0

Properties #

Ramp(x) = x * UnitStep(x)

live ↗
InRamp(5)=5UnitStep(5)\mathrm{Ramp}(5)=5\mathrm{UnitStep}(5)OutTrue\mathrm{True}

0 or 1 away from the kink, undefined at x = 0

live ↗
IndRamp(x)dx\frac{\mathrm{d}\mathrm{Ramp}(x)}{\mathrm{d}x}OutPiecewise([[0,x<0],[1,0<x]],Indeterminate⁡)\mathrm{Piecewise}(\bigl\lbrack\bigl\lbrack0, x\lt0\bigr\rbrack, \bigl\lbrack1, 0\lt x\bigr\rbrack\bigr\rbrack, \operatorname{Indeterminate})
About
Examples7
Checked againstWolfram Language 7 agree
CrosswalkWolfram Language