Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi there
Can you help to reach a graph merged to the classification I have
I have this graph
and I did a classification to the data in this graph ... what I need now is to merge the classification with the graph and make them obvious layers and then find the average in each layer
like this
By obvious layers I mean > a program wil be able to say from z1 to z50 >> it is a sand layer and the average Q in that layer is 10 MPa ( as an example)
Is that possible ?
Thank you in advance .. the sheet is attached
Solved! Go to Solution.
So it looks that I was wrong when I counted 14 distinct layers. My program says there are 19.
As only layers with pressure above 25 MPa should be classified as "Grind" I classified layers with pressure below 0,1 MPa and pressures between 2 and 5 MPa as "undefined" as you didn't specify otherwise.
Furthermore as you did not say which class a pressure of exactly 0.2 MPa should be applied to, I have chosen "Clay".
So you may look for a table like this?
If had chosen to strip he unit for the average pressure because Prime unfortunately is not able to show MPa in the table and I considered the values in Pa to look too ugly and not clear enough.
I don't see why you function "Class" uses argument "d". Actually its just "Class(q)" as classification depends on pressure q only.
The way you write that function would mean that "Grind" actually is found in three intervals of pressure: (0 MPa; 0.1 MPa), (2 MPa; 5MPa) and everything largen than 25 MPa. Is this really as it should be?
There is also a small discrepancy as 0.2 MPa would be "Peat" as well as "Clay". The way you wrote it, "Clay" wins in case q=0.2 MPa.
Your hand-drawn diagram looks as if the different classes are not only contiguous in terms of pressure, but also in terms of depth. However, this does not necessarily have to be the case (and is not, indeed), which raises the question of how it should be handles as, for example, “clay” occurs at a depth of -2.87 m to -3.1 m, but also from -5.63 m to 12.27 m, with “grind” occurring in between, from -3.1 m to -5.63 m.
Should the average value of both “clay” areas be given together, or should this be handled as two separate areas (which would be more complex)?
As far as I can see in your data there are six separated areas of "grind" (including (0,0) as a singular point). four separate areas of "sand", three separate areas of "clay" and no "peat" at all.
Using a log scale at the abscissa we can see better that there are no values in the range of 0.1 MPa to 0.2 MPa ("Peat"). Of course the singular "grind" point at (0,0) is not display as 0 would be at minus infinity at the abscissa 😉
BTW, didn't we had a thread with a very similar question in the past? Maybe this one?
Hi Werner
1) Grind should be only the values above 25 MPa < so I guess I wrote it wrong
2)
For the average value > you said : for example, “clay” occurs at a depth of -2.87 m to -3.1 m, but also from -5.63 m to 12.27 m, with “grind” occurring in between, from -3.1 m to -5.63 m.>>> what I need to do in this layer where clay accours is to define these depths , and say from -2.87m to -3.1m the average q is 0.3 MPa ( by using average function for that specific layer)
and then do the same for the following layer >>> so it repeats itself whenever the classification changes.
see the yallow lines : so instead of having so many qc in each layer I need only the average value .
I need to generate a table or matrices or what so ever showing where the layer starts and ends and what is average q in that layer.
3)And what should be returned as the 'average' of the non-existing "peat" section? It can be (NAN)
BTW it is not the same thread > previously in the calculation I already have the depths and the layers specified in a table ; this one
I knew where the layer starts and ends and we match the depths from CPT ( z) with the depths of the layer :
Now I need to specify the layer and generate a table from there
Thank you so much for your help . As always amazing
Yusra
So it looks that I was wrong when I counted 14 distinct layers. My program says there are 19.
As only layers with pressure above 25 MPa should be classified as "Grind" I classified layers with pressure below 0,1 MPa and pressures between 2 and 5 MPa as "undefined" as you didn't specify otherwise.
Furthermore as you did not say which class a pressure of exactly 0.2 MPa should be applied to, I have chosen "Clay".
So you may look for a table like this?
If had chosen to strip he unit for the average pressure because Prime unfortunately is not able to show MPa in the table and I considered the values in Pa to look too ugly and not clear enough.
I think you are the best person I have ever not met in my life. Thank you soooooooooooooooo much that exactly what I need
Notice that I edited my answer above while you were answering and added the pot of the average values.
Hi Werner
Do you know why I'm having this error > I changed the origin to be 1 and it works with all the function except for R > it says it has to be function. The only differecnce between yours and mijn is the origin
I tried to fix it ..but this happens
and I also want to get the q- averg alone > is not the method to do that is to put matrix index
Thanks
1) You have to replace both R<rows(R)> with R<O+rows(R)> as it looks you defined O <-- ORIGIN somewhere at the top
2) The output of "getLayers" is a 19x8 matrix, not a vector. To get the column with the averages you have to use the column selector (Ctrl+Shift+C), not the vector index.
Great that works
Although I don't know how it works , but it works .
Thanks
Prime unfortunately does not provide an empty array as data type. So it can be a bit tricky/annoying to initialize a matrix which is created row by row. It would be natural to use R<-stack(R,[...]) in a loop but this only works if R is already existing with the correct number of columns. So the first row must be created in a different way, usually requiring some kind of if rows(R)=0 then R<- [...] else R<-stack(R,[...]).
rows(R) returns 0 for a variable which is a scalar or which is not yet defined in the program. So R<rows(R)> (with <...> meaning the row selector, not the column selector) denotes row number 0. In case you changed ORIGIN from 0 to something else there is no row #0 and the first row rather has the number ORIGIN.
When the program continues and the matrix R already contains one row, rows(R) returns 1 and ORIGIN+1 is the number of the next row to assign.
