
Re: Possible to create iterative solve blocks?
WE Jun 6, 2013 5:00 PM (in response to ptc4397077)Not sure what kind of iteration you are talking about in the subject.
But if you get riod of the range variable and the elementwise (subscribted/indexed) notation using it, make E a 3x1 vector and, again, use vectorize, you get a solution.
Not sure about what you mean with only one equ would give a solution?
Concerning error catching you could turn the solve block into a parameterized function (whatever the input parameters would be) and create a new function using the "on error" statement to return NaN if the solve block function fails. See attached
But in your case it failed always because of kind bad syntax.

Re: Possible to create iterative solve blocks?
AndyWesterman Jun 7, 2013 7:25 AM (in response to ptc4397077)If you make the solve blocks as parameterized functions you can calculate the 3 results.
if some of them don't converge to a solution there was a function "ReDefine" posted on this forum which takes a text string parameter.
if there is a variable of that name it returns the value, if not it returns "Undefined" & this can be used in subsequent calculations.
Hope this is what you want
regards
Andy

Re: Possible to create iterative solve blocks?
ptc4397077 Jun 7, 2013 8:11 AM (in response to AndyWesterman)Thank you Werner; the vectorize function and the error check function are very useful. This worksheet will ultimately be used for the anchorage for a large number of columns, some of which will make allow the different Ac equations to be solvable for E and some will not be solvable for E based on the input parameters.
Is it possible for the solution of the f(E) function to show the solution E value for instances when the equation is solvable and NaN for instances when it is not? For example, in the attached worksheet, all three areas, 130, 140, and 150 in^2, will create a solution for the exterior column equation but only 140 and 150 in^2 will create a solution for the interior column. Is it possible for the g(gs) function to provide a 3 position vector with NaN in the first position and the solution E values in the second and third position instead of just providing a NaN for the entire solution?
Andy, I’ve never seen this redefine function before, thank you very much. I’m going to figure out how this page works, it looks like it may provide the functionality I’m after.
EDIT: The e1, e2, e3 functions work well when the parameters solve all three equations, thanks! What exactly should go into the ReDefine function to make the esub1, esub2, & esub3 work when the parameters don't solve the Ac equations?

Re: Possible to create iterative solve blocks?
AlanStevens Jun 7, 2013 12:23 PM (in response to ptc4397077)Daniel Sochor wrote:
Is it possible for the solution of the f(E) function to show the solution E value for instances when the equation is solvable and NaN for instances when it is not? ...
Like so?
Alan

Re: Possible to create iterative solve blocks?
ptc4397077 Jun 7, 2013 2:24 PM (in response to AlanStevens)That is what I was trying to do, thank you Alan!

Re: Possible to create iterative solve blocks?
WE Jun 7, 2013 2:44 PM (in response to AlanStevens)With Alan's approach we can go back to let E, a, b, etc. be single scalar values and the equation in the solve block would not have to ve vectorized as its working on scalars only.
If it is necessary to provide different values of a, b, etc. for the different values of A.c, you could make them additional paremeters  see at the end of the attached file.

Re: Possible to create iterative solve blocks?
ptc4397077 Jun 18, 2013 2:14 PM (in response to WE)Thank you Werner for including the eval function. As can be seen in the first attachment, the prior mentioned vectorized error function was producing erroneous results.
Is it possible to force the eval command to accept 7 functions so that 3rd corner equation can be used?

Re: Possible to create iterative solve blocks?
WE Jun 18, 2013 3:55 PM (in response to ptc4397077)As can be seen in the first attachment, the prior mentioned vectorized error function was producing erroneous results.
?? Do you mean because the first value differs from the others? This is because your kloop runs from 1 to last(E) and not from 0 to last(E) as it should. Unless changed Mathcad defaults to begin indexing with 0, not with 1.
The solve block finds no solution, as the way you did it can not work. In the solve block function A.c and E are scalars, but a and b are still vectors.
For individual error checking you have to change the solve block to work with scalars only. See attached

Re: Possible to create iterative solve blocks?
WE Jun 18, 2013 4:48 PM (in response to ptc4397077)Is it possible to force the eval command to accept 7 functions so that 3rd corner equation can be used?
Sure, just add m.b as a parameter to all functions  see attached.
Find at the end of the file a modified evalfunction which takes scalars and vectors of different length as parameter  for whatever it may be worth.

Re: Possible to create iterative solve blocks?
ptc4397077 Jan 7, 2014 10:10 AM (in response to WE)Is it possible to modify the function in yellow to not consider or output complex results?






