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

SOLVED
Newbie

## "FIND" returning a vector of answer

Hello, everyone.

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

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.

Tags (7)
1 ACCEPTED SOLUTION

Accepted Solutions

## Re: "FIND" returning a vector of answer

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

7 REPLIES 7

## Re: "FIND" returning a vector of answer

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

## Re: "FIND" returning a vector of answer

Awesome!

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

Thank you.

## Re: "FIND" returning a vector of answer

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

Alan

## Re: "FIND" returning a vector of answer

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.

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

## Re: "FIND" returning a vector of answer

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

## Re: "FIND" returning a vector of answer

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:

OR

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!

## Re: "FIND" returning a vector of answer

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

Alan

Announcements
Check out the latest