Skip to main content
14-Alexandrite
April 10, 2014
Solved

Derivative of function

  • April 10, 2014
  • 2 replies
  • 5385 views

Hello,

Yesterday Werner helped with the derivative of the M(x) function, and it was working. Today it is not. I am not sure why. Please scroll down until you see the red arrow. Thanks!

Best answer by MikeArmstrong

It has got something to do with your Moment function.

Define the derivative next to the graph in your sheet and you can see the derivative does not return a zero, therefore the root fails.

2 replies

1-Visitor
April 10, 2014

It has got something to do with your Moment function.

Define the derivative next to the graph in your sheet and you can see the derivative does not return a zero, therefore the root fails.

19-Tanzanite
April 10, 2014

Mike Armstrong wrote:

... the derivative does not return a zero ...

This is because, although the function is continuous at "a" the derivative is not. The function has a kink, which means the derivative has a step. You need a smoother transition between regions.

Alan

1-Visitor
April 10, 2014

Cheers for the explanation Alan. I knew there was an issue but lacked the vocabulary to describe it.

25-Diamond I
April 10, 2014

The error message "These values cannot be compared" is misleading unfortunately. The real reason, as Mike and Alan already pointed out, is, that getting the extrema by setting the first derivative to zero will only work for well behaved continuous functions. You had luck yesterday and bad luck with the new function today, as the derivative seems to never get zero and even if it would it probably wouldn't be the absolute maximum.

Yesterday I wrote "I guess your solve block may be more versatile and probably more robust when we come across more "ill-natured" functions". Thats proves true today, even though I should have written maximize instead of solve block (you can delete the "Given" - you can use maximize as a standalone function.

1-Visitor
April 10, 2014

Very informative response Werner as usual.

As you said the error message is useless, however, the trace error feature did lead me back to the condition were a was included which I was impressed with.

25-Diamond I
April 10, 2014

Mike Armstrong wrote:

Very informative response Werner as usual.

... and wrong, too 😞 The way the two parts are joint, namely without a step, if the derivative would get zero, it would yield the absolute maximum. I was playing around with the function and suddenly look at an Mu_total with a decent step in it - that way I was misead to the remark.

BTW, here is a closeup of the position where the two parts join and we clearly see the kink Alan was talking about. So it obviously won't help looking for a horizontal tangent.

10.04.png

I still meditate over the error message and wondering why we don't simply get the standard "This calculation does not converge to a solution" error. Obviously the error is thrown by the derivative calling the function, but what would root feed into the function as argument that it would not be allowed to be compared to length a. I already tried a unitless variant but with the same error message.