Get Help

Turn on suggestions

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

Showing results for

- Community
- :
- PTC Mathcad
- :
- PTC Mathcad
- :
- "FIND" returning a vector of answer

Options

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

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

Showing results for

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

01-13-2014
06:36 AM

01-13-2014
06:36 AM

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

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

01-13-2014
07:07 AM

01-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

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

01-13-2014
07:07 AM

01-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

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

01-13-2014
07:13 AM

01-13-2014
07:13 AM

Re: "FIND" returning a vector of answer

Awesome!

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

Thank you.

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

01-13-2014
07:34 AM

01-13-2014
07:34 AM

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

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

01-13-2014
08:05 AM

01-13-2014
08:05 AM

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.

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

01-14-2014
04:34 AM

01-14-2014
04:34 AM

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

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

01-14-2014
06:38 AM

01-14-2014
06:38 AM

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!

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

01-14-2014
06:48 AM

01-14-2014
06:48 AM

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