cancel
Showing results for
Did you mean:
cancel
Showing results for
Did you mean:

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

4-Participant

## Derivative of regression line

I have used a regression line to find a curve fitting my datapoints.
Now I want to know the lowest point on my curve and I am trying to find that by finding the point where the derivative of the regression line is 0.

So I made a formula g(a) using the results from the regress function (by refering to entries in the regress solution matrix). I can use this function correctly to plot the curve and to calculate results for different values of a.

However when I want to get the derivative it gives me a formula including the regress function. Solving the derivative for 0 is impossible.

To check if I use the correct functions I also made a formula h(a). Basically the same as g(a), but now I have manually typed the results from the regress function in the formula, instead of linking to the regress solution matrix.

Now I can get the derivative and solve for equal to 0.

However this is not convenient if my datapoints change, because I have to manually update h(a) each time.

Is what I want possible and how to solve this? In other words, what am I doing wrong?

Attached a mathcad 15 file with an example.

1 ACCEPTED SOLUTION

Accepted Solutions
23-Emerald III
(To:corne_m)

Incidentally, If all your polynomes are 3rd order and like the one given, the (positive) zero always occurs at

And instead of symbolically solving this, you could also use a numeric solver, which can happily work with the output of the interp function:

Success!
Luc

7 REPLIES 7
21-Topaz II
(To:corne_m)

Hi

23-Emerald III
(To:corne_m)

Try this

then:

Success!
Luc

16-Pearl
(To:corne_m)

If you look at the error message it says the result is too big to display.  However, you can still use the result.

Alan

23-Emerald III
(To:corne_m)

Incidentally, If all your polynomes are 3rd order and like the one given, the (positive) zero always occurs at

And instead of symbolically solving this, you could also use a numeric solver, which can happily work with the output of the interp function:

Success!
Luc

23-Emerald I
(To:corne_m)

Rather than "regress" you might try "polyfit."  Polyfit returns a function so you don't have to extract the coefficients from a vector.

21-Topaz II
(To:corne_m)

Hello !,

you simply have to reset the symbolic variables

4-Participant
(To:corne_m)