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

Community Tip - Learn all about PTC Community Badges. Engage with PTC and see how many you can earn! X

Translate the entire conversation x

"FIND" returning a vector of answer

MaxGomes
1-Visitor

"FIND" returning a vector of answer

Hello, everyone.

I'm working in a program to plot a curve of the equation below:

MATHCAD.jpg

I need to have the ADVERL_L found for all different OLAP's, in order to use it below to calculate f(OLAP) and plot it.

I don't know how to use the FIND command to return a vector of answer.

Could someone help me?

Thank you.

ACCEPTED SOLUTION

Accepted Solutions
AlanStevens
19-Tanzanite
(To:MaxGomes)

Include OLAP as an argument to ADVERL in the function, f, and avoid a divide by zero error by only using non-zero vaslues of OLAP - see attached.

Alan

View solution in original post

7 REPLIES 7
AlanStevens
19-Tanzanite
(To:MaxGomes)

Include OLAP as an argument to ADVERL in the function, f, and avoid a divide by zero error by only using non-zero vaslues of OLAP - see attached.

Alan

Awesome!

Now, how do I see the ADVERL answers? Look what I got.

Untitled.jpg

Thank you.

AlanStevens
19-Tanzanite
(To:MaxGomes)

Just pass OLAP[j (that is OLAP subscript j) to ADVERL somewhere below the place where j is defined.

Alan

Werner_E
25-Diamond I
(To:AlanStevens)

As the solve block fails for values of OLAP below 2.5 one quick workaround would be to define j:=25..300 before evaluation.

Another way would be to define a function which traps the error of the solve block failing. You may also use this functions vectorized then as a divison by zero or solve block failing won't matter that way.

13.01.png

Best way probably is to define OLAP at the top beginning with 2.5 and not with 0.

AlanStevens
19-Tanzanite
(To:Werner_E)

I guess it's only positive answers that are wanted, but it's interesting to note that if you start with a negative guess (say -0.1) you get solutions for all of j from 1 to 300. They are all negative though! (And if you start with a complex guess you can get a (complex) solution for OLAP = 0).

Alan

That's right, Alan, only positive answers.

However, I'm facing problem when trying to check ADVERL values.

I was attempting to do what Werner suggested to, but I got the answer below:

Untitled.jpg

OR

Untitled.png

The reason I'm doing this it's because I need to compair the results.

Does anyone know how I make the program ignore the complex and impossible solutions?

Thank you so much for the previously help!

AlanStevens
19-Tanzanite
(To:MaxGomes)

You just need to call ADVERL2 with OLAP sub j like ADVERL2(OLAP[j)= (where [ means subscript) - see image below. The first 24 values will be NaN's because there is no positive solution there as Werner pointed out (the ln(1-ADVERL) term becomes complex when ADVERL is greater than 1).

find.PNG

Alan

Announcements

Top Tags