Get Help

Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- Find points of a function quadratic

Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

07-10-2018
12:55 AM

07-10-2018
12:55 AM

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.

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

07-10-2018
01:30 PM

07-10-2018
01:30 PM

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.

6 REPLIES 6

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

07-10-2018
04:40 AM

07-10-2018
04:40 AM

Re: Find points of a function quadratic

May be so

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

07-10-2018
06:48 AM

07-10-2018
06:48 AM

Re: Find points of a function quadratic

You can turn your solve block into a function:

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

07-10-2018
07:04 AM

07-10-2018
07:04 AM

Re: Find points of a function quadratic

Better use root not Find - it works in Express too

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

07-10-2018
07:48 AM

07-10-2018
07:48 AM

Re: Find points of a function quadratic

@ValeryOchkov wrote:

Better use root not Find - it works in Express too

Good point!

Highlighted
##

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

07-10-2018
11:48 AM

07-10-2018
11:48 AM

Re: Find points of a function quadratic

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".

Highlighted

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Notify Moderator

07-10-2018
01:30 PM

07-10-2018
01:30 PM

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.