Post Reply 
Plot derivative of an ABS( function ) fails (RESOLVED)
04-27-2015, 12:29 PM (This post was last modified: 04-28-2015 04:07 PM by StephanP.)
Post: #1
Plot derivative of an ABS( function ) fails (RESOLVED)
While testing the HP Prime I ran into the following odd behaviour.

Symb
F1(X)=|X^2 -10X +21| (between absolute brackets)
F2(X)=dF1(X)/dX=X (the derivative of F1)

Plot
F1 plots fine, bouncing nicely at x=3 and x=7
F2 does not plot well. It gives three horizontal line segments.
Y=1 for x < 3
Y=-1 for 3 < x < 7
Y=1 for x > 7

   

If I use the function Slope in the plot windows, then correct slope values are given for F1.
For F2, slope values are "NaN".

When I remove the absolute brackets from F1, F2 plots perfectly.
Find all posts by this user
Quote this message in a reply
04-28-2015, 12:25 PM
Post: #2
RE: Plot derivative of an ABS( function ) fails
No response yet. Still I'd like to know.
- Is it a bug?
- Am I wrong to expect a proper derivative plot?
Find all posts by this user
Quote this message in a reply
04-28-2015, 01:28 PM
Post: #3
RE: Plot derivative of an ABS( function ) fails
(04-28-2015 12:25 PM)StephanP Wrote:  No response yet.

It has been less than a full day since your initial post. Please be patient for a reply, many users do not check in hourly or even daily. It seems your interest is more curiosity than some urgent need, so please continue exploring it yourself in parallel; you may find an answer before another user gets to reply.

--Bob Prosperi
Find all posts by this user
Quote this message in a reply
04-28-2015, 01:58 PM
Post: #4
RE: Plot derivative of an ABS( function ) fails
Hello,

probably the problem is a result of the fact, that the ABS-Function leads to a not continously differntiable function. At the roots of the basic function the ABS-function creates a discontinuity!

What is the slope at x = 3 or x = 7? I think the value of the derivative at this points represented by NaN (not a number).

regards

Wolfgang
Find all posts by this user
Quote this message in a reply
04-28-2015, 02:19 PM (This post was last modified: 04-28-2015 02:25 PM by CR Haeger.)
Post: #5
RE: Plot derivative of an ABS( function ) fails
F2(X)= SLOPE(F1,X) seems to work.

Similar topic Here
Find all posts by this user
Quote this message in a reply
04-28-2015, 02:27 PM (This post was last modified: 04-28-2015 03:03 PM by Tim Wessman.)
Post: #6
RE: Plot derivative of an ABS( function ) fails
For the moment, you'll need to use that SLOPE command as shown in the other thread. It *was* an issue. :-)

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
04-28-2015, 03:58 PM (This post was last modified: 04-28-2015 04:03 PM by StephanP.)
Post: #7
RE: Plot derivative of an ABS( function ) fails
Yes, SLOPE(F1,X) works.
I did find that other thread, but as I was experiencing crashes using slope() (lowercase from the Catalog), I went for the d/dx method. This seemed to work fine, apart from the ABS() case.
Still it's a bit confusing, these variants of slope() and SLOPE(). I had to type it manually.

Thanks CR, Tim.
Find all posts by this user
Quote this message in a reply
04-28-2015, 04:45 PM
Post: #8
RE: Plot derivative of an ABS( function ) fails (RESOLVED)
(04-28-2015 03:58 PM)StephanP Wrote:  I had to type it manually.

TOOLBOX->APP->FUNCTION

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
04-28-2015, 04:54 PM
Post: #9
RE: Plot derivative of an ABS( function ) fails (RESOLVED)
(04-28-2015 03:58 PM)StephanP Wrote:  Yes, SLOPE(F1,X) works.
I did find that other thread, but as I was experiencing crashes using slope() (lowercase from the Catalog), I went for the d/dx method. This seemed to work fine, apart from the ABS() case.
Still it's a bit confusing, these variants of slope() and SLOPE(). I had to type it manually.

Thanks CR, Tim.

Toolbox > App > Function > SLOPE is what I use while in the Function App.

Another interesting way to key this into CAS and send to Function App:

f(x):= |X^2 -10X +21|
F1:=f
F2:=f'


which defines f(x), F1 as f(X) and F2 as f'(X). Hit Plot and it should display ok.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)