[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math


View post   

File: 2 KB, 299x140, MSP39922242gh4c3a844aga000051hfci162hbiagab.gif [View same] [iqdb] [saucenao] [google]
5641239 No.5641239 [Reply] [Original]

Is there a simple mathematical function that returns 0 for all negative input, and behaves linearly for positive input? Ideally without conditions otherwise I'd just throw a few if statements together.

Pic related

>> No.5641244
File: 41 KB, 634x571, grafs.jpg [View same] [iqdb] [saucenao] [google]
5641244

pls respond

>> No.5641248
File: 296 KB, 320x240, ...gif [View same] [iqdb] [saucenao] [google]
5641248

bump

>> No.5641247

x*u(x)

with u(x) being the heaviside function

>> No.5641249

Your function isn't smooth (continuous in the first derivative). The simplest function with your behavior is the explicit description which you're saying:
f(x) = 0 for x \leq 0
f(x) = x for x \geq 0

(where \geq and \leq mean "greater/lesser than or equal to), or, equivalently, x Θ(x), where Θ(x) is the Heaviside step function.

>> No.5641250

>>5641247
thanks man

>> No.5641254

looks like heaviside functions use conditions as well

anyway thanks for the help guys

>> No.5641270

<span class="math">\frac{\sqrt{x^2}+x}{2}[/spoiler]

>> No.5641272
File: 907 KB, 150x113, fukye.gif [View same] [iqdb] [saucenao] [google]
5641272

>>5641270
Perfect.

>> No.5641273

>>5641270
ARE YOU A WIZARD

>> No.5641277

sqrt(3)

>> No.5641292
File: 10 KB, 350x350, crymoar.jpg [View same] [iqdb] [saucenao] [google]
5641292

>>5641270
Now is there one that returns 0 for all negative numbers and from 0 to 5?

- not OP

>> No.5641294

>>5641292
And behaves linearly for all other input

>> No.5641295

Set function to = zero

>> No.5641297

>>5641292
<div class="math">\frac{\sqrt{(x-5)^2}+x-5}{2}</div>

>> No.5641299

>>5641297
That turns out to be x-5

Doesn't work

>> No.5641302

>>5641299
Unless you take the negative root, which turns the top to 0 for all numbers. Which still doesn't work...

>> No.5641308

>>5641299
>>5641302
Never mind, I'm retarded.

>> No.5641330

>>5641297
Oh god, why does this work. This one >>5641270
makes more sense just looking at it since it works out algebraically but this one >>5641297 looks like it would become \frac{2(x-5)}{2} or \frac{-(x-5)+x-5}{2}

>> No.5641335

\frac{\sqrt{(x-5)^2}+(x-5)}{2}

>> No.5641408

>>5641270
<span class="math"> \sqrt{x^2} = |x| = \mathop{\rm sgn}(x) x[/spoiler] for all <span class="math">x \in \mathbb{R}[/spoiler].

>>5641330
Replacing x with x-5 moves the whole thing 5 to the right.

>> No.5641416

>>5641408
>Replacing x with x-5 moves the whole thing 5 to the right.
Um, okay.