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

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Find points of a function quadratic

Yuradi
5-Regular Member

Find points of a function quadratic

Hello, my question is if there is a way to find all the points given a vector Y1, for a function, without having to evaluate each one manually (as seen in my file with point 4.609 and finding the X1 = 0.677), that the vector Y1 will change values (but all within the range of vectors X and Y), Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Werner_E
24-Ruby V
(To:Yuradi)

OK, we still don't know what you are really looking for - all solutions for any value in Y1, all solution in the X-range for every value in Y1 or just the smallest, first solution in the X-range for every value in Y1.

So here you get them all 🙂

I omitted any symbolics for the aforementioned limitation in Prime and used polyfit to get all solutions. This also means that you can't use this method if you intend to fit for anything else than a polynomial.

B1.png

B3.png

View solution in original post

6 REPLIES 6

May be so

zz.png

Fred_Kohlhepp
23-Emerald I
(To:Yuradi)

You can turn your solve block into a function:

Capture.PNG

Better use root not Find - it works in Express too

zzz.png


@ValeryOchkov wrote:

Better use root not Find - it works in Express too

zzz.png


Good point!

Werner_E
24-Ruby V
(To:Yuradi)

Please be more precise about what you are looking for at the end of the day.

As you fit with a polynomial of n-th order you will get n solutions for any value in your vector Y1. Not all of them may be real, not all of them may be within the range of X.

Are you looking for a n x 10 matrix of results consisting of all five solutions for all n values in Y1???

Your vector Y1 contains only two different values. With 4.609 (and n=5) we get five real solutions and two of them are in the range of X.

With 5.986 there is only one real solution at x=68.22. Way off the range of X. What do you expect as result here?

If you are only interested in the smallest solution within the range min(X) and max(X) you have to say so and also specify, what the result should be if there is no such solution (suggestion: NaN).

Or do you really want the n x 10 matrix?

Here is a small example how to get all solution using symbolic solve and defining the function QF in a way the coefficients are seen (otherwise the symbolics can't work with QF).

Unfortunately on contrary to real Mathcad we can't turn a symbolic evaluation into a function in limited Prime. So to deal with the different values in Y1 you would still have to resort to numeric methods. To get all roots of a polynomial you might use "polyroots".

B.png

Werner_E
24-Ruby V
(To:Yuradi)

OK, we still don't know what you are really looking for - all solutions for any value in Y1, all solution in the X-range for every value in Y1 or just the smallest, first solution in the X-range for every value in Y1.

So here you get them all 🙂

I omitted any symbolics for the aforementioned limitation in Prime and used polyfit to get all solutions. This also means that you can't use this method if you intend to fit for anything else than a polynomial.

B1.png

B3.png

Top Tags