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?
Solved! Go to Solution.
Just pass OLAP[j (that is OLAP subscript j) to ADVERL somewhere below the place where j is defined.
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.
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).
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:
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!
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).