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

** Community Tip** - Did you get an answer that solved your problem? Please mark it as an Accepted Solution so others with the same problem can find the answer easily.
X

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

Jan 13, 2014
06:36 AM

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

Jan 13, 2014
06:36 AM

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

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

Jan 13, 2014
07:07 AM

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

Jan 13, 2014
07:07 AM

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

Jan 13, 2014
07:07 AM

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

Jan 13, 2014
07:07 AM

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

Jan 13, 2014
07:13 AM

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

Jan 13, 2014
07:13 AM

Awesome!

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

Thank you.

Jan 13, 2014
07:34 AM

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

Jan 13, 2014
07:34 AM

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

Alan

Jan 13, 2014
08:05 AM

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

Jan 13, 2014
08:05 AM

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.

Jan 14, 2014
04:34 AM

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

Jan 14, 2014
04:34 AM

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

Jan 14, 2014
06:38 AM

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

Jan 14, 2014
06:38 AM

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!

Jan 14, 2014
06:48 AM

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

Jan 14, 2014
06:48 AM

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