Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X
Hi there I need some help to simplify the program that I made in Mathcad Prime 3.1 . I am using lookup to get the required profile. But there are 2 conditions that I need to satisfy. If in condition 1 satisfied the pre selected profiles. Condition two also should pass the utilization. If condition two did not pass how this will pre select up to a higher value to satisfy both conditions. I attached the file for your reference.
Solved! Go to Solution.
I have experience that it does not work most of the time.
What you then should do is iterate inside the program for each of the input values.
So in essence:
r <- ORIGIN
if IsArray(x)
for i el ORIGIN...last(x)
Rr <- Select(xi,yi,data)
r <- r+1
return R
will give you a nested array with the results.
Assumption is that y is as long as x. If not, your program becomes more complex.
Success!
Luc
Many of us cannot open Prime 3.1 files. Can you post a PDF of the whole document and/or better explain what you're trying to do.
Your Prime file doesn't run for me. The Excel file is missing and a number of variables are undefined (due thereto?).
I see no way to use the lookup functions of Prime to do what you need. It can be done using a program, see my example below in the program "Select", and two examples of its use:
This was done in Mathcad 11, (my Prime Express doesn't allow programming),
but you should be able to recreate the Select function in Prime.
Success!
Luc
HI Luc,
I tried to adopt your program and this is the result I am getting . How can I get the optimum value?
Thank you
Lex,
What is the criterion for the optimum solution?
Luc
Luc,
The last selection
Luc,
Hi. The last selected profile should be the answer since x and y already satisfy the criteria.
I have another problem. when I tried to make a couple of array this is what happened. Vectorization is possible in this formula?
In Luc's definition of "select", if you change R[r in the fourth line to just R, you should get what you want. You can then also delete the first and fifth lines.
To use the vectorize option, you must place it over the called function. I'm not sure if it will work with Luc's program or not. It would look something like this:
test := select(M1,M2,data) =
(I used underline where you should place the vectorize modifier)
M1 & M2 are your input matricies.
Mark
This one works thank you.
Lex,
Thanks goes to Luc - he did the hard part.
Also, here's a more optimized way to achieve what you want. This cycles backwards and stops the program when it finds the first solution (from the bottom) istead of cycling through every line. I checked, and it works with the vectorize notation.
I would also recommend adding a line in case there is no solution:
HI Mark.
Using Math cad prime 3.1 this is the correct program . I am not getting the same result
Lex,
Here is what the solution looks like in Prime:
I have experience that it does not work most of the time.
What you then should do is iterate inside the program for each of the input values.
So in essence:
r <- ORIGIN
if IsArray(x)
for i el ORIGIN...last(x)
Rr <- Select(xi,yi,data)
r <- r+1
return R
will give you a nested array with the results.
Assumption is that y is as long as x. If not, your program becomes more complex.
Success!
Luc
Thank you for your effort and assistance .
Hi.
Here is the attached excel file and pdf file format.
Step 1: I used lookup "It" to get the pre-selected profile by deflection criteria,
Step 2: I used lookup "eq" to select the profile base on step 1
Step 3: I used look up "eq" to select section modulus from the excel data.
Step 4: some condition the design moment will exceed from the allowable.
Step 5: I need to compare step 1 and 4 if both will satisfy the design criteria otherwise step 1 will select another data to satisfy step 4.
I don't know if this will be clear to you now.
Regards