Getting index of data source at specific value in HyperStudy

Dominik T.
Dominik T. Altair Community Member
edited September 2022 in Community Q&A

Hello,

i have two curves as output sources in HyperStudy.

Now I need the index at a specified value of one curve. It is possible that this specified value is not exactly included in the data source. So maybe it has to be interpolated.

Then as second step I want to use the founded index of the first source in a second source to get a value.

Example:

f1(index1)=100 <=> index1 = ?

*value=100 must not be included in the data source. For example there could be included 99 and 102.

f2(index1)=?

 

Thanks a lot!

Best Answer

  • Michael Herve
    Michael Herve
    Altair Employee
    edited September 2022 Answer ✓

    Hello,

     

    If I understand you correctly, you have two data sources representing a X vs Y curve (force vs deflection, Stress vs strain,...), and you want to know what is the Y value corresponding to the X value, with the possibility that X target value does not belong to the data source.

    For such cases, you don't ned, the index, you can use the statement lininterp (for linearinterpolation).

    Let's name ds_X your data source for X vector, ds_Y your data source for Y vector, and targetX the target valeur, then the formula is:

     

    lininterp(ds_X,ds_Y,targetX)

     

    Hope this helps

    Michael

Answers

  • Michael Herve
    Michael Herve
    Altair Employee
    edited September 2022 Answer ✓

    Hello,

     

    If I understand you correctly, you have two data sources representing a X vs Y curve (force vs deflection, Stress vs strain,...), and you want to know what is the Y value corresponding to the X value, with the possibility that X target value does not belong to the data source.

    For such cases, you don't ned, the index, you can use the statement lininterp (for linearinterpolation).

    Let's name ds_X your data source for X vector, ds_Y your data source for Y vector, and targetX the target valeur, then the formula is:

     

    lininterp(ds_X,ds_Y,targetX)

     

    Hope this helps

    Michael

  • Dominik T.
    Dominik T. Altair Community Member
    edited September 2022

    Hello,

     

    If I understand you correctly, you have two data sources representing a X vs Y curve (force vs deflection, Stress vs strain,...), and you want to know what is the Y value corresponding to the X value, with the possibility that X target value does not belong to the data source.

    For such cases, you don't ned, the index, you can use the statement lininterp (for linearinterpolation).

    Let's name ds_X your data source for X vector, ds_Y your data source for Y vector, and targetX the target valeur, then the formula is:

     

    lininterp(ds_X,ds_Y,targetX)

     

    Hope this helps

    Michael

    Hi Michael,

    your suggested solution works perfectly.

    Thanks a lot!