Exclude single data points from HM results
Hi all,
how can single data points be excluded from the source in HS 2019.1? I have a model from Hypermesh with a few solid elements showing stress singularities due to a freeze contact with beam elements which are physically not valid. Is there a way to exclude single element IDs, a range of IDs, a set or exclude all elements above a certain stress threshold? I could not figure out how to correctly use the filter field in the data source menu.
Answers
-
I'd say there are 2 approaches:
1- if you already know what are the elements with singularity, request stress values only for the non-singular ones into your output file, or renumber these elements, so that they fall into a easy to extract range, let's say, all your singular elements are below ID 1000. This can also be used when you don't want to take all your model into account, and only a part of it. This approach should be easy to perform.
2- using some functions in HSt, to do the trick.
For the second approach, could probably make use of templex and standard functions in HyperStudy.
Having the Data source, you could go back to the response expression builder, and perform a few math operations ; standard operations (these can be found in the Help if you type 'stardard functions'.
<?xml version="1.0" encoding="UTF-8"?>
Let's say this is my data source, taking stress values for all elements in my model.
In my case this data source was assigned under the variable name 'ds_5'
So, in order to retrieve a subrange, i've performed a few suboperations (might not be the best nor the only way):
1- sort the data source ds_5 in ascending order, using the sort command, where the first 0 means ascending order >> sort(0, ds_5) >> output: a vector ordered in asceding order with my stress values
2- extract a portion of my data, using the subrange command. This command takes an ordered list, and a lower and upper limit, and returns the index of each value found within this range >> subrange( sort(0,ds_5) , 0 , 3e8) >> output: a vector of indices of the sorted ds_5, that have values between 0 and 3e8.
3- having the list of the indices lower than 3e8, i've extracted these values from the sorted list, using the [ ] >> sort(0,ds_5) [subrange( sort(0,ds_5) , 0 , 3e8)] >> output: an ordered list with only the stress values between 0 and 3e8.
4- just to have the maximum of the remaining values, i've used max command.
So the final command was:
max( sort(0,ds_5) [subrange( sort(0,ds_5) , 0 , 3e8)] )
which in my case gave me a value very close to my boundary, because I had no singularity.
2.99566816e+08
<?xml version="1.0" encoding="UTF-8"?>
I hope this helps you or someone has an easier approach.
0 -
Thank you very much for your detailed response, this helps a lot already. Could you point me to a function or combination of functions that lets the user exclude a fixed number n of the highest values? For now, there seem to be less than 10 problematic elements. I'm thinking of something, but I'm very new to Hyperstudy and need to look up how it's done:
1. Sort the data source in new vector
2. Define n, fetch highest element ID of new vector
3. Pick all elements from 0 to highest_ID minus n
Your solution is good, but when I think about it, not well applicable to my case since there might be other, non-problematic elements that might surpass this threshold and those would need to be reported in the data source. Renumbering is of course an option, but if other elements become problematic in some cases, it wouldn't be enough either.
0 -
you will need something like below:
sort(0,ds_5)[ 0:numpts(ds_5) - 25 : 1]
numpts(ds_5) >> gives the number of elements in data source ds_5
0:numpts(ds_5) - 25 : 1 >> gives a vector of integer value ranging from 0 to numpts(ds_5) - 25 (any value), stepping by 1
this vector of integers is used as indices for the sorted ds_5.
An important point here is that templex has index counter starting in 0.
So a vector goes from 0 ... numpts(vector)-1
0 -
I thank you very much for your input, it's a great help /emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />
0