Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
Hello All,
In the attached mathcad15, i'd like to automate the output "Z.summary" for each steel thickness "ts" instead of doing each individually.
On page 6, i had to create Z summary for each steel thickness ts=0.142, 0.150, .... How can i have it show for each steel thickness the corresponding Z.summary without having to individually putin the row number 0,1,..? i showed the results for Zsummary for t=0.142 and 0.150.
Thank you,
Sam
Solved! Go to Solution.
I stopped at the first error encountered and I guess the other errors are of similar nature.
The problem is that a comparisaon like <= needs scalars on both sides and unfortunately we cannot vectorize <= etc directly. But we can create an auxiliary function and then we can call that function vectorized with your input values:
Generally its a good idea to turn the calculations into functions which work for scalars at input value and only then call those functions vectorized with your vector input values.
I picked your attempt to calculate Penetration_Reduction_factor and noticed, that you did not consider all possible cases:
You should always consider all cases, even though you may think that a specific case can't happen. You may use "if" and "otherwise" or use "return" on every if statement and put the output value for all other cases in the last line of the program.
As an example:
Thank you so much Werner!
I fixed what you suggested and attached the file. If you look on page 6, to get the final results for each thickness, i have to individually go and change the row number to extract the data for each thickness. For example ts=0.158, i use row 2, ts=0.188, row 3 and so on. If i have 30 thicknesses, how can i automate the row number ? All results data can all be in one table with the corresponding column and row headings.
Thanks
Sam
Would this be of help?
Great. Thanks a lot Werner!
Sam