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

## Math equation problem of finding too many different answer,  9-Granite

## Math equation problem of finding too many different answer,

From this topic,

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? 1 ACCEPTED SOLUTION

Accepted Solutions  24-Ruby V
(To:Jason_power)

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  24-Ruby V
(To:Jason_power)

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.  9-Granite
(To:Werner_E)

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?  24-Ruby V
(To:Jason_power)

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)  23-Emerald III
(To:Jason_power)

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  9-Granite
(To:LucMeekes)

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.  23-Emerald III
(To:Jason_power)

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 Announcements