cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

find value from matrix

YA_10963798
9-Granite

find value from matrix

need to find q1 which is basically the values of qcza( known variable) qcza is the resistance in known depth [z]. 

q1 is equal to qcza when the depth is between 0.7D<z< 4D when D=0.4 and it has always to choose the minimum value until there is smaller value. the file is attached

2024-03-02 (2).png

1 ACCEPTED SOLUTION

Accepted Solutions

So lets see if this next try comes closer to what you have in mind ...

Werner_E_0-1709388535593.png

Prime 9 file attached

 

View solution in original post

15 REPLIES 15

Its not perfectly clear to me what you are looking for.

As I understood:

1) Input value is a length D (in your example 0.4 m)

2) a range is calculated running from 0.7*D up to 4*D (in your example 0.28 m up to 1,6 m)

3) We look up all the q-values corrsponding to the range calculated in #2 and select the smallest of them

In your example the output would be 2.22 MPa (which by chance happens to be at the upper end of the interval. Is this correct?

Or should we chose the q-value corresponding to the smallest z-value (-> 5.721 MPa, first value in interval)?

OR ...?

BTW, your data looks a bit ... erratic, doesn't it?

Werner_E_3-1709380726047.pngWerner_E_4-1709380735448.png

 

Here is how I would implement the algorithm described above - as a function with D as input and the q-value as output.

Werner_E_0-1709383316588.png

Prime 9 worksheet attached

 

The input values are z and qcza
Where z is the depth and qcza is the resistance in each z depth … for example at depth z= 0.2 m the resistance is qcza=3.995 MPa
d = 0.38 m ..0.7d=0.2 m and 4d = 1.4 m
 
Now q1 is equal to qcza when z is between (0.2<z<1.4) 
 
 
I need to write a program showing the values of q1 as a range 
Considering that q1 should be always small when going deeper .
For example if qcza is equal to = 7 /8 /6/7/9 
The program should choose q1 as q1= 7/ 7/6/ 6 
Always goes with the smaller number 
I hope you get it 


@YA_10963798 wrote:
The input values are z and qcza

No! z and qcza are the data vectors for length and pressure (you call it depth and resistance, but I don't care about the meaning of the data).

The input seems to be a single length/depth Db. You provided 0.4 m as an example

Its still not clear what the output, the result, should be. I assumed it to be a single pressure value (as described above) but I can't be sure. You did not answer my question if the result of the input value D.b=0,4m really should be 2,22 MPa. If not, what else should the result be and why?

 


Now q1 is equal to qcza when z is between (0.2<z<1.4) 
 

q1? q1 is the desired result, the output. But how could q1 be equal to qcza??? qcza is a vector with 1339 entries!

 


I need to write a program showing the values of q1 as a range 
Considering that q1 should be always small when going deeper .
For example if qcza is equal to = 7 /8 /6/7/9 
The program should choose q1 as q1= 7/ 7/6/ 6 
Always goes with the smaller number 
I hope you get it 

The leaves me clueless, sorry!

Actually q1 should be also a vector 

qcza is group of values in certain depths and I will have to find q1 , q2 and q 3 which are three smaller groups of values in the main group qcza. 

q1 is equal  qcza in the depth 0.2 and 1.4 

and q 2 is equal to qcza in the depth 1.4 and 2.8 

However qcza values are random while specifying the range of q1  I need the program to choose the smaller values when it goes down in depth z  

if qcza is equal to = 7 /8 /6/7/9 MPa
The program should choose q1 as q1= 7/ 7/6/ 6 should not accept higher values
Always goes with the smaller number 

> The program should choose q1 as q1= 7/ 7/6/ 6 

Shouldn't there be a fifth value 6 at the end?

 

You always talk about q1 and now q2, q3 without saying what q2, q3 should be.

As I understood so far now every input value Db should return a vector of pressure values where each value is either equal or lower than the previous?

In case thats what you want, - do you also need the corresponding subvector of z-values? Or is all you need the vector q1?

So lets see if this next try comes closer to what you have in mind ...

Werner_E_0-1709388535593.png

Prime 9 file attached

 

wow that's impressive 

I will try it thank you so much for your great help

If you feel uncomfortable with using "match" and "submatrix", here is a version which may be clearer to read and follow. The result is the same of course

Werner_E_0-1709408994520.png

 

 

it works thank you so much. I made some changes but your solution was impressive. If you have time you should have a Youtube channel you are a great teacher . Once again thank you 

Its a bit lengthier if you also need the the corresponding z-value

Werner_E_0-1709384167817.png

Werner_E_1-1709384219122.png

Prime 9 sheet attached

 

Thank you so much I will try it 


@YA_10963798 wrote:

Thank you so much I will try it 


Hope it helps.

I had not read your second posting (which I have to admit did not understand) when I posted the sheet. So the routine just follows what I had outlined.

The input values are z and qcza
Where z is the depth and qcza is the resistance in each z depth … for example at depth z= 0.2 m the resistance is qcza=3.995 MPa
d = 0.38 m .. 0.7d=0.2 m and 4d = 1.4 m

Now q1 is equal to qcza when z is between (0.2<z<1.4)

I need to write a program showing the values of q1
Considering that q1 should be always small when going deeper .
For example if qcza is equal to = 7 , 8,6,7,9
The program should choose q1 as q1= 7, 7, 6, 6
Always goes with the smaller number
I hope you get it

ttokoro
20-Turquoise
(To:YA_10963798)

image.png

ttokoro
20-Turquoise
(To:ttokoro)

image.png

Top Tags