Turn on suggestions

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

Showing results for

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

Showing results for

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

Sep 05, 2022
11:28 AM

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

Sep 05, 2022
11:28 AM

Math equation problem of finding too many different answer,

From this topic,

https://community.ptc.com/t5/Mathcad/How-to-only-get-one-value-from-the-answer/m-p/821656#M202449

I know how to find the real answer from the equation, but I have other questions.

I have a fours curve in this figure, and if I want to find this fours curve's peak position, I need to use the below equation. but if I have 100 curves I need to type 100 times, is there any efficient way I could do it quickly?

Solved! Go to Solution.

Labels:

1 ACCEPTED SOLUTION

Accepted Solutions

Sep 05, 2022
12:07 PM

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

Sep 05, 2022
12:07 PM

I already made one or two suggestions for a function f.center(Q,k) in the other two threads.

My favorite still is the numerical approach using the "root" function:

It looks like the peaks for k=6 never go beyond x=1, no matter what the value of Q might be. So we possibly could replace the 1000 in the "root" command by a 1 or 2.

BTW, the plotting of the locus curve of all peaks was done inefficient by me because the function f.center is called twice for every point plotted. It would be less time consuming to use precalculated vectors for plotting.

6 REPLIES 6

Sep 05, 2022
12:07 PM

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

Sep 05, 2022
12:07 PM

I already made one or two suggestions for a function f.center(Q,k) in the other two threads.

My favorite still is the numerical approach using the "root" function:

It looks like the peaks for k=6 never go beyond x=1, no matter what the value of Q might be. So we possibly could replace the 1000 in the "root" command by a 1 or 2.

BTW, the plotting of the locus curve of all peaks was done inefficient by me because the function f.center is called twice for every point plotted. It would be less time consuming to use precalculated vectors for plotting.

Sep 06, 2022
10:51 AM

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

Sep 06, 2022
10:51 AM

Hi @Werner_E ,

It seems that using the root command is the best way to draw the figure that I want. Thanks.

May I know why you said "plotting of the locus curve of all peaks was done inefficient ?"

Do you mean the yellow line?

Sep 07, 2022
05:41 PM

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

Sep 07, 2022
05:41 PM

May I know why you said "plotting of the locus curve of all peaks was done inefficient ?"

Do you mean the yellow line?

Yes. This is the curve, all peaks lie on (for k=6 and variable Q)

Sep 06, 2022
05:02 AM

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

Sep 06, 2022
05:02 AM

No need to worry.

Know that you (can) have an expression for the root you are looking for:

Gives a symbolic expression that is probably too big for Mathcad 15 to show, but you can still use it, to get the value of x in terms of Q and k:

Check:

OK. Now you can supply an array of values for Q (or k) to calculate the results:

(Note you have to vectorise the expression).

And you can plot it:

Success!

Luc

Sep 06, 2022
10:53 AM

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

Sep 06, 2022
10:53 AM

Hi @LucMeekes ,

Thanks.

May I know why you need to use sqrt() and ORIGIN in the equation?

because you said that using the root to solve it.

Sep 06, 2022
11:03 AM

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

Sep 06, 2022
11:03 AM

As shown in the other thread (https://community.ptc.com/t5/Mathcad/How-to-only-get-one-value-from-the-answer/m-p/821532#M202423) I used a substitution: y=x^2. That gives 3 possible values for y (instead of 6 for x) through the function K2'y(Q,k). Since the first result is positive, that's the one you (apparently) need. And the first element of an array is indexed with ORIGIN.

I don't use the root() function, but take the square root, sqrt() if you will, to go from y back to x.

Success!

Luc